MCPcopy Create free account
hub / github.com/RtlZeroMemory/Rezi / readJson

Function readJson

scripts/run-bench-ci.mjs:61–80  ·  view source on GitHub ↗
(path, label)

Source from the content-addressed store, hash-verified

59}
60
61function readJson(path, label) {
62 let raw = "";
63 try {
64 raw = readFileSync(path, "utf8");
65 } catch (error) {
66 fail(
67 `${label}: failed to read ${path}: ${error instanceof Error ? error.message : String(error)}`,
68 );
69 }
70
71 let parsed;
72 try {
73 parsed = JSON.parse(raw);
74 } catch (error) {
75 fail(
76 `${label}: failed to parse ${path}: ${error instanceof Error ? error.message : String(error)}`,
77 );
78 }
79 return parsed;
80}
81
82function isPlainObject(value) {
83 return value !== null && typeof value === "object" && !Array.isArray(value);

Callers 2

loadCiProfileFunction · 0.70
loadBenchRunFunction · 0.70

Calls 2

parseMethod · 0.80
failFunction · 0.70

Tested by

no test coverage detected