astro
Version:
Astro is a modern site builder with web best practices, performance, and DX front-of-mind.
31 lines (30 loc) • 894 B
JavaScript
import { joinPaths, prependForwardSlash } from "../../../core/path.js";
import { createPlaceholderURL, stringifyPlaceholderURL } from "../../utils/url.js";
export class DevUrlResolver {
constructor({ base, searchParams }) {
this.
this.
}
resolve(id) {
this.
const urlPath = prependForwardSlash(joinPaths(this.
const url = createPlaceholderURL(urlPath);
// Append searchParams if available (for adapter-level tracking like skew protection)
this.
url.searchParams.set(key, value);
});
const result = stringifyPlaceholderURL(url);
this.
return result;
}
get cspResources() {
return this.
}
get urls() {
return Array.from(this.
}
}