PronounsPage/locale/generateSchemas.ts
Valentyne Stigloher b25afefc49 (fmt)
2024-10-29 10:56:32 +01:00

16 lines
480 B
TypeScript

import fs from 'fs';
import { createGenerator } from 'ts-json-schema-generator';
const __dirname = new URL('.', import.meta.url).pathname;
const schema = createGenerator({
path: `${__dirname}/config.ts`,
strictTuples: true,
markdownDescription: true,
// speed up schema generation; type checking happens separately
skipTypeCheck: true,
}).createSchema('Config');
fs.writeFileSync(`${__dirname}/config.schema.json`, `${JSON.stringify(schema, null, 4)}\n`);