(key: string)
| 4 | } |
| 5 | |
| 6 | export 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 | |
| 15 | export function setLocalCache<T>(key: string, id: string, data: T) { |
| 16 | const cache = getLocalCache<T>(key); |
no outgoing calls
no test coverage detected