()
| 100 | } |
| 101 | |
| 102 | async 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 | |
| 120 | async function validateLayouts(): Promise<void> { |
| 121 | const problems = new Problems<Layout, "_additional">("Layouts", { |
nothing calls this directly
no test coverage detected