MCPcopy Create free account
hub / github.com/dwgx/WindsurfAPI / cacheGet

Function cacheGet

src/cache.js:135–149  ·  view source on GitHub ↗
(key)

Source from the content-addressed store, hash-verified

133}
134
135export function cacheGet(key) {
136 if (!isCacheEnabled()) return null;
137 const entry = _store.get(key);
138 if (!entry) { _stats.misses++; return null; }
139 if (entry.expiresAt < Date.now()) {
140 deleteEntry(key);
141 _stats.misses++;
142 return null;
143 }
144 // Refresh LRU position
145 _store.delete(key);
146 _store.set(key, entry);
147 _stats.hits++;
148 return entry.value;
149}
150
151export function cacheSet(key, value) {
152 if (!isCacheEnabled()) return;

Callers 3

cache.test.jsFile · 0.90
handlerFunction · 0.90

Calls 2

isCacheEnabledFunction · 0.85
deleteEntryFunction · 0.85

Tested by

no test coverage detected