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

Function getVersion

api/metadata/src/stats/get.ts:7–26  ·  view source on GitHub ↗
(
	id: string,
	isVariable: boolean,
	env: Env,
	ctx: ExecutionContext,
)

Source from the content-addressed store, hash-verified

5import { updatePackageStatAll, updateVersion } from './update';
6
7export const getVersion = async (
8 id: string,
9 isVariable: boolean,
10 env: Env,
11 ctx: ExecutionContext,
12) => {
13 const value = await env.VERSIONS.get<VersionResponse>(
14 METADATA_KEYS.version(id),
15 {
16 type: 'json',
17 cacheTtl: KV_TTL,
18 },
19 );
20
21 if (!value) {
22 return await updateVersion(id, isVariable, env, ctx);
23 }
24
25 return value;
26};
27
28export const getPackageStatAll = async (env: Env, ctx: ExecutionContext) => {
29 const value = await env.METADATA.get<StatsResponseAllRecord>(

Callers 1

router.tsFile · 0.90

Calls 1

updateVersionFunction · 0.90

Tested by

no test coverage detected