Skip to content

Commit 39939bb

Browse files
committed
Removing zod from the headers tool.
1 parent 29a0f55 commit 39939bb

1 file changed

Lines changed: 5 additions & 17 deletions

File tree

tools/headers.ts

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { execSync } from "node:child_process";
22
import { writeFile } from "node:fs/promises";
3-
import { z } from "zod/v4";
43

54
/**
65
* @link https://chatgpt.com/c/6795dae3-8a10-800e-96af-fd0d01579f39
@@ -236,29 +235,18 @@ if (mtime && state <= mtime) process.exit(0);
236235

237236
const csv = await response.text();
238237

239-
const categories = [
240-
"permanent",
241-
"deprecated",
242-
"provisional",
243-
"obsoleted",
244-
] as const;
245-
246-
const schema = z.object({
247-
name: z.string().regex(/^[\w-]+$/),
248-
category: z.enum(categories),
249-
});
238+
const categories = ["permanent", "deprecated", "provisional", "obsoleted"];
250239

251240
const lines = csv.split("\n").slice(1, -1);
252241
const headers = lines
253242
.map((line) => {
254243
const [name, category] = line.split(",").slice(0, 2);
255244
return { name, category };
256245
})
257-
.filter((entry) => {
258-
const { success } = schema.safeParse(entry);
259-
if (!success) console.debug("excluding", entry);
260-
return success;
261-
})
246+
.filter(
247+
({ name, category }) =>
248+
/^[\w-]+$/.test(name) && categories.includes(category),
249+
)
262250
.map(({ name }) => name.toLowerCase())
263251
.filter((name) => !(name in responseOnlyHeaders));
264252

0 commit comments

Comments
 (0)