()
| 12 | } |
| 13 | |
| 14 | function readCache(): ModelCache | null { |
| 15 | try { |
| 16 | if (!existsSync(MODEL_CACHE_PATH)) { |
| 17 | return null; |
| 18 | } |
| 19 | const data = readFileSync(MODEL_CACHE_PATH, 'utf8'); |
| 20 | return JSON.parse(data); |
| 21 | } catch { |
| 22 | return null; |
| 23 | } |
| 24 | } |
| 25 | |
| 26 | function writeCache(models: Record<string, string[]>): void { |
| 27 | try { |
no test coverage detected