Home / File/ node-font-type-extractor.ts — astro Source File

node-font-type-extractor.ts — astro Source File

Architecture documentation for node-font-type-extractor.ts, a typescript file in the astro codebase. 5 imports, 0 dependents.

Entity Profile

Dependency Diagram

graph LR
  f32307a9_3d23_1757_78b6_89917659970b["node-font-type-extractor.ts"]
  ef8a1e3f_e350_75a6_b92d_62a8566d8db9["../core/errors/index.js"]
  f32307a9_3d23_1757_78b6_89917659970b --> ef8a1e3f_e350_75a6_b92d_62a8566d8db9
  e92fda44_4a5d_b83b_1a45_958cdae6c91b["./definitions.js"]
  f32307a9_3d23_1757_78b6_89917659970b --> e92fda44_4a5d_b83b_1a45_958cdae6c91b
  ea387312_d0a2_bb52_dafc_3872f7307f95["../../src/assets/fonts/types.js"]
  f32307a9_3d23_1757_78b6_89917659970b --> ea387312_d0a2_bb52_dafc_3872f7307f95
  aca757ac_dcac_a793_a9c5_394cd0d7d313["../utils.js"]
  f32307a9_3d23_1757_78b6_89917659970b --> aca757ac_dcac_a793_a9c5_394cd0d7d313
  c52a5f83_66e3_37d7_9ebb_767f7129bc62["node:path"]
  f32307a9_3d23_1757_78b6_89917659970b --> c52a5f83_66e3_37d7_9ebb_767f7129bc62
  style f32307a9_3d23_1757_78b6_89917659970b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { extname } from 'node:path';
import { AstroError, AstroErrorData } from '../../../core/errors/index.js';
import type { FontTypeExtractor } from '../definitions.js';
import type { FontType } from '../types.js';
import { isFontType } from '../utils.js';

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

Subdomains

Dependencies

  • ../../src/assets/fonts/types.js
  • ../core/errors/index.js
  • ../utils.js
  • ./definitions.js
  • node:path

Frequently Asked Questions

What does node-font-type-extractor.ts do?
node-font-type-extractor.ts is a source file in the astro codebase, written in typescript. It belongs to the CoreAstro domain, RenderingEngine subdomain.
What does node-font-type-extractor.ts depend on?
node-font-type-extractor.ts imports 5 module(s): ../../src/assets/fonts/types.js, ../core/errors/index.js, ../utils.js, ./definitions.js, node:path.
Where is node-font-type-extractor.ts in the architecture?
node-font-type-extractor.ts is located at packages/astro/src/assets/fonts/infra/node-font-type-extractor.ts (domain: CoreAstro, subdomain: RenderingEngine, directory: packages/astro/src/assets/fonts/infra).

Analyze Your Own Codebase

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

Try Supermodel Free