json-schema-to-zod
Advanced tools
Comparing version 2.3.1 to 2.4.0
@@ -45,3 +45,5 @@ "use strict"; | ||
if (!blockMeta) { | ||
parsed = addMeta(schema, parsed); | ||
if (!refs.withoutDescribes) { | ||
parsed = addDescribes(schema, parsed); | ||
} | ||
if (!refs.withoutDefaults) { | ||
@@ -56,3 +58,3 @@ parsed = addDefaults(schema, parsed); | ||
exports.parseSchema = parseSchema; | ||
const addMeta = (schema, parsed) => { | ||
const addDescribes = (schema, parsed) => { | ||
if (schema.description) { | ||
@@ -59,0 +61,0 @@ parsed += `.describe(${JSON.stringify(schema.description)})`; |
@@ -42,3 +42,5 @@ import { parseAnyOf } from "./parseAnyOf.js"; | ||
if (!blockMeta) { | ||
parsed = addMeta(schema, parsed); | ||
if (!refs.withoutDescribes) { | ||
parsed = addDescribes(schema, parsed); | ||
} | ||
if (!refs.withoutDefaults) { | ||
@@ -52,3 +54,3 @@ parsed = addDefaults(schema, parsed); | ||
}; | ||
const addMeta = (schema, parsed) => { | ||
const addDescribes = (schema, parsed) => { | ||
if (schema.description) { | ||
@@ -55,0 +57,0 @@ parsed += `.describe(${JSON.stringify(schema.description)})`; |
@@ -53,2 +53,3 @@ export type Serializable = { | ||
withoutDefaults?: boolean; | ||
withoutDescribes?: boolean; | ||
parserOverride?: ParserOverride; | ||
@@ -55,0 +56,0 @@ depth?: number; |
{ | ||
"name": "json-schema-to-zod", | ||
"version": "2.3.1", | ||
"version": "2.4.0", | ||
"description": "Converts JSON schema objects or files into Zod schemas", | ||
@@ -46,3 +46,4 @@ "types": "./dist/types/index.d.ts", | ||
"David Barratt (https://github.com/davidbarratt)", | ||
"pevisscher (https://github.com/pevisscher)" | ||
"pevisscher (https://github.com/pevisscher)", | ||
"Aidin Abedi (https://github.com/aidinabedi)" | ||
], | ||
@@ -49,0 +50,0 @@ "license": "ISC", |
104018
2620