MCPcopy Create free account
hub / github.com/EvoMap/evolver / readJsonSafe

Function readJsonSafe

index.js:342–351  ·  view source on GitHub ↗
(p)

Source from the content-addressed store, hash-verified

340}
341
342function readJsonSafe(p) {
343 try {
344 if (!fs.existsSync(p)) return null;
345 const raw = fs.readFileSync(p, 'utf8');
346 if (!raw.trim()) return null;
347 return JSON.parse(raw);
348 } catch (e) {
349 return null;
350 }
351}
352
353/**
354 * Mark a pending evolution run as rejected (state-only, no git rollback).

Callers 4

rejectPendingRunFunction · 0.70
getLastSignalsFunction · 0.70
mainFunction · 0.70
loopMode.test.jsFile · 0.50

Calls 1

parseMethod · 0.80

Tested by

no test coverage detected