( env: Env, ctx: ExecutionContext, )
| 3 | import { updateList, updateMetadata } from './update'; |
| 4 | |
| 5 | const 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 | |
| 21 | const getList = async ( |
| 22 | key: FontlistQueries, |
no test coverage detected