MCPcopy
hub / github.com/openclaw/clawsweeper / sanitizeResultFile

Function sanitizeResultFile

src/repair/run-worker.ts:470–481  ·  view source on GitHub ↗
(filePath: string)

Source from the content-addressed store, hash-verified

468}
469
470function 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}

Callers 2

run-worker.tsFile · 0.85
repairResultIfNeededFunction · 0.85

Calls 1

sanitizeResultEvidenceFunction · 0.85

Tested by

no test coverage detected