Skip to content

Commit 2a20000

Browse files
committed
Adjusting the headers tool to produce formatted typescript.
1 parent 46e8841 commit 2a20000

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

tools/headers.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { execSync } from "node:child_process";
22
import { writeFile } from "node:fs/promises";
3+
import { format } from "prettier";
34

45
/**
56
* @link https://chatgpt.com/c/6795dae3-8a10-800e-96af-fd0d01579f39
@@ -208,7 +209,7 @@ const responseOnlyHeaders = {
208209
},
209210
};
210211

211-
const dest = "express-zod-api/src/well-known-headers.json";
212+
const dest = "express-zod-api/src/well-known-headers.ts";
212213

213214
let mtime: Date | undefined;
214215
try {
@@ -252,4 +253,6 @@ const headers = lines
252253

253254
console.debug("CRC:", headers.length);
254255

255-
await writeFile(dest, JSON.stringify(headers, undefined, 2), "utf-8");
256+
const json = JSON.stringify(headers, undefined, 2);
257+
const tsCode = await format(`export default ${json};`, { filepath: dest });
258+
await writeFile(dest, tsCode, "utf-8");

0 commit comments

Comments
 (0)