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

Function fetchBinaryBytes

api/shared/upstream.ts:67–77  ·  view source on GitHub ↗
(url: string)

Source from the content-addressed store, hash-verified

65
66/** Fetches an upstream binary with asset-specific cache policy. */
67const fetchBinaryBytes = async (url: string): Promise<Uint8Array> =>
68 (
69 await fetchWithCache(url, {
70 cacheEverything: true,
71 cacheTtlByStatus: {
72 '200-299': 86400,
73 404: 60,
74 '500-599': 0,
75 },
76 })
77 ).bytes();
78
79const packageScope = (isVariable: boolean): string =>
80 isVariable ? '@fontsource-variable' : '@fontsource';

Callers 1

fetchPackageAssetBytesFunction · 0.85

Calls 2

fetchWithCacheFunction · 0.85
bytesMethod · 0.65

Tested by

no test coverage detected