Home / Class/ NodeFontTypeExtractor Class — astro Architecture

NodeFontTypeExtractor Class — astro Architecture

Architecture documentation for the NodeFontTypeExtractor class in node-font-type-extractor.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  c1ab019c_3564_3b04_dd80_f032344e55fd["NodeFontTypeExtractor"]
  f32307a9_3d23_1757_78b6_89917659970b["node-font-type-extractor.ts"]
  c1ab019c_3564_3b04_dd80_f032344e55fd -->|defined in| f32307a9_3d23_1757_78b6_89917659970b
  0faa9ea5_a846_2b51_4d70_1312ef1eb34c["extract()"]
  c1ab019c_3564_3b04_dd80_f032344e55fd -->|method| 0faa9ea5_a846_2b51_4d70_1312ef1eb34c

Relationship Graph

Source Code

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

export class NodeFontTypeExtractor implements FontTypeExtractor {
	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

Frequently Asked Questions

What is the NodeFontTypeExtractor class?
NodeFontTypeExtractor is a class in the astro codebase, defined in packages/astro/src/assets/fonts/infra/node-font-type-extractor.ts.
Where is NodeFontTypeExtractor defined?
NodeFontTypeExtractor is defined in packages/astro/src/assets/fonts/infra/node-font-type-extractor.ts at line 7.

Analyze Your Own Codebase

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

Try Supermodel Free