MCPcopy Create free account
hub / github.com/echoVic/blade-code / has

Method has

src/context/storage/CacheStore.ts:74–88  ·  view source on GitHub ↗

* 检查缓存项是否存在

(key: string)

Source from the content-addressed store, hash-verified

72 * 检查缓存项是否存在
73 */
74 has(key: string): boolean {
75 const item = this.cache.get(key);
76
77 if (!item) {
78 return false;
79 }
80
81 // 检查是否过期
82 if (Date.now() - item.timestamp > item.ttl) {
83 this.cache.delete(key);
84 return false;
85 }
86
87 return true;
88 }
89
90 /**
91 * 删除缓存项

Callers 9

registerToolMethod · 0.80
unregisterToolMethod · 0.80
hasToolMethod · 0.80
validateRoleMethod · 0.80
importRolesMethod · 0.80
validateTemplateMethod · 0.80
setMethod · 0.80
registerComponentMethod · 0.80
hasComponentMethod · 0.80

Calls 2

getMethod · 0.80
deleteMethod · 0.80

Tested by

no test coverage detected