MCPcopy Create free account
hub / github.com/Bistutu/FluentRead / set

Function set

entrypoints/utils/cache.ts:16–24  ·  view source on GitHub ↗
(set: Set<any>, key: any, expire: number)

Source from the content-addressed store, hash-verified

14export const cache = {
15 // 存入缓存并设置过期时间
16 set(set: Set<any>, key: any, expire: number) {
17 // 如果禁用缓存,则不执行任何操作
18 if (!config.useCache) return;
19
20 set.add(key);
21 if (expire >= 0) {
22 setTimeout(() => set.delete(key), expire);
23 }
24 },
25
26 // local 系列为特化的缓存方法,用于操作翻译缓存
27 localSet(key: string, value: string) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected