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 2.0.7 to 2.0.8

postcjs.js

7

dist/cjs/cli.js

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

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