/
opt
/
canhelp
/
node_modules
/
next
/
dist
/
compiled
/
@next
/
font
/
dist
/
google
/
/opt/canhelp/node_modules/next/dist/compiled/@next/font/dist/google
mkdir
upload
Name
Size
Mode
Actions
fetch-css-from-google-fonts.d.ts
482
0644
edit
dl
rm
fetch-css-from-google-fonts.js
1347
0644
edit
dl
rm
fetch-font-file.d.ts
226
0644
edit
dl
rm
fetch-font-file.js
957
0644
edit
dl
rm
fetch-resource.d.ts
293
0644
edit
dl
rm
fetch-resource.js
1994
0644
edit
dl
rm
find-font-files-in-css.d.ts
413
0644
edit
dl
rm
find-font-files-in-css.js
1528
0644
edit
dl
rm
font-data.json
449613
0644
edit
dl
rm
get-fallback-font-override-metrics.d.ts
518
0644
edit
dl
rm
get-fallback-font-override-metrics.js
2484
0644
edit
dl
rm
get-font-axes.d.ts
314
0644
edit
dl
rm
get-font-axes.js
3105
0644
edit
dl
rm
get-google-fonts-url.d.ts
290
0644
edit
dl
rm
get-google-fonts-url.js
2248
0644
edit
dl
rm
get-proxy-agent.d.ts
180
0644
edit
dl
rm
get-proxy-agent.js
914
0644
edit
dl
rm
google-fonts-metadata.d.ts
365
0644
edit
dl
rm
google-fonts-metadata.js
381
0644
edit
dl
rm
index.d.ts
827231
0644
edit
dl
rm
index.js
77
0644
edit
dl
rm
loader.d.ts
138
0644
edit
dl
rm
loader.js
8547
0644
edit
dl
rm
retry.d.ts
155
0644
edit
dl
rm
retry.js
674
0644
edit
dl
rm
sort-fonts-variant-values.d.ts
231
0644
edit
dl
rm
sort-fonts-variant-values.js
1148
0644
edit
dl
rm
validate-google-font-function-call.d.ts
504
0644
edit
dl
rm
validate-google-font-function-call.js
5074
0644
edit
dl
rm
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; }
Save
cmd:
run