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

Function fetchCachedJson

api/shared/upstream.ts:85–94  ·  view source on GitHub ↗
(
	url: string,
	cacheTtl: number,
)

Source from the content-addressed store, hash-verified

83 `${packageScope(isVariable)}/${id}`;
84
85export const fetchCachedJson = async <T>(
86 url: string,
87 cacheTtl: number,
88): Promise<T> =>
89 (await (
90 await fetchWithCache(url, {
91 cacheEverything: true,
92 cacheTtl,
93 })
94 ).json()) as T;
95
96export const fetchPackageVersions = async (
97 id: string,

Callers

nothing calls this directly

Calls 2

fetchWithCacheFunction · 0.85
jsonMethod · 0.65

Tested by

no test coverage detected