(key: string)
| 99 | } |
| 100 | |
| 101 | function getCache<T>(key: string): Record<string, { data: T; timestamp: number }> { |
| 102 | try { const c = localStorage.getItem(key); return c ? JSON.parse(c) : {}; } catch { return {}; } |
| 103 | } |
| 104 | function setCache<T>(key: string, id: string, data: T) { |
| 105 | const cache = getCache<T>(key); |
| 106 | (cache as any)[id] = { data, timestamp: Date.now() }; |
no outgoing calls
no test coverage detected