(runDir: string)
| 23 | const fileFor = (runDir: string) => join(runDir, "timeline.json"); |
| 24 | |
| 25 | const read = (runDir: string): Timeline => { |
| 26 | const file = fileFor(runDir); |
| 27 | if (!existsSync(file)) return { anchors: {}, focus: [] }; |
| 28 | return JSON.parse(readFileSync(file, "utf8")) as Timeline; |
| 29 | }; |
| 30 | |
| 31 | const write = (runDir: string, timeline: Timeline) => |
| 32 | writeFileSync(fileFor(runDir), JSON.stringify(timeline, null, 1)); |
no test coverage detected