()
| 35 | } |
| 36 | |
| 37 | function readCache(): UpdateCache | null { |
| 38 | try { |
| 39 | if (fs.existsSync(CACHE_FILE)) { |
| 40 | return JSON.parse(fs.readFileSync(CACHE_FILE, 'utf-8')) |
| 41 | } |
| 42 | } catch { |
| 43 | // corrupted cache |
| 44 | } |
| 45 | return null |
| 46 | } |
| 47 | |
| 48 | function writeCache(cache: UpdateCache): void { |
| 49 | try { |
no test coverage detected