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

zod

Package Overview
Dependencies
Maintainers
2
Versions
364
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zod - npm Package Compare versions

Comparing version 3.23.0-canary.20240416T201354 to 3.23.0-canary.20240416T204849

5

lib/benchmarks/index.js

@@ -47,1 +47,6 @@ "use strict";

}
// exit on Ctrl-C
process.on("SIGINT", function () {
console.log("Exiting...");
process.exit();
});

@@ -25,2 +25,35 @@ "use strict";

});
const longEnumSuite = new benchmark_1.default.Suite("long z.enum");
const longEnumSchema = index_1.z.enum([
"one",
"two",
"three",
"four",
"five",
"six",
"seven",
"eight",
"nine",
"ten",
"eleven",
"twelve",
"thirteen",
"fourteen",
"fifteen",
"sixteen",
"seventeen",
]);
longEnumSuite
.add("valid", () => {
longEnumSchema.parse("five");
})
.add("invalid", () => {
try {
longEnumSchema.parse("invalid");
}
catch (e) { }
})
.on("cycle", (e) => {
console.log(`long z.enum: ${e.target}`);
});
const undefinedSuite = new benchmark_1.default.Suite("z.undefined");

@@ -131,2 +164,3 @@ const undefinedSchema = index_1.z.undefined();

enumSuite,
longEnumSuite,
undefinedSuite,

@@ -133,0 +167,0 @@ literalSuite,

2

lib/types.d.ts

@@ -762,2 +762,3 @@ import { enumUtil } from "./helpers/enumUtil";

export declare class ZodEnum<T extends [string, ...string[]]> extends ZodType<T[number], ZodEnumDef<T>> {
#private;
_parse(input: ParseInput): ParseReturnType<this["_output"]>;

@@ -781,2 +782,3 @@ get options(): T;

export declare class ZodNativeEnum<T extends EnumLike> extends ZodType<T[keyof T], ZodNativeEnumDef<T>> {
#private;
_parse(input: ParseInput): ParseReturnType<T[keyof T]>;

@@ -783,0 +785,0 @@ get enum(): T;

2

package.json
{
"name": "zod",
"version": "3.23.0-canary.20240416T201354",
"version": "3.23.0-canary.20240416T204849",
"author": "Colin McDonnell <colin@colinhacks.com>",

@@ -5,0 +5,0 @@ "repository": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

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