(outputDir: string, cache: FileHashCache)
| 108 | } |
| 109 | |
| 110 | export async function saveFileHashCache(outputDir: string, cache: FileHashCache): Promise<void> { |
| 111 | try { |
| 112 | await writeFile(join(outputDir, "cache.json"), JSON.stringify(cache, null, 2)); |
| 113 | } catch { |
| 114 | // Non-fatal — cache is a perf optimization only |
| 115 | } |
| 116 | } |
| 117 | |
| 118 | export function hashFileContent(content: string): string { |
| 119 | return createHash("sha1").update(content).digest("hex").slice(0, 12); |