(sessionId: string, key: string, cacheDir: string)
| 47 | } |
| 48 | |
| 49 | export function getCache<T>(sessionId: string, key: string, cacheDir: string): T | null { |
| 50 | const cachePath = getCachePath(sessionId, cacheDir) |
| 51 | const file = readCacheFile(cachePath) |
| 52 | if (!file || !file[key]) return null |
| 53 | return file[key].data as T |
| 54 | } |
| 55 | |
| 56 | export function setCache<T>(sessionId: string, key: string, data: T, cacheDir: string): void { |
| 57 | const cachePath = getCachePath(sessionId, cacheDir) |
no test coverage detected