(filePath: string)
| 468 | } |
| 469 | |
| 470 | function sanitizeResultFile(filePath: string) { |
| 471 | if (!fs.existsSync(filePath)) return; |
| 472 | let parsed: unknown; |
| 473 | try { |
| 474 | parsed = JSON.parse(fs.readFileSync(filePath, "utf8")); |
| 475 | } catch { |
| 476 | return; |
| 477 | } |
| 478 | if (!parsed || typeof parsed !== "object") return; |
| 479 | sanitizeResultEvidence(parsed as LooseRecord); |
| 480 | fs.writeFileSync(filePath, `${JSON.stringify(parsed, null, 2)}\n`); |
| 481 | } |
no test coverage detected