MCPcopy Create free account
hub / github.com/Thanas-R/Virdis / getLocalCache

Function getLocalCache

src/lib/query-cache.ts:6–13  ·  view source on GitHub ↗
(key: string)

Source from the content-addressed store, hash-verified

4}
5
6export function getLocalCache<T>(key: string): Record<string, CachedEntry<T>> {
7 try {
8 const raw = localStorage.getItem(key);
9 return raw ? JSON.parse(raw) : {};
10 } catch {
11 return {};
12 }
13}
14
15export function setLocalCache<T>(key: string, id: string, data: T) {
16 const cache = getLocalCache<T>(key);

Callers 2

setLocalCacheFunction · 0.85
getFreshLocalCacheValueFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected