New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More

zod

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

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

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

{
"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