(outputDir: string)
| 99 | } |
| 100 | |
| 101 | export async function loadFileHashCache(outputDir: string): Promise<FileHashCache> { |
| 102 | try { |
| 103 | const raw = await readFile(join(outputDir, "cache.json"), "utf-8"); |
| 104 | return JSON.parse(raw) as FileHashCache; |
| 105 | } catch { |
| 106 | return { version: 1, hashes: {} }; |
| 107 | } |
| 108 | } |
| 109 | |
| 110 | export async function saveFileHashCache(outputDir: string, cache: FileHashCache): Promise<void> { |
| 111 | try { |