(id: string)
| 207 | private snapshots: Record<string, Snapshot | undefined> = {} |
| 208 | |
| 209 | snapshot(id: string): Snapshot | undefined { |
| 210 | if (!isHash(id)) return |
| 211 | return (this.snapshots[id] ??= this.read(`s-${id}`) as Snapshot | undefined) |
| 212 | } |
| 213 | |
| 214 | // named by its content, so a build writing it again writes the same file |
| 215 | addSnapshot(snapshot: Snapshot): string { |