(target: string)
| 468 | } |
| 469 | |
| 470 | async function readConfigFile(target: string): Promise<PersistedConfig | null> { |
| 471 | try { |
| 472 | const raw = await fs.readFile(target, 'utf8') |
| 473 | const trimmed = raw.trim() |
| 474 | if (!trimmed) return null |
| 475 | return normalizePersistedConfig(JSON.parse(trimmed)) |
| 476 | } catch (err) { |
| 477 | if (isMissingFileError(err)) return null |
| 478 | throw err |
| 479 | } |
| 480 | } |
| 481 | |
| 482 | /** Internal: reads the persisted config and reports whether the bytes on |
| 483 | * disk were actually readable. Distinguishes three states: |
no test coverage detected