Files
homewebsite/node_modules/astro/dist/assets/fonts/runtime.js
2025-10-17 20:17:33 +00:00

20 lines
555 B
JavaScript

import { AstroError, AstroErrorData } from "../../core/errors/index.js";
function createGetFontData({ consumableMap }) {
return function getFontData(cssVariable) {
if (!consumableMap) {
throw new AstroError(AstroErrorData.ExperimentalFontsNotEnabled);
}
const data = consumableMap.get(cssVariable);
if (!data) {
throw new AstroError({
...AstroErrorData.FontFamilyNotFound,
message: AstroErrorData.FontFamilyNotFound.message(cssVariable)
});
}
return data;
};
}
export {
createGetFontData
};