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

Function getMetadata

api/metadata/src/fontlist/get.ts:5–19  ·  view source on GitHub ↗
(
	env: Env,
	ctx: ExecutionContext,
)

Source from the content-addressed store, hash-verified

3import { updateList, updateMetadata } from './update';
4
5const getMetadata = async (
6 env: Env,
7 ctx: ExecutionContext,
8): Promise<MetadataList> => {
9 const value = await env.METADATA.get<MetadataList>(METADATA_KEYS.fonts, {
10 type: 'json',
11 cacheTtl: KV_TTL,
12 });
13
14 if (!value) {
15 return await updateMetadata(env, ctx);
16 }
17
18 return value;
19};
20
21const getList = async (
22 key: FontlistQueries,

Callers 2

updateArrayMetadataFunction · 0.90
getIdFunction · 0.90

Calls 1

updateMetadataFunction · 0.90

Tested by

no test coverage detected