MCPcopy Index your code
hub / github.com/fontsource/fontsource / getVariableVariantList

Function getVariableVariantList

packages/cli/src/google/download.ts:100–121  ·  view source on GitHub ↗
(
	variants: FontVariantsVariable,
)

Source from the content-addressed store, hash-verified

98};
99
100const getVariableVariantList = (
101 variants: FontVariantsVariable,
102): VariableVariant[] => {
103 const variantList: VariableVariant[] = [];
104 for (const [axes, styles] of Object.entries(variants)) {
105 for (const [style, subsets] of Object.entries(styles)) {
106 for (const [subset, url] of Object.entries(subsets)) {
107 if (isAbsoluteURL(url)) {
108 variantList.push({
109 kind: 'variable',
110 axes,
111 style,
112 subset: subset.replace('[', '').replace(']', ''),
113 url,
114 extension: 'woff2',
115 });
116 }
117 }
118 }
119 }
120 return variantList;
121};
122
123interface DownloadLinks {
124 url: string;

Callers 2

download.test.tsFile · 0.90
variableLinksFunction · 0.85

Calls 2

isAbsoluteURLFunction · 0.85
replaceMethod · 0.65

Tested by

no test coverage detected