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

zod-to-json-schema

Package Overview
Dependencies
Maintainers
1
Versions
81
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

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

Comparing version 3.22.2 to 3.22.3

21

dist/cjs/parseDef.js

@@ -56,19 +56,6 @@ "use strict";

case "root":
return {
$ref: item.path.length === 0
? ""
: item.path.length === 1
? `${item.path[0]}/`
: item.path.join("/"),
};
return { $ref: item.path.join("/") };
case "relative":
return { $ref: getRelativePath(refs.currentPath, item.path) };
case "none": {
if (item.path.length < refs.currentPath.length &&
item.path.every((value, index) => refs.currentPath[index] === value)) {
console.warn(`Recursive reference detected at ${refs.currentPath.join("/")}! Defaulting to any`);
return {};
}
return undefined;
}
case "none":
case "seen": {

@@ -80,5 +67,3 @@ if (item.path.length < refs.currentPath.length &&

}
else {
return item.jsonSchema;
}
return refs.$refStrategy === "seen" ? {} : undefined;
}

@@ -85,0 +70,0 @@ }

@@ -52,19 +52,6 @@ import { ZodFirstPartyTypeKind } from "zod";

case "root":
return {
$ref: item.path.length === 0
? ""
: item.path.length === 1
? `${item.path[0]}/`
: item.path.join("/"),
};
return { $ref: item.path.join("/") };
case "relative":
return { $ref: getRelativePath(refs.currentPath, item.path) };
case "none": {
if (item.path.length < refs.currentPath.length &&
item.path.every((value, index) => refs.currentPath[index] === value)) {
console.warn(`Recursive reference detected at ${refs.currentPath.join("/")}! Defaulting to any`);
return {};
}
return undefined;
}
case "none":
case "seen": {

@@ -76,5 +63,3 @@ if (item.path.length < refs.currentPath.length &&

}
else {
return item.jsonSchema;
}
return refs.$refStrategy === "seen" ? {} : undefined;
}

@@ -81,0 +66,0 @@ }

4

package.json
{
"name": "zod-to-json-schema",
"version": "3.22.2",
"version": "3.22.3",
"description": "Converts Zod schemas to Json Schemas",

@@ -65,3 +65,3 @@ "types": "./dist/types/index.d.ts",

"fast-diff": "^1.3.0",
"json-schema-deref-sync": "^0.14.0",
"local-ref-resolver": "^0.2.0",
"rimraf": "^3.0.2",

@@ -68,0 +68,0 @@ "tsx": "^4.1.2",

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