dev-url-resolver.ts — astro Source File
Architecture documentation for dev-url-resolver.ts, a typescript file in the astro codebase. 3 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR 1a8d00c2_d60e_a3ed_34dc_da2290c22401["dev-url-resolver.ts"] 7e4494c0_5563_4329_1bff_a84be66e1bc2["../core/path.js"] 1a8d00c2_d60e_a3ed_34dc_da2290c22401 --> 7e4494c0_5563_4329_1bff_a84be66e1bc2 80b76311_6bb4_2889_b892_492680843683["./utils/url.js"] 1a8d00c2_d60e_a3ed_34dc_da2290c22401 --> 80b76311_6bb4_2889_b892_492680843683 e92fda44_4a5d_b83b_1a45_958cdae6c91b["./definitions.js"] 1a8d00c2_d60e_a3ed_34dc_da2290c22401 --> e92fda44_4a5d_b83b_1a45_958cdae6c91b style 1a8d00c2_d60e_a3ed_34dc_da2290c22401 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import { joinPaths, prependForwardSlash } from '../../../core/path.js';
import { createPlaceholderURL, stringifyPlaceholderURL } from '../../utils/url.js';
import type { UrlResolver } from '../definitions.js';
export class DevUrlResolver implements UrlResolver {
#resolved = false;
readonly #base: string;
readonly #searchParams: URLSearchParams;
constructor({
base,
searchParams,
}: {
base: string;
searchParams: URLSearchParams;
}) {
this.#base = base;
this.#searchParams = searchParams;
}
resolve(id: string): string {
this.#resolved ||= true;
const urlPath = prependForwardSlash(joinPaths(this.#base, id));
const url = createPlaceholderURL(urlPath);
// Append searchParams if available (for adapter-level tracking like skew protection)
this.#searchParams.forEach((value, key) => {
url.searchParams.set(key, value);
});
return stringifyPlaceholderURL(url);
}
get cspResources(): Array<string> {
return this.#resolved ? ["'self'"] : [];
}
}
Domain
Subdomains
Classes
Dependencies
- ../core/path.js
- ./definitions.js
- ./utils/url.js
Source
Frequently Asked Questions
What does dev-url-resolver.ts do?
dev-url-resolver.ts is a source file in the astro codebase, written in typescript. It belongs to the CoreAstro domain, RenderingEngine subdomain.
What does dev-url-resolver.ts depend on?
dev-url-resolver.ts imports 3 module(s): ../core/path.js, ./definitions.js, ./utils/url.js.
Where is dev-url-resolver.ts in the architecture?
dev-url-resolver.ts is located at packages/astro/src/assets/fonts/infra/dev-url-resolver.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