MCPcopy Create free account
hub / github.com/fontsource/fontsource / extractStyleValue

Function extractStyleValue

packages/core/src/utils/style.ts:5–15  ·  view source on GitHub ↗
(value: StyleValue | number)

Source from the content-addressed store, hash-verified

3
4/** Read a numeric style value from static or variable Glypht output. */
5export const extractStyleValue = (value: StyleValue | number): number => {
6 if (typeof value === 'number') {
7 return value;
8 }
9
10 if (value.type === 'single') {
11 return value.value;
12 }
13
14 return value.value.defaultValue;
15};
16
17export const formatAxisValue = (axis: VariableFontAxis): string =>
18 String(axis.min) === String(axis.max)

Callers 2

extractFontStyleFunction · 0.90
utils.test.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected