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

zod

Package Overview
Dependencies
Maintainers
2
Versions
363
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.20240222T232722 to 3.23.0-canary.20240314T051126

6

lib/external.js
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -6,0 +10,0 @@ if (k2 === undefined) k2 = k;

4

lib/helpers/errorUtil.d.ts

@@ -5,6 +5,6 @@ export declare namespace errorUtil {

};
const errToObj: (message?: ErrMessage | undefined) => {
const errToObj: (message?: ErrMessage) => {
message?: string | undefined;
};
const toString: (message?: ErrMessage | undefined) => string | undefined;
const toString: (message?: ErrMessage) => string | undefined;
}

@@ -8,2 +8,2 @@ "use strict";

errorUtil.toString = (message) => typeof message === "string" ? message : message === null || message === void 0 ? void 0 : message.message;
})(errorUtil = exports.errorUtil || (exports.errorUtil = {}));
})(errorUtil || (exports.errorUtil = errorUtil = {}));

@@ -9,3 +9,3 @@ import type { IssueData, ZodErrorMap, ZodIssue } from "../ZodError";

}) => ZodIssue;
export declare type ParseParams = {
export type ParseParams = {
path: (string | number)[];

@@ -15,4 +15,4 @@ errorMap: ZodErrorMap;

};
export declare type ParsePathComponent = string | number;
export declare type ParsePath = ParsePathComponent[];
export type ParsePathComponent = string | number;
export type ParsePath = ParsePathComponent[];
export declare const EMPTY_PATH: ParsePath;

@@ -31,3 +31,3 @@ export interface ParseContext {

}
export declare type ParseInput = {
export type ParseInput = {
data: any;

@@ -38,3 +38,3 @@ path: (string | number)[];

export declare function addIssueToContext(ctx: ParseContext, issueData: IssueData): void;
export declare type ObjectPair = {
export type ObjectPair = {
key: SyncParseReturnType<any>;

@@ -62,7 +62,7 @@ value: SyncParseReturnType<any>;

}
export declare type INVALID = {
export type INVALID = {
status: "aborted";
};
export declare const INVALID: INVALID;
export declare type DIRTY<T> = {
export type DIRTY<T> = {
status: "dirty";

@@ -72,3 +72,3 @@ value: T;

export declare const DIRTY: <T>(value: T) => DIRTY<T>;
export declare type OK<T> = {
export type OK<T> = {
status: "valid";

@@ -78,5 +78,5 @@ value: T;

export declare const OK: <T>(value: T) => OK<T>;
export declare type SyncParseReturnType<T = any> = OK<T> | DIRTY<T> | INVALID;
export declare type AsyncParseReturnType<T> = Promise<SyncParseReturnType<T>>;
export declare type ParseReturnType<T> = SyncParseReturnType<T> | AsyncParseReturnType<T>;
export type SyncParseReturnType<T = any> = OK<T> | DIRTY<T> | INVALID;
export type AsyncParseReturnType<T> = Promise<SyncParseReturnType<T>>;
export type ParseReturnType<T> = SyncParseReturnType<T> | AsyncParseReturnType<T>;
export declare const isAborted: (x: ParseReturnType<any>) => x is INVALID;

@@ -83,0 +83,0 @@ export declare const isDirty: <T>(x: ParseReturnType<T>) => x is OK<T> | DIRTY<T>;

@@ -39,5 +39,5 @@ "use strict";

errorMaps: [
ctx.common.contextualErrorMap,
ctx.schemaErrorMap,
(0, errors_1.getErrorMap)(),
ctx.common.contextualErrorMap, // contextual error map is first priority
ctx.schemaErrorMap, // then schema-bound map if available
(0, errors_1.getErrorMap)(), // then global override map
en_1.default, // then global default map

@@ -44,0 +44,0 @@ ].filter((x) => !!x),

@@ -1,2 +0,2 @@

export declare type Primitive = string | number | symbol | bigint | boolean | null | undefined;
export declare type Scalars = Primitive | Primitive[];
export type Primitive = string | number | symbol | bigint | boolean | null | undefined;
export type Scalars = Primitive | Primitive[];

@@ -46,16 +46,17 @@ export declare namespace util {

export declare const ZodParsedType: {
string: "string";
number: "number";
bigint: "bigint";
boolean: "boolean";
symbol: "symbol";
undefined: "undefined";
object: "object";
function: "function";
number: "number";
string: "string";
map: "map";
nan: "nan";
integer: "integer";
float: "float";
boolean: "boolean";
date: "date";
bigint: "bigint";
symbol: "symbol";
undefined: "undefined";
null: "null";
array: "array";
object: "object";
unknown: "unknown";

@@ -65,6 +66,5 @@ promise: "promise";

never: "never";
map: "map";
set: "set";
};
export declare type ZodParsedType = keyof typeof ZodParsedType;
export type ZodParsedType = keyof typeof ZodParsedType;
export declare const getParsedType: (data: any) => ZodParsedType;

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

};
})(util = exports.util || (exports.util = {}));
})(util || (exports.util = util = {}));
var objectUtil;

@@ -76,3 +76,3 @@ (function (objectUtil) {

};
})(objectUtil = exports.objectUtil || (exports.objectUtil = {}));
})(objectUtil || (exports.objectUtil = objectUtil = {}));
exports.ZodParsedType = util.arrayToEnum([

@@ -79,0 +79,0 @@ "string",

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -6,0 +10,0 @@ if (k2 === undefined) k2 = k;

@@ -8,15 +8,15 @@ import { enumUtil } from "./helpers/enumUtil";

import { IssueData, StringValidation, ZodCustomIssue, ZodError, ZodErrorMap } from "./ZodError";
export declare type RefinementCtx = {
export type RefinementCtx = {
addIssue: (arg: IssueData) => void;
path: (string | number)[];
};
export declare type ZodRawShape = {
export type ZodRawShape = {
[k: string]: ZodTypeAny;
};
export declare type ZodTypeAny = ZodType<any, any, any>;
export declare type TypeOf<T extends ZodType<any, any, any>> = T["_output"];
export declare type input<T extends ZodType<any, any, any>> = T["_input"];
export declare type output<T extends ZodType<any, any, any>> = T["_output"];
export type ZodTypeAny = ZodType<any, any, any>;
export type TypeOf<T extends ZodType<any, any, any>> = T["_output"];
export type input<T extends ZodType<any, any, any>> = T["_input"];
export type output<T extends ZodType<any, any, any>> = T["_output"];
export type { TypeOf as infer };
export declare type CustomErrorParams = Partial<util.Omit<ZodCustomIssue, "code">>;
export type CustomErrorParams = Partial<util.Omit<ZodCustomIssue, "code">>;
export interface ZodTypeDef {

@@ -26,3 +26,3 @@ errorMap?: ZodErrorMap;

}
export declare type RawCreateParams = {
export type RawCreateParams = {
errorMap?: ZodErrorMap;

@@ -33,15 +33,15 @@ invalid_type_error?: string;

} | undefined;
export declare type ProcessedCreateParams = {
export type ProcessedCreateParams = {
errorMap?: ZodErrorMap;
description?: string;
};
export declare type SafeParseSuccess<Output> = {
export type SafeParseSuccess<Output> = {
success: true;
data: Output;
};
export declare type SafeParseError<Input> = {
export type SafeParseError<Input> = {
success: false;
error: ZodError<Input>;
};
export declare type SafeParseReturnType<Input, Output> = SafeParseSuccess<Output> | SafeParseError<Input>;
export type SafeParseReturnType<Input, Output> = SafeParseSuccess<Output> | SafeParseError<Input>;
export declare abstract class ZodType<Output = any, Def extends ZodTypeDef = ZodTypeDef, Input = Output> {

@@ -67,3 +67,3 @@ readonly _type: Output;

/** Alias of safeParseAsync */
spa: (data: unknown, params?: Partial<ParseParams> | undefined) => Promise<SafeParseReturnType<Input, Output>>;
spa: (data: unknown, params?: Partial<ParseParams>) => Promise<SafeParseReturnType<Input, Output>>;
refine<RefinedOutput extends Output>(check: (arg: Output) => arg is RefinedOutput, message?: string | CustomErrorParams | ((arg: Output) => CustomErrorParams)): ZodEffects<this, RefinedOutput, Input>;

@@ -100,4 +100,4 @@ refine(check: (arg: Output) => unknown | Promise<unknown>, message?: string | CustomErrorParams | ((arg: Output) => CustomErrorParams)): ZodEffects<this, Output, Input>;

}
export declare type IpVersion = "v4" | "v6";
export declare type ZodStringCheck = {
export type IpVersion = "v4" | "v6";
export type ZodStringCheck = {
kind: "min";

@@ -225,12 +225,7 @@ value: number;

get maxLength(): number | null;
static create: (params?: ({
errorMap?: ZodErrorMap | undefined;
invalid_type_error?: string | undefined;
required_error?: string | undefined;
description?: string | undefined;
} & {
coerce?: true | undefined;
}) | undefined) => ZodString;
static create: (params?: RawCreateParams & {
coerce?: true;
}) => ZodString;
}
export declare type ZodNumberCheck = {
export type ZodNumberCheck = {
kind: "min";

@@ -263,15 +258,10 @@ value: number;

_parse(input: ParseInput): ParseReturnType<number>;
static create: (params?: ({
errorMap?: ZodErrorMap | undefined;
invalid_type_error?: string | undefined;
required_error?: string | undefined;
description?: string | undefined;
} & {
coerce?: boolean | undefined;
}) | undefined) => ZodNumber;
static create: (params?: RawCreateParams & {
coerce?: boolean;
}) => ZodNumber;
gte(value: number, message?: errorUtil.ErrMessage): ZodNumber;
min: (value: number, message?: errorUtil.ErrMessage | undefined) => ZodNumber;
min: (value: number, message?: errorUtil.ErrMessage) => ZodNumber;
gt(value: number, message?: errorUtil.ErrMessage): ZodNumber;
lte(value: number, message?: errorUtil.ErrMessage): ZodNumber;
max: (value: number, message?: errorUtil.ErrMessage | undefined) => ZodNumber;
max: (value: number, message?: errorUtil.ErrMessage) => ZodNumber;
lt(value: number, message?: errorUtil.ErrMessage): ZodNumber;

@@ -286,3 +276,3 @@ protected setLimit(kind: "min" | "max", value: number, inclusive: boolean, message?: string): ZodNumber;

multipleOf(value: number, message?: errorUtil.ErrMessage): ZodNumber;
step: (value: number, message?: errorUtil.ErrMessage | undefined) => ZodNumber;
step: (value: number, message?: errorUtil.ErrMessage) => ZodNumber;
finite(message?: errorUtil.ErrMessage): ZodNumber;

@@ -295,3 +285,3 @@ safe(message?: errorUtil.ErrMessage): ZodNumber;

}
export declare type ZodBigIntCheck = {
export type ZodBigIntCheck = {
kind: "min";

@@ -318,15 +308,10 @@ value: bigint;

_parse(input: ParseInput): ParseReturnType<bigint>;
static create: (params?: ({
errorMap?: ZodErrorMap | undefined;
invalid_type_error?: string | undefined;
required_error?: string | undefined;
description?: string | undefined;
} & {
coerce?: boolean | undefined;
}) | undefined) => ZodBigInt;
static create: (params?: RawCreateParams & {
coerce?: boolean;
}) => ZodBigInt;
gte(value: bigint, message?: errorUtil.ErrMessage): ZodBigInt;
min: (value: bigint, message?: errorUtil.ErrMessage | undefined) => ZodBigInt;
min: (value: bigint, message?: errorUtil.ErrMessage) => ZodBigInt;
gt(value: bigint, message?: errorUtil.ErrMessage): ZodBigInt;
lte(value: bigint, message?: errorUtil.ErrMessage): ZodBigInt;
max: (value: bigint, message?: errorUtil.ErrMessage | undefined) => ZodBigInt;
max: (value: bigint, message?: errorUtil.ErrMessage) => ZodBigInt;
lt(value: bigint, message?: errorUtil.ErrMessage): ZodBigInt;

@@ -349,12 +334,7 @@ protected setLimit(kind: "min" | "max", value: bigint, inclusive: boolean, message?: string): ZodBigInt;

_parse(input: ParseInput): ParseReturnType<boolean>;
static create: (params?: ({
errorMap?: ZodErrorMap | undefined;
invalid_type_error?: string | undefined;
required_error?: string | undefined;
description?: string | undefined;
} & {
coerce?: boolean | undefined;
}) | undefined) => ZodBoolean;
static create: (params?: RawCreateParams & {
coerce?: boolean;
}) => ZodBoolean;
}
export declare type ZodDateCheck = {
export type ZodDateCheck = {
kind: "min";

@@ -380,10 +360,5 @@ value: number;

get maxDate(): Date | null;
static create: (params?: ({
errorMap?: ZodErrorMap | undefined;
invalid_type_error?: string | undefined;
required_error?: string | undefined;
description?: string | undefined;
} & {
coerce?: boolean | undefined;
}) | undefined) => ZodDate;
static create: (params?: RawCreateParams & {
coerce?: boolean;
}) => ZodDate;
}

@@ -458,4 +433,4 @@ export interface ZodSymbolDef extends ZodTypeDef {

}
export declare type ArrayCardinality = "many" | "atleastone";
export declare type arrayOutputType<T extends ZodTypeAny, Cardinality extends ArrayCardinality = "many"> = Cardinality extends "atleastone" ? [T["_output"], ...T["_output"][]] : T["_output"][];
export type ArrayCardinality = "many" | "atleastone";
export type arrayOutputType<T extends ZodTypeAny, Cardinality extends ArrayCardinality = "many"> = Cardinality extends "atleastone" ? [T["_output"], ...T["_output"][]] : T["_output"][];
export declare class ZodArray<T extends ZodTypeAny, Cardinality extends ArrayCardinality = "many"> extends ZodType<arrayOutputType<T, Cardinality>, ZodArrayDef<T>, Cardinality extends "atleastone" ? [T["_input"], ...T["_input"][]] : T["_input"][]> {

@@ -470,4 +445,4 @@ _parse(input: ParseInput): ParseReturnType<this["_output"]>;

}
export declare type ZodNonEmptyArray<T extends ZodTypeAny> = ZodArray<T, "atleastone">;
export declare type UnknownKeysParam = "passthrough" | "strict" | "strip";
export type ZodNonEmptyArray<T extends ZodTypeAny> = ZodArray<T, "atleastone">;
export type UnknownKeysParam = "passthrough" | "strict" | "strip";
export interface ZodObjectDef<T extends ZodRawShape = ZodRawShape, UnknownKeys extends UnknownKeysParam = UnknownKeysParam, Catchall extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {

@@ -479,25 +454,25 @@ typeName: ZodFirstPartyTypeKind.ZodObject;

}
export declare type mergeTypes<A, B> = {
export type mergeTypes<A, B> = {
[k in keyof A | keyof B]: k extends keyof B ? B[k] : k extends keyof A ? A[k] : never;
};
export declare type objectOutputType<Shape extends ZodRawShape, Catchall extends ZodTypeAny, UnknownKeys extends UnknownKeysParam = UnknownKeysParam> = objectUtil.flatten<objectUtil.addQuestionMarks<baseObjectOutputType<Shape>>> & CatchallOutput<Catchall> & PassthroughType<UnknownKeys>;
export declare type baseObjectOutputType<Shape extends ZodRawShape> = {
export type objectOutputType<Shape extends ZodRawShape, Catchall extends ZodTypeAny, UnknownKeys extends UnknownKeysParam = UnknownKeysParam> = objectUtil.flatten<objectUtil.addQuestionMarks<baseObjectOutputType<Shape>>> & CatchallOutput<Catchall> & PassthroughType<UnknownKeys>;
export type baseObjectOutputType<Shape extends ZodRawShape> = {
[k in keyof Shape]: Shape[k]["_output"];
};
export declare type objectInputType<Shape extends ZodRawShape, Catchall extends ZodTypeAny, UnknownKeys extends UnknownKeysParam = UnknownKeysParam> = objectUtil.flatten<baseObjectInputType<Shape>> & CatchallInput<Catchall> & PassthroughType<UnknownKeys>;
export declare type baseObjectInputType<Shape extends ZodRawShape> = objectUtil.addQuestionMarks<{
export type objectInputType<Shape extends ZodRawShape, Catchall extends ZodTypeAny, UnknownKeys extends UnknownKeysParam = UnknownKeysParam> = objectUtil.flatten<baseObjectInputType<Shape>> & CatchallInput<Catchall> & PassthroughType<UnknownKeys>;
export type baseObjectInputType<Shape extends ZodRawShape> = objectUtil.addQuestionMarks<{
[k in keyof Shape]: Shape[k]["_input"];
}>;
export declare type CatchallOutput<T extends ZodTypeAny> = ZodTypeAny extends T ? unknown : {
export type CatchallOutput<T extends ZodTypeAny> = ZodTypeAny extends T ? unknown : {
[k: string]: T["_output"];
};
export declare type CatchallInput<T extends ZodTypeAny> = ZodTypeAny extends T ? unknown : {
export type CatchallInput<T extends ZodTypeAny> = ZodTypeAny extends T ? unknown : {
[k: string]: T["_input"];
};
export declare type PassthroughType<T extends UnknownKeysParam> = T extends "passthrough" ? {
export type PassthroughType<T extends UnknownKeysParam> = T extends "passthrough" ? {
[k: string]: unknown;
} : unknown;
export declare type deoptional<T extends ZodTypeAny> = T extends ZodOptional<infer U> ? deoptional<U> : T extends ZodNullable<infer U> ? ZodNullable<deoptional<U>> : T;
export declare type SomeZodObject = ZodObject<ZodRawShape, UnknownKeysParam, ZodTypeAny>;
export declare type noUnrecognized<Obj extends object, Shape extends object> = {
export type deoptional<T extends ZodTypeAny> = T extends ZodOptional<infer U> ? deoptional<U> : T extends ZodNullable<infer U> ? ZodNullable<deoptional<U>> : T;
export type SomeZodObject = ZodObject<ZodRawShape, UnknownKeysParam, ZodTypeAny>;
export type noUnrecognized<Obj extends object, Shape extends object> = {
[k in keyof Obj]: k extends keyof Shape ? Obj[k] : never;

@@ -525,3 +500,3 @@ };

* */
augment: <Augmentation extends ZodRawShape>(augmentation: Augmentation) => ZodObject<{ [k in keyof (Omit<T, keyof Augmentation> & Augmentation)]: (Omit<T, keyof Augmentation> & Augmentation)[k]; }, UnknownKeys, Catchall, objectOutputType<{ [k in keyof (Omit<T, keyof Augmentation> & Augmentation)]: (Omit<T, keyof Augmentation> & Augmentation)[k]; }, Catchall, UnknownKeys>, objectInputType<{ [k in keyof (Omit<T, keyof Augmentation> & Augmentation)]: (Omit<T, keyof Augmentation> & Augmentation)[k]; }, Catchall, UnknownKeys>>;
augment: <Augmentation extends ZodRawShape>(augmentation: Augmentation) => ZodObject<objectUtil.extendShape<T, Augmentation>, UnknownKeys, Catchall>;
/**

@@ -564,8 +539,8 @@ * Prior to zod@1.0.12 there was a bug in the

keyof(): ZodEnum<enumUtil.UnionToTupleString<keyof T>>;
static create: <T_1 extends ZodRawShape>(shape: T_1, params?: RawCreateParams) => ZodObject<T_1, "strip", ZodTypeAny, { [k_1 in keyof objectUtil.addQuestionMarks<baseObjectOutputType<T_1>, { [k in keyof baseObjectOutputType<T_1>]: undefined extends baseObjectOutputType<T_1>[k] ? never : k; }[keyof T_1]>]: objectUtil.addQuestionMarks<baseObjectOutputType<T_1>, { [k in keyof baseObjectOutputType<T_1>]: undefined extends baseObjectOutputType<T_1>[k] ? never : k; }[keyof T_1]>[k_1]; }, { [k_2 in keyof baseObjectInputType<T_1>]: baseObjectInputType<T_1>[k_2]; }>;
static strictCreate: <T_1 extends ZodRawShape>(shape: T_1, params?: RawCreateParams) => ZodObject<T_1, "strict", ZodTypeAny, { [k_1 in keyof objectUtil.addQuestionMarks<baseObjectOutputType<T_1>, { [k in keyof baseObjectOutputType<T_1>]: undefined extends baseObjectOutputType<T_1>[k] ? never : k; }[keyof T_1]>]: objectUtil.addQuestionMarks<baseObjectOutputType<T_1>, { [k in keyof baseObjectOutputType<T_1>]: undefined extends baseObjectOutputType<T_1>[k] ? never : k; }[keyof T_1]>[k_1]; }, { [k_2 in keyof baseObjectInputType<T_1>]: baseObjectInputType<T_1>[k_2]; }>;
static lazycreate: <T_1 extends ZodRawShape>(shape: () => T_1, params?: RawCreateParams) => ZodObject<T_1, "strip", ZodTypeAny, { [k_1 in keyof objectUtil.addQuestionMarks<baseObjectOutputType<T_1>, { [k in keyof baseObjectOutputType<T_1>]: undefined extends baseObjectOutputType<T_1>[k] ? never : k; }[keyof T_1]>]: objectUtil.addQuestionMarks<baseObjectOutputType<T_1>, { [k in keyof baseObjectOutputType<T_1>]: undefined extends baseObjectOutputType<T_1>[k] ? never : k; }[keyof T_1]>[k_1]; }, { [k_2 in keyof baseObjectInputType<T_1>]: baseObjectInputType<T_1>[k_2]; }>;
static create: <T_1 extends ZodRawShape>(shape: T_1, params?: RawCreateParams) => ZodObject<T_1, "strip", ZodTypeAny, objectUtil.addQuestionMarks<baseObjectOutputType<T_1>, { [k_1 in keyof baseObjectOutputType<T_1>]: undefined extends baseObjectOutputType<T_1>[k_1] ? never : k_1; }[keyof T_1]> extends infer T_2 ? { [k in keyof T_2]: objectUtil.addQuestionMarks<baseObjectOutputType<T_1>, { [k_1 in keyof baseObjectOutputType<T_1>]: undefined extends baseObjectOutputType<T_1>[k_1] ? never : k_1; }[keyof T_1]>[k]; } : never, baseObjectInputType<T_1> extends infer T_3 ? { [k_2 in keyof T_3]: baseObjectInputType<T_1>[k_2]; } : never>;
static strictCreate: <T_1 extends ZodRawShape>(shape: T_1, params?: RawCreateParams) => ZodObject<T_1, "strict", ZodTypeAny, objectUtil.addQuestionMarks<baseObjectOutputType<T_1>, { [k_1 in keyof baseObjectOutputType<T_1>]: undefined extends baseObjectOutputType<T_1>[k_1] ? never : k_1; }[keyof T_1]> extends infer T_2 ? { [k in keyof T_2]: objectUtil.addQuestionMarks<baseObjectOutputType<T_1>, { [k_1 in keyof baseObjectOutputType<T_1>]: undefined extends baseObjectOutputType<T_1>[k_1] ? never : k_1; }[keyof T_1]>[k]; } : never, baseObjectInputType<T_1> extends infer T_3 ? { [k_2 in keyof T_3]: baseObjectInputType<T_1>[k_2]; } : never>;
static lazycreate: <T_1 extends ZodRawShape>(shape: () => T_1, params?: RawCreateParams) => ZodObject<T_1, "strip", ZodTypeAny, objectUtil.addQuestionMarks<baseObjectOutputType<T_1>, { [k_1 in keyof baseObjectOutputType<T_1>]: undefined extends baseObjectOutputType<T_1>[k_1] ? never : k_1; }[keyof T_1]> extends infer T_2 ? { [k in keyof T_2]: objectUtil.addQuestionMarks<baseObjectOutputType<T_1>, { [k_1 in keyof baseObjectOutputType<T_1>]: undefined extends baseObjectOutputType<T_1>[k_1] ? never : k_1; }[keyof T_1]>[k]; } : never, baseObjectInputType<T_1> extends infer T_3 ? { [k_2 in keyof T_3]: baseObjectInputType<T_1>[k_2]; } : never>;
}
export declare type AnyZodObject = ZodObject<any, any, any>;
export declare type ZodUnionOptions = Readonly<[ZodTypeAny, ...ZodTypeAny[]]>;
export type AnyZodObject = ZodObject<any, any, any>;
export type ZodUnionOptions = Readonly<[ZodTypeAny, ...ZodTypeAny[]]>;
export interface ZodUnionDef<T extends ZodUnionOptions = Readonly<[

@@ -584,3 +559,3 @@ ZodTypeAny,

}
export declare type ZodDiscriminatedUnionOption<Discriminator extends string> = ZodObject<{
export type ZodDiscriminatedUnionOption<Discriminator extends string> = ZodObject<{
[key in Discriminator]: ZodTypeAny;

@@ -621,12 +596,12 @@ } & ZodRawShape, UnknownKeysParam, ZodTypeAny>;

}
export declare type ZodTupleItems = [ZodTypeAny, ...ZodTypeAny[]];
export declare type AssertArray<T> = T extends any[] ? T : never;
export declare type OutputTypeOfTuple<T extends ZodTupleItems | []> = AssertArray<{
export type ZodTupleItems = [ZodTypeAny, ...ZodTypeAny[]];
export type AssertArray<T> = T extends any[] ? T : never;
export type OutputTypeOfTuple<T extends ZodTupleItems | []> = AssertArray<{
[k in keyof T]: T[k] extends ZodType<any, any> ? T[k]["_output"] : never;
}>;
export declare type OutputTypeOfTupleWithRest<T extends ZodTupleItems | [], Rest extends ZodTypeAny | null = null> = Rest extends ZodTypeAny ? [...OutputTypeOfTuple<T>, ...Rest["_output"][]] : OutputTypeOfTuple<T>;
export declare type InputTypeOfTuple<T extends ZodTupleItems | []> = AssertArray<{
export type OutputTypeOfTupleWithRest<T extends ZodTupleItems | [], Rest extends ZodTypeAny | null = null> = Rest extends ZodTypeAny ? [...OutputTypeOfTuple<T>, ...Rest["_output"][]] : OutputTypeOfTuple<T>;
export type InputTypeOfTuple<T extends ZodTupleItems | []> = AssertArray<{
[k in keyof T]: T[k] extends ZodType<any, any> ? T[k]["_input"] : never;
}>;
export declare type InputTypeOfTupleWithRest<T extends ZodTupleItems | [], Rest extends ZodTypeAny | null = null> = Rest extends ZodTypeAny ? [...InputTypeOfTuple<T>, ...Rest["_input"][]] : InputTypeOfTuple<T>;
export type InputTypeOfTupleWithRest<T extends ZodTupleItems | [], Rest extends ZodTypeAny | null = null> = Rest extends ZodTypeAny ? [...InputTypeOfTuple<T>, ...Rest["_input"][]] : InputTypeOfTuple<T>;
export interface ZodTupleDef<T extends ZodTupleItems | [] = ZodTupleItems, Rest extends ZodTypeAny | null = null> extends ZodTypeDef {

@@ -637,3 +612,3 @@ items: T;

}
export declare type AnyZodTuple = ZodTuple<[
export type AnyZodTuple = ZodTuple<[
ZodTypeAny,

@@ -653,4 +628,4 @@ ...ZodTypeAny[]

}
export declare type KeySchema = ZodType<string | number | symbol, any, any>;
export declare type RecordType<K extends string | number | symbol, V> = [
export type KeySchema = ZodType<string | number | symbol, any, any>;
export type RecordType<K extends string | number | symbol, V> = [
string

@@ -702,4 +677,4 @@ ] extends [K] ? Record<K, V> : [number] extends [K] ? Record<K, V> : [symbol] extends [K] ? Record<K, V> : [BRAND<string | number | symbol>] extends [K] ? Record<K, V> : Partial<Record<K, V>>;

}
export declare type OuterTypeOfFunction<Args extends ZodTuple<any, any>, Returns extends ZodTypeAny> = Args["_input"] extends Array<any> ? (...args: Args["_input"]) => Returns["_output"] : never;
export declare type InnerTypeOfFunction<Args extends ZodTuple<any, any>, Returns extends ZodTypeAny> = Args["_output"] extends Array<any> ? (...args: Args["_output"]) => Returns["_input"] : never;
export type OuterTypeOfFunction<Args extends ZodTuple<any, any>, Returns extends ZodTypeAny> = Args["_input"] extends Array<any> ? (...args: Args["_input"]) => Returns["_output"] : never;
export type InnerTypeOfFunction<Args extends ZodTuple<any, any>, Returns extends ZodTypeAny> = Args["_output"] extends Array<any> ? (...args: Args["_output"]) => Returns["_input"] : never;
export declare class ZodFunction<Args extends ZodTuple<any, any>, Returns extends ZodTypeAny> extends ZodType<OuterTypeOfFunction<Args, Returns>, ZodFunctionDef<Args, Returns>, InnerTypeOfFunction<Args, Returns>> {

@@ -737,6 +712,6 @@ _parse(input: ParseInput): ParseReturnType<any>;

}
export declare type ArrayKeys = keyof any[];
export declare type Indices<T> = Exclude<keyof T, ArrayKeys>;
export declare type EnumValues = [string, ...string[]];
export declare type Values<T extends EnumValues> = {
export type ArrayKeys = keyof any[];
export type Indices<T> = Exclude<keyof T, ArrayKeys>;
export type EnumValues = [string, ...string[]];
export type Values<T extends EnumValues> = {
[k in T[number]]: k;

@@ -748,7 +723,7 @@ };

}
export declare type Writeable<T> = {
export type Writeable<T> = {
-readonly [P in keyof T]: T[P];
};
export declare type FilterEnum<Values, ToExclude> = Values extends [] ? [] : Values extends [infer Head, ...infer Rest] ? Head extends ToExclude ? FilterEnum<Rest, ToExclude> : [Head, ...FilterEnum<Rest, ToExclude>] : never;
export declare type typecast<A, T> = A extends T ? A : never;
export type FilterEnum<Values, ToExclude> = Values extends [] ? [] : Values extends [infer Head, ...infer Rest] ? Head extends ToExclude ? FilterEnum<Rest, ToExclude> : [Head, ...FilterEnum<Rest, ToExclude>] : never;
export type typecast<A, T> = A extends T ? A : never;
declare function createZodEnum<U extends string, T extends Readonly<[U, ...U[]]>>(values: T, params?: RawCreateParams): ZodEnum<Writeable<T>>;

@@ -770,3 +745,3 @@ declare function createZodEnum<U extends string, T extends [U, ...U[]]>(values: T, params?: RawCreateParams): ZodEnum<T>;

}
export declare type EnumLike = {
export type EnumLike = {
[k: string]: string | number;

@@ -789,17 +764,17 @@ [nu: number]: string;

}
export declare type Refinement<T> = (arg: T, ctx: RefinementCtx) => any;
export declare type SuperRefinement<T> = (arg: T, ctx: RefinementCtx) => void | Promise<void>;
export declare type RefinementEffect<T> = {
export type Refinement<T> = (arg: T, ctx: RefinementCtx) => any;
export type SuperRefinement<T> = (arg: T, ctx: RefinementCtx) => void | Promise<void>;
export type RefinementEffect<T> = {
type: "refinement";
refinement: (arg: T, ctx: RefinementCtx) => any;
};
export declare type TransformEffect<T> = {
export type TransformEffect<T> = {
type: "transform";
transform: (arg: T, ctx: RefinementCtx) => any;
};
export declare type PreprocessEffect<T> = {
export type PreprocessEffect<T> = {
type: "preprocess";
transform: (arg: T, ctx: RefinementCtx) => any;
};
export declare type Effect<T> = RefinementEffect<T> | TransformEffect<T> | PreprocessEffect<T>;
export type Effect<T> = RefinementEffect<T> | TransformEffect<T> | PreprocessEffect<T>;
export interface ZodEffectsDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {

@@ -814,3 +789,3 @@ schema: T;

_parse(input: ParseInput): ParseReturnType<this["_output"]>;
static create: <I extends ZodTypeAny>(schema: I, effect: Effect<I["_output"]>, params?: RawCreateParams) => ZodEffects<I, I["_output"], input<I>>;
static create: <I extends ZodTypeAny>(schema: I, effect: Effect<I["_output"]>, params?: RawCreateParams) => ZodEffects<I, I["_output"]>;
static createWithPreprocess: <I extends ZodTypeAny>(preprocess: (arg: unknown, ctx: RefinementCtx) => unknown, schema: I, params?: RawCreateParams) => ZodEffects<I, I["_output"], unknown>;

@@ -823,3 +798,3 @@ }

}
export declare type ZodOptionalType<T extends ZodTypeAny> = ZodOptional<T>;
export type ZodOptionalType<T extends ZodTypeAny> = ZodOptional<T>;
export declare class ZodOptional<T extends ZodTypeAny> extends ZodType<T["_output"] | undefined, ZodOptionalDef<T>, T["_input"] | undefined> {

@@ -834,3 +809,3 @@ _parse(input: ParseInput): ParseReturnType<this["_output"]>;

}
export declare type ZodNullableType<T extends ZodTypeAny> = ZodNullable<T>;
export type ZodNullableType<T extends ZodTypeAny> = ZodNullable<T>;
export declare class ZodNullable<T extends ZodTypeAny> extends ZodType<T["_output"] | null, ZodNullableDef<T>, T["_input"] | null> {

@@ -890,3 +865,3 @@ _parse(input: ParseInput): ParseReturnType<this["_output"]>;

export declare const BRAND: unique symbol;
export declare type BRAND<T extends string | number | symbol> = {
export type BRAND<T extends string | number | symbol> = {
[BRAND]: {

@@ -909,6 +884,6 @@ [k in T]: true;

}
declare type BuiltIn = (((...args: any[]) => any) | (new (...args: any[]) => any)) | {
type BuiltIn = (((...args: any[]) => any) | (new (...args: any[]) => any)) | {
readonly [Symbol.toStringTag]: string;
} | Date | Error | Generator | Promise<unknown> | RegExp;
declare type MakeReadonly<T> = T extends Map<infer K, infer V> ? ReadonlyMap<K, V> : T extends Set<infer V> ? ReadonlySet<V> : T extends [infer Head, ...infer Tail] ? readonly [Head, ...Tail] : T extends Array<infer V> ? ReadonlyArray<V> : T extends BuiltIn ? T : Readonly<T>;
type MakeReadonly<T> = T extends Map<infer K, infer V> ? ReadonlyMap<K, V> : T extends Set<infer V> ? ReadonlySet<V> : T extends [infer Head, ...infer Tail] ? readonly [Head, ...Tail] : T extends Array<infer V> ? ReadonlyArray<V> : T extends BuiltIn ? T : Readonly<T>;
export interface ZodReadonlyDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {

@@ -922,9 +897,9 @@ innerType: T;

}
declare type CustomParams = CustomErrorParams & {
type CustomParams = CustomErrorParams & {
fatal?: boolean;
};
export declare const custom: <T>(check?: ((data: unknown) => any) | undefined, params?: string | CustomParams | ((input: any) => CustomParams), fatal?: boolean | undefined) => ZodType<T, ZodTypeDef, T>;
export declare const custom: <T>(check?: ((data: unknown) => any) | undefined, params?: string | CustomParams | ((input: any) => CustomParams), fatal?: boolean) => ZodType<T>;
export { ZodType as Schema, ZodType as ZodSchema };
export declare const late: {
object: <T extends ZodRawShape>(shape: () => T, params?: RawCreateParams) => ZodObject<T, "strip", ZodTypeAny, { [k_1 in keyof objectUtil.addQuestionMarks<baseObjectOutputType<T>, { [k in keyof baseObjectOutputType<T>]: undefined extends baseObjectOutputType<T>[k] ? never : k; }[keyof T]>]: objectUtil.addQuestionMarks<baseObjectOutputType<T>, { [k in keyof baseObjectOutputType<T>]: undefined extends baseObjectOutputType<T>[k] ? never : k; }[keyof T]>[k_1]; }, { [k_2 in keyof baseObjectInputType<T>]: baseObjectInputType<T>[k_2]; }>;
object: <T extends ZodRawShape>(shape: () => T, params?: RawCreateParams) => ZodObject<T, "strip">;
};

@@ -969,3 +944,3 @@ export declare enum ZodFirstPartyTypeKind {

}
export declare type ZodFirstPartySchemaTypes = ZodString | ZodNumber | ZodNaN | ZodBigInt | ZodBoolean | ZodDate | ZodUndefined | ZodNull | ZodAny | ZodUnknown | ZodNever | ZodVoid | ZodArray<any, any> | ZodObject<any, any, any> | ZodUnion<any> | ZodDiscriminatedUnion<any, any> | ZodIntersection<any, any> | ZodTuple<any, any> | ZodRecord<any, any> | ZodMap<any> | ZodSet<any> | ZodFunction<any, any> | ZodLazy<any> | ZodLiteral<any> | ZodEnum<any> | ZodEffects<any, any, any> | ZodNativeEnum<any> | ZodOptional<any> | ZodNullable<any> | ZodDefault<any> | ZodCatch<any> | ZodPromise<any> | ZodBranded<any, any> | ZodPipeline<any, any>;
export type ZodFirstPartySchemaTypes = ZodString | ZodNumber | ZodNaN | ZodBigInt | ZodBoolean | ZodDate | ZodUndefined | ZodNull | ZodAny | ZodUnknown | ZodNever | ZodVoid | ZodArray<any, any> | ZodObject<any, any, any> | ZodUnion<any> | ZodDiscriminatedUnion<any, any> | ZodIntersection<any, any> | ZodTuple<any, any> | ZodRecord<any, any> | ZodMap<any> | ZodSet<any> | ZodFunction<any, any> | ZodLazy<any> | ZodLiteral<any> | ZodEnum<any> | ZodEffects<any, any, any> | ZodNativeEnum<any> | ZodOptional<any> | ZodNullable<any> | ZodDefault<any> | ZodCatch<any> | ZodPromise<any> | ZodBranded<any, any> | ZodPipeline<any, any> | ZodReadonly<any> | ZodSymbol;
declare abstract class Class {

@@ -975,43 +950,18 @@ constructor(..._: any[]);

declare const instanceOfType: <T extends typeof Class>(cls: T, params?: CustomParams) => ZodType<InstanceType<T>, ZodTypeDef, InstanceType<T>>;
declare const stringType: (params?: ({
errorMap?: ZodErrorMap | undefined;
invalid_type_error?: string | undefined;
required_error?: string | undefined;
description?: string | undefined;
} & {
coerce?: true | undefined;
}) | undefined) => ZodString;
declare const numberType: (params?: ({
errorMap?: ZodErrorMap | undefined;
invalid_type_error?: string | undefined;
required_error?: string | undefined;
description?: string | undefined;
} & {
coerce?: boolean | undefined;
}) | undefined) => ZodNumber;
declare const stringType: (params?: RawCreateParams & {
coerce?: true;
}) => ZodString;
declare const numberType: (params?: RawCreateParams & {
coerce?: boolean;
}) => ZodNumber;
declare const nanType: (params?: RawCreateParams) => ZodNaN;
declare const bigIntType: (params?: ({
errorMap?: ZodErrorMap | undefined;
invalid_type_error?: string | undefined;
required_error?: string | undefined;
description?: string | undefined;
} & {
coerce?: boolean | undefined;
}) | undefined) => ZodBigInt;
declare const booleanType: (params?: ({
errorMap?: ZodErrorMap | undefined;
invalid_type_error?: string | undefined;
required_error?: string | undefined;
description?: string | undefined;
} & {
coerce?: boolean | undefined;
}) | undefined) => ZodBoolean;
declare const dateType: (params?: ({
errorMap?: ZodErrorMap | undefined;
invalid_type_error?: string | undefined;
required_error?: string | undefined;
description?: string | undefined;
} & {
coerce?: boolean | undefined;
}) | undefined) => ZodDate;
declare const bigIntType: (params?: RawCreateParams & {
coerce?: boolean;
}) => ZodBigInt;
declare const booleanType: (params?: RawCreateParams & {
coerce?: boolean;
}) => ZodBoolean;
declare const dateType: (params?: RawCreateParams & {
coerce?: boolean;
}) => ZodDate;
declare const symbolType: (params?: RawCreateParams) => ZodSymbol;

@@ -1024,5 +974,5 @@ declare const undefinedType: (params?: RawCreateParams) => ZodUndefined;

declare const voidType: (params?: RawCreateParams) => ZodVoid;
declare const arrayType: <T extends ZodTypeAny>(schema: T, params?: RawCreateParams) => ZodArray<T, "many">;
declare const objectType: <T extends ZodRawShape>(shape: T, params?: RawCreateParams) => ZodObject<T, "strip", ZodTypeAny, { [k_1 in keyof objectUtil.addQuestionMarks<baseObjectOutputType<T>, { [k in keyof baseObjectOutputType<T>]: undefined extends baseObjectOutputType<T>[k] ? never : k; }[keyof T]>]: objectUtil.addQuestionMarks<baseObjectOutputType<T>, { [k in keyof baseObjectOutputType<T>]: undefined extends baseObjectOutputType<T>[k] ? never : k; }[keyof T]>[k_1]; }, { [k_2 in keyof baseObjectInputType<T>]: baseObjectInputType<T>[k_2]; }>;
declare const strictObjectType: <T extends ZodRawShape>(shape: T, params?: RawCreateParams) => ZodObject<T, "strict", ZodTypeAny, { [k_1 in keyof objectUtil.addQuestionMarks<baseObjectOutputType<T>, { [k in keyof baseObjectOutputType<T>]: undefined extends baseObjectOutputType<T>[k] ? never : k; }[keyof T]>]: objectUtil.addQuestionMarks<baseObjectOutputType<T>, { [k in keyof baseObjectOutputType<T>]: undefined extends baseObjectOutputType<T>[k] ? never : k; }[keyof T]>[k_1]; }, { [k_2 in keyof baseObjectInputType<T>]: baseObjectInputType<T>[k_2]; }>;
declare const arrayType: <T extends ZodTypeAny>(schema: T, params?: RawCreateParams) => ZodArray<T>;
declare const objectType: <T extends ZodRawShape>(shape: T, params?: RawCreateParams) => ZodObject<T, "strip">;
declare const strictObjectType: <T extends ZodRawShape>(shape: T, params?: RawCreateParams) => ZodObject<T, "strict">;
declare const unionType: <T extends readonly [ZodTypeAny, ZodTypeAny, ...ZodTypeAny[]]>(types: T, params?: RawCreateParams) => ZodUnion<T>;

@@ -1041,3 +991,3 @@ declare const discriminatedUnionType: typeof ZodDiscriminatedUnion.create;

declare const promiseType: <T extends ZodTypeAny>(schema: T, params?: RawCreateParams) => ZodPromise<T>;
declare const effectsType: <I extends ZodTypeAny>(schema: I, effect: Effect<I["_output"]>, params?: RawCreateParams) => ZodEffects<I, I["_output"], input<I>>;
declare const effectsType: <I extends ZodTypeAny>(schema: I, effect: Effect<I["_output"]>, params?: RawCreateParams) => ZodEffects<I, I["_output"]>;
declare const optionalType: <T extends ZodTypeAny>(type: T, params?: RawCreateParams) => ZodOptional<T>;

@@ -1051,44 +1001,19 @@ declare const nullableType: <T extends ZodTypeAny>(type: T, params?: RawCreateParams) => ZodNullable<T>;

export declare const coerce: {
string: (params?: ({
errorMap?: ZodErrorMap | undefined;
invalid_type_error?: string | undefined;
required_error?: string | undefined;
description?: string | undefined;
} & {
coerce?: true | undefined;
}) | undefined) => ZodString;
number: (params?: ({
errorMap?: ZodErrorMap | undefined;
invalid_type_error?: string | undefined;
required_error?: string | undefined;
description?: string | undefined;
} & {
coerce?: boolean | undefined;
}) | undefined) => ZodNumber;
boolean: (params?: ({
errorMap?: ZodErrorMap | undefined;
invalid_type_error?: string | undefined;
required_error?: string | undefined;
description?: string | undefined;
} & {
coerce?: boolean | undefined;
}) | undefined) => ZodBoolean;
bigint: (params?: ({
errorMap?: ZodErrorMap | undefined;
invalid_type_error?: string | undefined;
required_error?: string | undefined;
description?: string | undefined;
} & {
coerce?: boolean | undefined;
}) | undefined) => ZodBigInt;
date: (params?: ({
errorMap?: ZodErrorMap | undefined;
invalid_type_error?: string | undefined;
required_error?: string | undefined;
description?: string | undefined;
} & {
coerce?: boolean | undefined;
}) | undefined) => ZodDate;
string: (params?: RawCreateParams & {
coerce?: true;
}) => ZodString;
number: (params?: RawCreateParams & {
coerce?: boolean;
}) => ZodNumber;
boolean: (params?: RawCreateParams & {
coerce?: boolean;
}) => ZodBoolean;
bigint: (params?: RawCreateParams & {
coerce?: boolean;
}) => ZodBigInt;
date: (params?: RawCreateParams & {
coerce?: boolean;
}) => ZodDate;
};
export { anyType as any, arrayType as array, bigIntType as bigint, booleanType as boolean, dateType as date, discriminatedUnionType as discriminatedUnion, effectsType as effect, enumType as enum, functionType as function, instanceOfType as instanceof, intersectionType as intersection, lazyType as lazy, literalType as literal, mapType as map, nanType as nan, nativeEnumType as nativeEnum, neverType as never, nullType as null, nullableType as nullable, numberType as number, objectType as object, oboolean, onumber, optionalType as optional, ostring, pipelineType as pipeline, preprocessType as preprocess, promiseType as promise, recordType as record, setType as set, strictObjectType as strictObject, stringType as string, symbolType as symbol, effectsType as transformer, tupleType as tuple, undefinedType as undefined, unionType as union, unknownType as unknown, voidType as void, };
export declare const NEVER: never;
import type { TypeOf, ZodType } from ".";
import { Primitive } from "./helpers/typeAliases";
import { util, ZodParsedType } from "./helpers/util";
declare type allKeys<T> = T extends any ? keyof T : never;
export declare type inferFlattenedErrors<T extends ZodType<any, any, any>, U = string> = typeToFlattenedError<TypeOf<T>, U>;
export declare type typeToFlattenedError<T, U = string> = {
type allKeys<T> = T extends any ? keyof T : never;
export type inferFlattenedErrors<T extends ZodType<any, any, any>, U = string> = typeToFlattenedError<TypeOf<T>, U>;
export type typeToFlattenedError<T, U = string> = {
formErrors: U[];

@@ -30,4 +30,4 @@ fieldErrors: {

};
export declare type ZodIssueCode = keyof typeof ZodIssueCode;
export declare type ZodIssueBase = {
export type ZodIssueCode = keyof typeof ZodIssueCode;
export type ZodIssueBase = {
path: (string | number)[];

@@ -74,3 +74,3 @@ message?: string;

}
export declare type StringValidation = "email" | "url" | "emoji" | "uuid" | "regex" | "cuid" | "cuid2" | "ulid" | "datetime" | "ip" | {
export type StringValidation = "email" | "url" | "emoji" | "uuid" | "regex" | "cuid" | "cuid2" | "ulid" | "datetime" | "ip" | {
includes: string;

@@ -117,7 +117,7 @@ position?: number;

}
export declare type DenormalizedError = {
export type DenormalizedError = {
[k: string]: DenormalizedError | string[];
};
export declare type ZodIssueOptionalMessage = ZodInvalidTypeIssue | ZodInvalidLiteralIssue | ZodUnrecognizedKeysIssue | ZodInvalidUnionIssue | ZodInvalidUnionDiscriminatorIssue | ZodInvalidEnumValueIssue | ZodInvalidArgumentsIssue | ZodInvalidReturnTypeIssue | ZodInvalidDateIssue | ZodInvalidStringIssue | ZodTooSmallIssue | ZodTooBigIssue | ZodInvalidIntersectionTypesIssue | ZodNotMultipleOfIssue | ZodNotFiniteIssue | ZodCustomIssue;
export declare type ZodIssue = ZodIssueOptionalMessage & {
export type ZodIssueOptionalMessage = ZodInvalidTypeIssue | ZodInvalidLiteralIssue | ZodUnrecognizedKeysIssue | ZodInvalidUnionIssue | ZodInvalidUnionDiscriminatorIssue | ZodInvalidEnumValueIssue | ZodInvalidArgumentsIssue | ZodInvalidReturnTypeIssue | ZodInvalidDateIssue | ZodInvalidStringIssue | ZodTooSmallIssue | ZodTooBigIssue | ZodInvalidIntersectionTypesIssue | ZodNotMultipleOfIssue | ZodNotFiniteIssue | ZodCustomIssue;
export type ZodIssue = ZodIssueOptionalMessage & {
fatal?: boolean;

@@ -127,3 +127,3 @@ message: string;

export declare const quotelessJson: (obj: any) => string;
declare type recursiveZodFormattedError<T> = T extends [any, ...any[]] ? {
type recursiveZodFormattedError<T> = T extends [any, ...any[]] ? {
[K in keyof T]?: ZodFormattedError<T[K]>;

@@ -135,6 +135,6 @@ } : T extends any[] ? {

} : unknown;
export declare type ZodFormattedError<T, U = string> = {
export type ZodFormattedError<T, U = string> = {
_errors: U[];
} & recursiveZodFormattedError<NonNullable<T>>;
export declare type inferFormattedError<T extends ZodType<any, any, any>, U = string> = ZodFormattedError<TypeOf<T>, U>;
export type inferFormattedError<T extends ZodType<any, any, any>, U = string> = ZodFormattedError<TypeOf<T>, U>;
export declare class ZodError<T = any> extends Error {

@@ -156,14 +156,14 @@ issues: ZodIssue[];

}
declare type stripPath<T extends object> = T extends any ? util.OmitKeys<T, "path"> : never;
export declare type IssueData = stripPath<ZodIssueOptionalMessage> & {
type stripPath<T extends object> = T extends any ? util.OmitKeys<T, "path"> : never;
export type IssueData = stripPath<ZodIssueOptionalMessage> & {
path?: (string | number)[];
fatal?: boolean;
};
export declare type ErrorMapCtx = {
export type ErrorMapCtx = {
defaultError: string;
data: any;
};
export declare type ZodErrorMap = (issue: ZodIssueOptionalMessage, _ctx: ErrorMapCtx) => {
export type ZodErrorMap = (issue: ZodIssueOptionalMessage, _ctx: ErrorMapCtx) => {
message: string;
};
export {};

@@ -29,2 +29,5 @@ "use strict";

class ZodError extends Error {
get errors() {
return this.issues;
}
constructor(issues) {

@@ -50,5 +53,2 @@ super();

}
get errors() {
return this.issues;
}
format(_mapper) {

@@ -55,0 +55,0 @@ const mapper = _mapper ||

{
"name": "zod",
"version": "3.23.0-canary.20240222T232722",
"version": "3.23.0-canary.20240314T051126",
"author": "Colin McDonnell <colin@colinhacks.com>",

@@ -44,3 +44,3 @@ "repository": {

"tsx": "^3.8.0",
"typescript": "~4.5.0",
"typescript": "~5.4.2",
"vitest": "^0.32.2"

@@ -118,4 +118,3 @@ },

},
"types": "./index.d.ts",
"dependencies": {}
"types": "./index.d.ts"
}

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

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