Initial commit
This commit is contained in:
21
node_modules/astro/dist/assets/fonts/infra/fs-font-file-content-resolver.js
generated
vendored
Normal file
21
node_modules/astro/dist/assets/fonts/infra/fs-font-file-content-resolver.js
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
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
|
||||
};
|
||||
Reference in New Issue
Block a user