Home / Function/ resolve() — astro Function Reference

resolve() — astro Function Reference

Architecture documentation for the resolve() function in fs-font-file-content-resolver.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  a5018a94_0b25_dd70_82d7_09add5f7fea0["resolve()"]
  ef761255_239d_91c8_3761_4414b91dab35["FsFontFileContentResolver"]
  a5018a94_0b25_dd70_82d7_09add5f7fea0 -->|defined in| ef761255_239d_91c8_3761_4414b91dab35
  style a5018a94_0b25_dd70_82d7_09add5f7fea0 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/src/assets/fonts/infra/fs-font-file-content-resolver.ts lines 14–27

	resolve(url: string): string {
		if (!isAbsolute(url)) {
			// HTTP URLs are enough
			return url;
		}
		try {
			// We use the url and the file content for the id generation because:
			// - The URL is not hashed unlike remote providers
			// - A font file can renamed and swapped so we would incorrectly cache it
			return url + this.#readFileSync(url);
		} catch (cause) {
			throw new AstroError(AstroErrorData.UnknownFilesystemError, { cause });
		}
	}

Domain

Subdomains

Frequently Asked Questions

What does resolve() do?
resolve() is a function in the astro codebase, defined in packages/astro/src/assets/fonts/infra/fs-font-file-content-resolver.ts.
Where is resolve() defined?
resolve() is defined in packages/astro/src/assets/fonts/infra/fs-font-file-content-resolver.ts at line 14.

Analyze Your Own Codebase

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

Try Supermodel Free