Function
getList
(
key: FontlistQueries,
env: Env,
ctx: ExecutionContext,
)
Source from the content-addressed store, hash-verified
| 19 | }; |
| 20 | |
| 21 | const getList = async ( |
| 22 | key: FontlistQueries, |
| 23 | env: Env, |
| 24 | ctx: ExecutionContext, |
| 25 | ): Promise<Fontlist> => { |
| 26 | const value = await env.METADATA.get<Fontlist>(METADATA_KEYS.fontlist(key), { |
| 27 | type: 'json', |
| 28 | cacheTtl: KV_TTL, |
| 29 | }); |
| 30 | |
| 31 | if (!value) { |
| 32 | return await updateList(key, env, ctx); |
| 33 | } |
| 34 | |
| 35 | return value; |
| 36 | }; |
| 37 | |
| 38 | export { getList, getMetadata }; |
Tested by
no test coverage detected