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

Function readJsonSafe

src/webui/observer/jsonl.js:5–14  ·  view source on GitHub ↗
(filePath, fallback)

Source from the content-addressed store, hash-verified

3const fs = require('fs');
4
5function readJsonSafe(filePath, fallback) {
6 try {
7 if (!filePath || !fs.existsSync(filePath)) return fallback;
8 const raw = fs.readFileSync(filePath, 'utf8');
9 if (!raw.trim()) return fallback;
10 return JSON.parse(raw);
11 } catch {
12 return fallback;
13 }
14}
15
16function readJsonl(filePath, opts = {}) {
17 try {

Callers 7

readGenesFunction · 0.70
readCapsulesFunction · 0.70
readFailedCapsulesFunction · 0.70
getPersonalityFunction · 0.70
getStatusFunction · 0.70
buildRunDetailFunction · 0.70
buildRunsFunction · 0.70

Calls 1

parseMethod · 0.80

Tested by

no test coverage detected