/
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-font-axes.js
(3105B)
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getFontAxes = getFontAxes; const format_available_values_1 = require("../format-available-values"); const next_font_error_1 = require("../next-font-error"); const google_fonts_metadata_1 = require("./google-fonts-metadata"); /** * Validates and gets the data for each font axis required to generate the Google Fonts URL. */ function getFontAxes(fontFamily, weights, styles, selectedVariableAxes) { const hasItalic = styles.includes('italic'); const hasNormal = styles.includes('normal'); // Make sure the order is correct, otherwise Google Fonts will return an error // If only normal is set, we can skip returning the ital axis as normal is the default const ital = hasItalic ? [...(hasNormal ? ['0'] : []), '1'] : undefined; // Weights will always contain one element if it's a variable font if (weights[0] === 'variable') { // Get all the available axes for the current font from the metadata file const allAxes = google_fonts_metadata_1.googleFontsMetadata[fontFamily].axes; if (!allAxes) { throw new Error('invariant variable font without axes'); } if (selectedVariableAxes) { // The axes other than weight and style that can be defined for the current variable font const defineAbleAxes = allAxes .map(({ tag }) => tag) .filter((tag) => tag !== 'wght'); if (defineAbleAxes.length === 0) { (0, next_font_error_1.nextFontError)(`Font \`${fontFamily}\` has no definable \`axes\``); } if (!Array.isArray(selectedVariableAxes)) { (0, next_font_error_1.nextFontError)(`Invalid axes value for font \`${fontFamily}\`, expected an array of axes.\nAvailable axes: ${(0, format_available_values_1.formatAvailableValues)(defineAbleAxes)}`); } selectedVariableAxes.forEach((key) => { if (!defineAbleAxes.some((tag) => tag === key)) { (0, next_font_error_1.nextFontError)(`Invalid axes value \`${key}\` for font \`${fontFamily}\`.\nAvailable axes: ${(0, format_available_values_1.formatAvailableValues)(defineAbleAxes)}`); } }); } let weightAxis; let variableAxes; for (const { tag, min, max } of allAxes) { if (tag === 'wght') { // In variable fonts the weight is a range weightAxis = `${min}..${max}`; } else if (selectedVariableAxes === null || selectedVariableAxes === void 0 ? void 0 : selectedVariableAxes.includes(tag)) { if (!variableAxes) { variableAxes = []; } variableAxes.push([tag, `${min}..${max}`]); } } return { wght: weightAxis ? [weightAxis] : undefined, ital, variableAxes, }; } else { return { ital, wght: weights, }; } }
Save
cmd:
run