Home / Function/ extract() — astro Function Reference

extract() — astro Function Reference

Architecture documentation for the extract() function in node-font-type-extractor.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  0faa9ea5_a846_2b51_4d70_1312ef1eb34c["extract()"]
  c1ab019c_3564_3b04_dd80_f032344e55fd["NodeFontTypeExtractor"]
  0faa9ea5_a846_2b51_4d70_1312ef1eb34c -->|defined in| c1ab019c_3564_3b04_dd80_f032344e55fd
  style 0faa9ea5_a846_2b51_4d70_1312ef1eb34c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/src/assets/fonts/infra/node-font-type-extractor.ts lines 8–20

	extract(url: string): FontType {
		const extension = extname(url).slice(1);
		if (!isFontType(extension)) {
			throw new AstroError(
				{
					...AstroErrorData.CannotExtractFontType,
					message: AstroErrorData.CannotExtractFontType.message(url),
				},
				{ cause: `Unexpected extension, got "${extension}"` },
			);
		}
		return extension;
	}

Domain

Subdomains

Frequently Asked Questions

What does extract() do?
extract() is a function in the astro codebase, defined in packages/astro/src/assets/fonts/infra/node-font-type-extractor.ts.
Where is extract() defined?
extract() is defined in packages/astro/src/assets/fonts/infra/node-font-type-extractor.ts at line 8.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free