/opt/canhelp/node_modules/next/dist/compiled/@next/font/dist/google
NameSizeModeActions
fetch-css-from-google-fonts.d.ts4820644editdlrm
fetch-css-from-google-fonts.js13470644editdlrm
fetch-font-file.d.ts2260644editdlrm
fetch-font-file.js9570644editdlrm
fetch-resource.d.ts2930644editdlrm
fetch-resource.js19940644editdlrm
find-font-files-in-css.d.ts4130644editdlrm
find-font-files-in-css.js15280644editdlrm
font-data.json4496130644editdlrm
get-fallback-font-override-metrics.d.ts5180644editdlrm
get-fallback-font-override-metrics.js24840644editdlrm
get-font-axes.d.ts3140644editdlrm
get-font-axes.js31050644editdlrm
get-google-fonts-url.d.ts2900644editdlrm
get-google-fonts-url.js22480644editdlrm
get-proxy-agent.d.ts1800644editdlrm
get-proxy-agent.js9140644editdlrm
google-fonts-metadata.d.ts3650644editdlrm
google-fonts-metadata.js3810644editdlrm
index.d.ts8272310644editdlrm
index.js770644editdlrm
loader.d.ts1380644editdlrm
loader.js85470644editdlrm
retry.d.ts1550644editdlrm
retry.js6740644editdlrm
sort-fonts-variant-values.d.ts2310644editdlrm
sort-fonts-variant-values.js11480644editdlrm
validate-google-font-function-call.d.ts5040644editdlrm
validate-google-font-function-call.js50740644editdlrm
Edit: /opt/canhelp/node_modules/next/dist/compiled/@next/font/dist/google/get-google-fonts-url.js (2248B)
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getGoogleFontsUrl = getGoogleFontsUrl; const sort_fonts_variant_values_1 = require("./sort-fonts-variant-values"); /** * Generate the Google Fonts URL given the requested weight(s), style(s) and additional variable axes */ function getGoogleFontsUrl(fontFamily, axes, display) { var _a, _b; // Variants are all combinations of weight and style, each variant will result in a separate font file const variants = []; if (axes.wght) { for (const wght of axes.wght) { if (!axes.ital) { variants.push([['wght', wght], ...((_a = axes.variableAxes) !== null && _a !== void 0 ? _a : [])]); } else { for (const ital of axes.ital) { variants.push([ ['ital', ital], ['wght', wght], ...((_b = axes.variableAxes) !== null && _b !== void 0 ? _b : []), ]); } } } } else if (axes.variableAxes) { // Variable fonts might not have a range of weights, just add optional variable axes in that case variants.push([...axes.variableAxes]); } // Google api requires the axes to be sorted, starting with lowercase words if (axes.variableAxes) { variants.forEach((variant) => { variant.sort(([a], [b]) => { const aIsLowercase = a.charCodeAt(0) > 96; const bIsLowercase = b.charCodeAt(0) > 96; if (aIsLowercase && !bIsLowercase) return -1; if (bIsLowercase && !aIsLowercase) return 1; return a > b ? 1 : -1; }); }); } let url = `https://fonts.googleapis.com/css2?family=${fontFamily.replace(/ /g, '+')}`; if (variants.length > 0) { url = `${url}:${variants[0].map(([key]) => key).join(',')}@${variants .map((variant) => variant.map(([, val]) => val).join(',')) .sort(sort_fonts_variant_values_1.sortFontsVariantValues) .join(';')}`; } url = `${url}&display=${display}`; return url; }