MCPcopy Index your code
hub / github.com/monkeytypegame/monkeytype / validateChallenges

Function validateChallenges

frontend/scripts/check-assets.ts:102–118  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

100}
101
102async function validateChallenges(): Promise<void> {
103 const problems = new Problems<"_list.json", never>("Challenges", {});
104
105 const challengesData = JSON.parse(
106 fs.readFileSync("./static/challenges/_list.json", {
107 encoding: "utf8",
108 flag: "r",
109 }),
110 ) as Challenge;
111 const validationResult = z.array(ChallengeSchema).safeParse(challengesData);
112 problems.addValidation("_list.json", validationResult);
113
114 console.log(problems.toString());
115 if (problems.hasError()) {
116 throw new Error("challenges with errors");
117 }
118}
119
120async function validateLayouts(): Promise<void> {
121 const problems = new Problems<Layout, "_additional">("Layouts", {

Callers

nothing calls this directly

Calls 3

addValidationMethod · 0.95
toStringMethod · 0.95
hasErrorMethod · 0.95

Tested by

no test coverage detected