b() — svelte Function Reference
Architecture documentation for the b() function in utils.js from the svelte codebase.
Entity Profile
Dependency Diagram
graph TD ace7a550_b7b7_88e6_9231_4375f5df3866["b()"] 89f84d70_5c6c_1980_33f9_650ce42a04ab["PromiseOptimiser"] ace7a550_b7b7_88e6_9231_4375f5df3866 -->|defined in| 89f84d70_5c6c_1980_33f9_650ce42a04ab c5b1e5e6_49b7_ac9e_9572_7d6c11e99bc7["has_await_expression()"] ace7a550_b7b7_88e6_9231_4375f5df3866 -->|calls| c5b1e5e6_49b7_ac9e_9572_7d6c11e99bc7 style ace7a550_b7b7_88e6_9231_4375f5df3866 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/svelte/src/compiler/phases/3-transform/server/visitors/shared/utils.js lines 336–357
#apply() {
if (this.expressions.length === 0) {
return b.empty;
}
if (this.expressions.length === 1) {
return b.const('$$0', this.expressions[0]);
}
const promises = b.array(
this.expressions.map((expression) => {
return expression.type === 'AwaitExpression' && !has_await_expression(expression.argument)
? expression.argument
: b.call(b.thunk(expression, true));
})
);
return b.const(
b.array_pattern(this.expressions.map((_, i) => b.id(`$$${i}`))),
b.await(b.call('Promise.all', promises))
);
}
Domain
Subdomains
Calls
Source
Frequently Asked Questions
What does b() do?
b() is a function in the svelte codebase, defined in packages/svelte/src/compiler/phases/3-transform/server/visitors/shared/utils.js.
Where is b() defined?
b() is defined in packages/svelte/src/compiler/phases/3-transform/server/visitors/shared/utils.js at line 336.
What does b() call?
b() calls 1 function(s): has_await_expression.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free