MCPcopy
hub / github.com/MisterBooo/LeetCodeAnimation / readJsonFile

Function readJsonFile

tools/scripts/sync-algomooc-index.js:41–45  ·  view source on GitHub ↗
(file, fallback)

Source from the content-addressed store, hash-verified

39const siteBase = getArg("--site", DEFAULT_SITE).replace(/\/+$/, "");
40
41function readJsonFile(file, fallback) {
42 const target = path.join(ROOT, file);
43 if (!fs.existsSync(target)) return fallback;
44 return JSON.parse(fs.readFileSync(target, "utf8"));
45}
46
47function readProblems(file) {
48 const source = fs.readFileSync(file, "utf8");

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected