Files
skills-here-run-place/node_modules/astro/dist/assets/fonts/infra/fs-font-file-content-resolver.js
Alejandro Martinez f09af719cf Initial commit
2026-02-12 02:04:10 +01:00

22 lines
519 B
JavaScript

import { isAbsolute } from "node:path";
import { AstroError, AstroErrorData } from "../../../core/errors/index.js";
class FsFontFileContentResolver {
#readFileSync;
constructor({ readFileSync }) {
this.#readFileSync = readFileSync;
}
resolve(url) {
if (!isAbsolute(url)) {
return url;
}
try {
return url + this.#readFileSync(url);
} catch (cause) {
throw new AstroError(AstroErrorData.UnknownFilesystemError, { cause });
}
}
}
export {
FsFontFileContentResolver
};