Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

json-schema-to-zod

Package Overview
Dependencies
Maintainers
0
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-schema-to-zod - npm Package Compare versions

Comparing version 2.3.1 to 2.4.0

6

dist/cjs/parsers/parseSchema.js

@@ -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",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc