MCPcopy Create free account
hub / github.com/AmazingAng/PolyWorld / set

Method set

src/lib/apiCache.ts:20–28  ·  view source on GitHub ↗
(key: string, data: T)

Source from the content-addressed store, hash-verified

18 }
19
20 set(key: string, data: T): void {
21 this.cache.set(key, { data, fetchedAt: Date.now() });
22 if (this.cache.size > this.maxEntries) {
23 const now = Date.now();
24 for (const [k, v] of this.cache) {
25 if (now - v.fetchedAt > this.ttl) this.cache.delete(k);
26 }
27 }
28 }
29}
30
31/** Single-value in-memory cache with TTL. */

Callers 15

checkRateLimitFunction · 0.45
applySecurityHeadersFunction · 0.45
middlewareFunction · 0.45
buildCalendarFunction · 0.45
snapToGroupCentroidsFunction · 0.45
offsetColocatedFunction · 0.45
WorldMapInnerFunction · 0.45
TopCountriesFunction · 0.45
useSignalDataFunction · 0.45
MarketDetailPanelInnerFunction · 0.45
CopyLinkButtonFunction · 0.45
SparklineContentFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected