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

Function readProblems

tools/scripts/sync-algomooc-index.js:47–52  ·  view source on GitHub ↗
(file)

Source from the content-addressed store, hash-verified

45}
46
47function readProblems(file) {
48 const source = fs.readFileSync(file, "utf8");
49 const match = source.match(/window\.WS_PROBLEMS\s*=\s*([\s\S]*?);\s*$/);
50 if (!match) throw new Error(`Cannot find window.WS_PROBLEMS in ${file}`);
51 return JSON.parse(match[1]);
52}
53
54function difficulty(value) {
55 if (value === "简单") return "easy";

Callers 1

buildManifestFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected