MCPcopy Create free account
hub / github.com/MisterBooo/LeetCodeAnimation / readProblems

Function readProblems

tools/scripts/review-site-changes.js:35–40  ·  view source on GitHub ↗
(file)

Source from the content-addressed store, hash-verified

33}
34
35function readProblems(file) {
36 const source = fs.readFileSync(file, "utf8");
37 const match = source.match(/window\.WS_PROBLEMS\s*=\s*([\s\S]*?);\s*$/);
38 if (!match) throw new Error(`Cannot find window.WS_PROBLEMS in ${file}`);
39 return JSON.parse(match[1]);
40}
41
42function difficulty(value) {
43 if (value === "简单") return "easy";

Callers 1

compareFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected