json-schema-to-zod
Advanced tools
Comparing version 2.0.7 to 2.0.8
@@ -8,3 +8,2 @@ #!/usr/bin/env node | ||
const cliTools_js_1 = require("./utils/cliTools.js"); | ||
const pick_js_1 = require("./utils/pick.js"); | ||
const params = { | ||
@@ -43,3 +42,7 @@ input: { | ||
const jsonSchema = (0, cliTools_js_1.parseOrReadJSON)(input); | ||
const zodSchema = (0, jsonSchemaToZod_js_1.jsonSchemaToZod)(jsonSchema, (0, pick_js_1.pick)(args, "name", "depth", "module")); | ||
const zodSchema = (0, jsonSchemaToZod_js_1.jsonSchemaToZod)(jsonSchema, { | ||
name: args.name, | ||
depth: args.depth, | ||
module: args.module || "esm", | ||
}); | ||
if (args.output) { | ||
@@ -46,0 +49,0 @@ (0, fs_1.mkdirSync)((0, path_1.dirname)(args.output), { recursive: true }); |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -1,1 +0,1 @@ | ||
{"type":"commonjs"} | ||
{"type":"commonjs"} |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -6,3 +6,2 @@ #!/usr/bin/env node | ||
import { parseArgs, parseOrReadJSON, readPipe } from "./utils/cliTools.js"; | ||
import { pick } from "./utils/pick.js"; | ||
const params = { | ||
@@ -41,3 +40,7 @@ input: { | ||
const jsonSchema = parseOrReadJSON(input); | ||
const zodSchema = jsonSchemaToZod(jsonSchema, pick(args, "name", "depth", "module")); | ||
const zodSchema = jsonSchemaToZod(jsonSchema, { | ||
name: args.name, | ||
depth: args.depth, | ||
module: args.module || "esm", | ||
}); | ||
if (args.output) { | ||
@@ -44,0 +47,0 @@ mkdirSync(dirname(args.output), { recursive: true }); |
@@ -0,0 +0,0 @@ import { parseSchema } from "./parsers/parseSchema.js"; |
@@ -1,1 +0,1 @@ | ||
{"type":"module"} | ||
{"type":"module"} |
@@ -0,0 +0,0 @@ import { parseSchema } from "./parseSchema.js"; |
@@ -0,0 +0,0 @@ import { parseAnyOf } from "./parseAnyOf.js"; |
@@ -0,0 +0,0 @@ import { parseSchema } from "./parseSchema.js"; |
{ | ||
"name": "json-schema-to-zod", | ||
"version": "2.0.7", | ||
"version": "2.0.8", | ||
"description": "Converts JSON schema objects or files into Zod schemas", | ||
@@ -15,4 +15,4 @@ "types": "dist/types/index.d.ts", | ||
"build:types": "tsc -p tsconfig.types.json", | ||
"build:cjs": "tsc -p tsconfig.cjs.json && echo {\"type\":\"commonjs\"} > dist/cjs/package.json", | ||
"build:esm": "tsc -p tsconfig.esm.json && echo {\"type\":\"module\"} > dist/esm/package.json", | ||
"build:cjs": "tsc -p tsconfig.cjs.json && node postcjs.js", | ||
"build:esm": "tsc -p tsconfig.esm.json && node postesm.js", | ||
"build": "npm i && npm test && rimraf ./dist && npm run build:types && npm run build:cjs && npm run build:esm", | ||
@@ -19,0 +19,0 @@ "dry": "npm run build && npm pub --dry-run", |
@@ -0,0 +0,0 @@ # Json-Schema-to-Zod |
94878
85
2404
6