chore: better var name

This commit is contained in:
bholmesdev 2023-04-26 15:23:58 -04:00
parent ec2dbd8a30
commit 87e9e072cf

View file

@ -151,7 +151,11 @@ export function relativeToSrcDir(config: AstroConfig, idOrUrl: URL | string) {
return id.slice(slash(fileURLToPath(config.srcDir)).length);
}
export function rootRelativePath(root: URL, idOrUrl: URL | string, prependSlash = true) {
export function rootRelativePath(
root: URL,
idOrUrl: URL | string,
shouldPrependForwardSlash = true
) {
let id: string;
if (typeof idOrUrl !== 'string') {
id = unwrapId(viteID(idOrUrl));
@ -162,7 +166,7 @@ export function rootRelativePath(root: URL, idOrUrl: URL | string, prependSlash
if (id.startsWith(normalizedRoot)) {
id = id.slice(normalizedRoot.length);
}
return prependSlash ? prependForwardSlash(id) : id;
return shouldPrependForwardSlash ? prependForwardSlash(id) : id;
}
export function emoji(char: string, fallback: string) {