(stateFile: string = resolveStateFilePath())
| 87 | } |
| 88 | |
| 89 | export function readStateFile(stateFile: string = resolveStateFilePath()): DaemonState | null { |
| 90 | try { |
| 91 | return JSON.parse(fs.readFileSync(stateFile, "utf-8")) as DaemonState; |
| 92 | } catch { |
| 93 | return null; |
| 94 | } |
| 95 | } |
| 96 | |
| 97 | export function writeStateFile( |
| 98 | state: DaemonState, |
no test coverage detected