Function
makeFontFilePath
(
tag: string,
subset: string,
weight: string,
style: string,
extension: string,
)
Source from the content-addressed store, hash-verified
| 13 | const CSS_TTL = 60 * 60 * 24; // 1 day |
| 14 | |
| 15 | export const makeFontFilePath = ( |
| 16 | tag: string, |
| 17 | subset: string, |
| 18 | weight: string, |
| 19 | style: string, |
| 20 | extension: string, |
| 21 | ) => { |
| 22 | // We need to replace square brackets with empty spaces |
| 23 | return `https://cdn.jsdelivr.net/fontsource/fonts/${tag}/${subset}-${weight}-${style}.${extension}` |
| 24 | .replace('[', '') |
| 25 | .replace(']', ''); |
| 26 | }; |
| 27 | |
| 28 | export const makeFontFileVariablePath = ( |
| 29 | tag: string, |
Callers
nothing calls this directly
Tested by
no test coverage detected