MCPcopy Create free account
hub / github.com/chokcoco/iCSS / get

Method get

website/app/lib/cache.ts:28–41  ·  view source on GitHub ↗
(key: string)

Source from the content-addressed store, hash-verified

26 }
27
28 get<T>(key: string): T | null {
29 const item = this.cache.get(key);
30 if (!item) {
31 return null;
32 }
33
34 const now = Date.now();
35 if (now - item.timestamp > item.ttl) {
36 this.cache.delete(key);
37 return null;
38 }
39
40 return item.data as T;
41 }
42
43 delete(key: string): void {
44 this.cache.delete(key);

Callers 15

testSpecificArticleMethod · 0.80
testCategoriesMethod · 0.80
getCssArticleMethod · 0.80
getCssDemoMethod · 0.80
listCssCategoriesMethod · 0.80
getRandomCssTipMethod · 0.80
checkTableMethod · 0.80
generateReportMethod · 0.80
fetchFileContentMethod · 0.80
generateStatsMethod · 0.80
analyzeLabelRelationsMethod · 0.80

Calls 1

deleteMethod · 0.80

Tested by

no test coverage detected