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
1
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 0.6.0 to 0.6.1

2

package.json
{
"name": "json-schema-to-zod",
"version": "0.6.0",
"version": "0.6.1",
"description": "Converts JSON schema objects or files into Zod schemas",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -38,3 +38,3 @@ "use strict";

if (schema.default !== undefined) {
parsed += `.default(${JSON.stringify(schema.default)} )`;
parsed += `.default(${JSON.stringify(schema.default)})`;
}

@@ -98,5 +98,5 @@ return parsed;

array: (x) => x.type === "array",
anyOf: (x) => !!x.anyOf,
allOf: (x) => !!x.allOf,
enum: (x) => !!x.enum,
anyOf: (x) => x.anyOf !== undefined,
allOf: (x) => x.allOf !== undefined,
enum: (x) => x.enum !== undefined,
},

@@ -106,8 +106,8 @@ a: {

multipleType: (x) => Array.isArray(x.type),
not: (x) => !!x.not,
const: (x) => !!x.const,
not: (x) => x.not !== undefined,
const: (x) => x.const !== undefined,
primitive: (x, p) => x.type === p,
conditional: (x) => Boolean(x.if && x.then && x.else),
oneOf: (x) => !!x.oneOf,
oneOf: (x) => x.oneOf !== undefined,
},
};
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