create() — astro Function Reference
Architecture documentation for the create() function in utils.js from the astro codebase.
Entity Profile
Dependency Diagram
graph TD cee8f92a_5749_0f9c_000d_6a4657b2e205["create()"] b6a0ecd8_ebff_7ea1_d777_730d1e46877b["PassthroughFontResolver"] cee8f92a_5749_0f9c_000d_6a4657b2e205 -->|defined in| b6a0ecd8_ebff_7ea1_d777_730d1e46877b 72c2bba5_c80b_7e61_ca08_1515b4d67fb2["hashObject()"] cee8f92a_5749_0f9c_000d_6a4657b2e205 -->|calls| 72c2bba5_c80b_7e61_ca08_1515b4d67fb2 style cee8f92a_5749_0f9c_000d_6a4657b2e205 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/astro/test/units/assets/fonts/utils.js lines 121–135
static async create({ families, hasher }) {
/** @type {Map<string, import('../../../../dist/index.js').FontProvider<Record<string, any>>>} */
const providers = new Map();
for (const { provider } of families) {
provider.name = `${provider.name}-${hasher.hashObject(provider.config ?? {})}`;
providers.set(provider.name, /** @type {any} */ (provider));
}
const storage = new SpyStorage();
await Promise.all(
Array.from(providers.values()).map(async (provider) => {
await provider.init?.({ storage, root: new URL(import.meta.url) });
}),
);
return new PassthroughFontResolver(providers);
}
Domain
Subdomains
Calls
Source
Frequently Asked Questions
What does create() do?
create() is a function in the astro codebase, defined in packages/astro/test/units/assets/fonts/utils.js.
Where is create() defined?
create() is defined in packages/astro/test/units/assets/fonts/utils.js at line 121.
What does create() call?
create() calls 1 function(s): hashObject.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free