zod 4.0.0-beta.20250411T195319 → 4.0.0-beta.20250412T083508

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15,23 +15,13 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
35
25
  Object.defineProperty(exports, "__esModule", { value: true });
36
26
  exports.string = string;
37
27
  exports.number = number;
@@ -16,23 +16,13 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
16
16
  }) : function(o, v) {
17
17
  o["default"] = v;
18
18
  });
19
- var __importStar = (this && this.__importStar) || (function () {
20
- var ownKeys = function(o) {
21
- ownKeys = Object.getOwnPropertyNames || function (o) {
22
- var ar = [];
23
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
- return ar;
25
- };
26
- return ownKeys(o);
27
- };
28
- return function (mod) {
29
- if (mod && mod.__esModule) return mod;
30
- var result = {};
31
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
- __setModuleDefault(result, mod);
33
- return result;
34
- };
35
- })();
19
+ var __importStar = (this && this.__importStar) || function (mod) {
20
+ if (mod && mod.__esModule) return mod;
21
+ var result = {};
22
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
23
+ __setModuleDefault(result, mod);
24
+ return result;
25
+ };
36
26
  Object.defineProperty(exports, "__esModule", { value: true });
37
27
  exports.config = exports.$brand = exports.NEVER = exports.ZodIssueCode = void 0;
38
28
  exports.setErrorMap = setErrorMap;
@@ -15,23 +15,13 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
35
25
  Object.defineProperty(exports, "__esModule", { value: true });
36
26
  exports.ZodError = void 0;
37
27
  const core = __importStar(require("@zod/core"));
@@ -15,23 +15,13 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
35
25
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
36
26
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
37
27
  };
@@ -15,23 +15,13 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
35
25
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
36
26
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
37
27
  };
@@ -15,23 +15,13 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
35
25
  Object.defineProperty(exports, "__esModule", { value: true });
36
26
  exports.ZodISODuration = exports.ZodISOTime = exports.ZodISODate = exports.ZodISODateTime = void 0;
37
27
  exports.datetime = datetime;
@@ -15,23 +15,13 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
35
25
  Object.defineProperty(exports, "__esModule", { value: true });
36
26
  exports.safeParseAsync = exports.parseAsync = exports.safeParse = exports.parse = void 0;
37
27
  const core = __importStar(require("@zod/core"));
@@ -3,7 +3,6 @@ import { util } from "@zod/core";
3
3
  import * as parse from "./parse.js";
4
4
  export * as iso from "./iso.js";
5
5
  export * as coerce from "./coerce.js";
6
- type SomeType = core.$ZodType;
7
6
  export interface RefinementCtx<T = unknown> extends core.ParsePayload<T> {
8
7
  addIssue(arg: string | core.$ZodRawIssue | Partial<core.$ZodIssueCustom>): void;
9
8
  }
@@ -377,7 +376,7 @@ export interface ZodDate extends _ZodDate<Date> {
377
376
  }
378
377
  export declare const ZodDate: core.$constructor<ZodDate>;
379
378
  export declare function date(params?: string | core.$ZodDateParams): ZodDate;
380
- export interface ZodArray<T extends SomeType = SomeType> extends ZodType {
379
+ export interface ZodArray<T extends core.$ZodType = core.$ZodType> extends ZodType {
381
380
  _zod: core.$ZodArrayInternals<T>;
382
381
  element: T;
383
382
  min(minLength: number, params?: string | core.$ZodCheckMinLengthParams): this;
@@ -386,7 +385,7 @@ export interface ZodArray<T extends SomeType = SomeType> extends ZodType {
386
385
  length(len: number, params?: string | core.$ZodCheckLengthEqualsParams): this;
387
386
  }
388
387
  export declare const ZodArray: core.$constructor<ZodArray>;
389
- export declare function array<T extends SomeType>(element: T, params?: core.$ZodArrayParams): ZodArray<T>;
388
+ export declare function array<T extends core.$ZodType>(element: T, params?: core.$ZodArrayParams): ZodArray<T>;
390
389
  export interface ZodObjectLike<out O = object, out I = object> extends ZodType {
391
390
  _zod: core.$ZodObjectLikeInternals<O, I>;
392
391
  }
@@ -407,7 +406,7 @@ type ZodInterfaceRequired<T extends ZodInterface, Keys extends keyof T["_zod"]["
407
406
  defaulted: T["_zod"]["defaulted"];
408
407
  extra: T["_zod"]["extra"];
409
408
  }>;
410
- type MergeInterfaces<A extends ZodInterface, B extends ZodInterface> = ZodInterface<util.ExtendShape<A["_zod"]["def"]["shape"], B["_zod"]["def"]["shape"]>, util.MergeInterfaceParams<A, B>>;
409
+ export type MergeInterfaces<A extends ZodInterface, B extends ZodInterface> = ZodInterface<util.ExtendShape<A["_zod"]["def"]["shape"], B["_zod"]["def"]["shape"]>, util.MergeInterfaceParams<A, B>>;
411
410
  export interface ZodInterface<out Shape extends core.$ZodLooseShape = core.$ZodLooseShape, out Params extends core.$ZodInterfaceNamedParams = core.$ZodInterfaceNamedParams> extends ZodType {
412
411
  _zod: core.$ZodInterfaceInternals<Shape, Params>;
413
412
  keyof(): ZodEnum<util.ToEnum<util.InterfaceKeys<string & keyof Shape>>>;
@@ -433,7 +432,7 @@ export interface ZodInterface<out Shape extends core.$ZodLooseShape = core.$ZodL
433
432
  }>;
434
433
  extend<U extends ZodInterface>(int: U): MergeInterfaces<this, U>;
435
434
  extend<U extends core.$ZodLooseShape>(shape: U): MergeInterfaces<this, ZodInterface<U, util.InitInterfaceParams<U, {}>>>;
436
- /** @deprecated Use `.extend()` */
435
+ /** @deprecated Use `A.extend(B)` */
437
436
  merge<U extends ZodInterface>(incoming: U): MergeInterfaces<this, U>;
438
437
  pick<const M extends util.Exactly<util.Mask<string & keyof Shape>, M>>(mask: M): ZodInterface<util.Flatten<Pick<Shape, keyof Shape & keyof M>>, {
439
438
  optional: Extract<Params["optional"], keyof M>;
@@ -488,7 +487,7 @@ export interface ZodObject<out Shape extends core.$ZodShape = core.$ZodShape, Ex
488
487
  }, Extra>;
489
488
  }
490
489
  export declare const ZodObject: core.$constructor<ZodObject>;
491
- export declare function object<T extends core.$ZodShape = Record<never, SomeType>>(shape?: T, params?: core.$ZodObjectLikeParams): ZodObject<T, {}>;
490
+ export declare function object<T extends core.$ZodShape = Record<never, core.$ZodType>>(shape?: T, params?: core.$ZodObjectLikeParams): ZodObject<T, {}>;
492
491
  export declare function strictObject<T extends core.$ZodShape>(shape: T, params?: core.$ZodObjectParams): ZodObject<T, {}>;
493
492
  export declare function looseObject<T extends core.$ZodShape>(shape: T, params?: core.$ZodObjectParams): ZodObject<T, {
494
493
  [k: string]: unknown;
@@ -557,13 +556,13 @@ export declare function required<T extends {
557
556
  defaulted: T["_zod"]["defaulted"];
558
557
  extra: T["_zod"]["extra"];
559
558
  }>;
560
- export interface ZodUnion<T extends readonly SomeType[] = readonly SomeType[]> extends ZodType {
559
+ export interface ZodUnion<T extends readonly core.$ZodType[] = readonly core.$ZodType[]> extends ZodType {
561
560
  _zod: core.$ZodUnionInternals<T>;
562
561
  options: T;
563
562
  }
564
563
  export declare const ZodUnion: core.$constructor<ZodUnion>;
565
- export declare function union<const T extends readonly SomeType[]>(options: T, params?: core.$ZodUnionParams): ZodUnion<T>;
566
- export interface ZodDiscriminatedUnion<Options extends readonly SomeType[] = readonly SomeType[]> extends ZodUnion<Options> {
564
+ export declare function union<const T extends readonly core.$ZodType[]>(options: T, params?: core.$ZodUnionParams): ZodUnion<T>;
565
+ export interface ZodDiscriminatedUnion<Options extends readonly core.$ZodType[] = readonly core.$ZodType[]> extends ZodUnion<Options> {
567
566
  _zod: core.$ZodDiscriminatedUnionInternals<Options>;
568
567
  }
569
568
  export declare const ZodDiscriminatedUnion: core.$constructor<ZodDiscriminatedUnion>;
@@ -575,34 +574,34 @@ export interface $ZodTypeDiscriminable extends ZodType {
575
574
  }
576
575
  export declare function discriminatedUnion<Types extends [$ZodTypeDiscriminable, ...$ZodTypeDiscriminable[]]>(disc: string, options: Types, params?: core.$ZodDiscriminatedUnionParams): ZodDiscriminatedUnion<Types>;
577
576
  export declare function discriminatedUnion<Types extends [$ZodTypeDiscriminable, ...$ZodTypeDiscriminable[]]>(options: Types, params?: core.$ZodDiscriminatedUnionParams): ZodDiscriminatedUnion<Types>;
578
- export interface ZodIntersection<A extends SomeType = SomeType, B extends SomeType = SomeType> extends ZodType {
577
+ export interface ZodIntersection<A extends core.$ZodType = core.$ZodType, B extends core.$ZodType = core.$ZodType> extends ZodType {
579
578
  _zod: core.$ZodIntersectionInternals<A, B>;
580
579
  }
581
580
  export declare const ZodIntersection: core.$constructor<ZodIntersection>;
582
- export declare function intersection<T extends SomeType, U extends SomeType>(left: T, right: U, params?: core.$ZodIntersectionParams): ZodIntersection<T, U>;
583
- export interface ZodTuple<T extends util.TupleItems = util.TupleItems, Rest extends SomeType | null = SomeType | null> extends ZodType {
581
+ export declare function intersection<T extends core.$ZodType, U extends core.$ZodType>(left: T, right: U, params?: core.$ZodIntersectionParams): ZodIntersection<T, U>;
582
+ export interface ZodTuple<T extends util.TupleItems = util.TupleItems, Rest extends core.$ZodType | null = core.$ZodType | null> extends ZodType {
584
583
  _zod: core.$ZodTupleInternals<T, Rest>;
585
584
  rest<Rest extends core.$ZodType>(rest: Rest): ZodTuple<T, Rest>;
586
585
  }
587
586
  export declare const ZodTuple: core.$constructor<ZodTuple>;
588
- export declare function tuple<T extends readonly [SomeType, ...SomeType[]]>(items: T, params?: core.$ZodTupleParams): ZodTuple<T, null>;
589
- export declare function tuple<T extends readonly [SomeType, ...SomeType[]], Rest extends SomeType>(items: T, rest: Rest, params?: core.$ZodTupleParams): ZodTuple<T, Rest>;
587
+ export declare function tuple<T extends readonly [core.$ZodType, ...core.$ZodType[]]>(items: T, params?: core.$ZodTupleParams): ZodTuple<T, null>;
588
+ export declare function tuple<T extends readonly [core.$ZodType, ...core.$ZodType[]], Rest extends core.$ZodType>(items: T, rest: Rest, params?: core.$ZodTupleParams): ZodTuple<T, Rest>;
590
589
  export declare function tuple(items: [], params?: core.$ZodTupleParams): ZodTuple<[], null>;
591
- export interface ZodRecord<Key extends core.$ZodRecordKey = core.$ZodRecordKey, Value extends SomeType = SomeType> extends ZodType {
590
+ export interface ZodRecord<Key extends core.$ZodRecordKey = core.$ZodRecordKey, Value extends core.$ZodType = core.$ZodType> extends ZodType {
592
591
  _zod: core.$ZodRecordInternals<Key, Value>;
593
592
  keyType: Key;
594
593
  valueType: Value;
595
594
  }
596
595
  export declare const ZodRecord: core.$constructor<ZodRecord>;
597
- export declare function record<Key extends core.$ZodRecordKey, Value extends SomeType>(keyType: Key, valueType: Value, params?: core.$ZodRecordParams): ZodRecord<Key, Value>;
598
- export interface ZodMap<Key extends SomeType = SomeType, Value extends SomeType = SomeType> extends ZodType {
596
+ export declare function record<Key extends core.$ZodRecordKey, Value extends core.$ZodType>(keyType: Key, valueType: Value, params?: core.$ZodRecordParams): ZodRecord<Key, Value>;
597
+ export interface ZodMap<Key extends core.$ZodType = core.$ZodType, Value extends core.$ZodType = core.$ZodType> extends ZodType {
599
598
  _zod: core.$ZodMapInternals<Key, Value>;
600
599
  keyType: Key;
601
600
  valueType: Value;
602
601
  }
603
602
  export declare const ZodMap: core.$constructor<ZodMap>;
604
- export declare function map<Key extends SomeType, Value extends SomeType>(keyType: Key, valueType: Value, params?: core.$ZodMapParams): ZodMap<Key, Value>;
605
- export interface ZodSet<T extends SomeType = SomeType> extends ZodType {
603
+ export declare function map<Key extends core.$ZodType, Value extends core.$ZodType>(keyType: Key, valueType: Value, params?: core.$ZodMapParams): ZodMap<Key, Value>;
604
+ export interface ZodSet<T extends core.$ZodType = core.$ZodType> extends ZodType {
606
605
  _zod: core.$ZodSetInternals<T>;
607
606
  min(minSize: number, params?: core.$ZodCheckMinSizeParams): this;
608
607
  /** */
@@ -611,7 +610,7 @@ export interface ZodSet<T extends SomeType = SomeType> extends ZodType {
611
610
  size(size: number, params?: core.$ZodCheckSizeEqualsParams): this;
612
611
  }
613
612
  export declare const ZodSet: core.$constructor<ZodSet>;
614
- export declare function set<Value extends SomeType>(valueType: Value, params?: core.$ZodSetParams): ZodSet<Value>;
613
+ export declare function set<Value extends core.$ZodType>(valueType: Value, params?: core.$ZodSetParams): ZodSet<Value>;
615
614
  export interface ZodEnum<T extends util.EnumLike = util.EnumLike> extends ZodType {
616
615
  _zod: core.$ZodEnumInternals<T>;
617
616
  enum: T;
@@ -651,82 +650,82 @@ export interface ZodTransform<O = unknown, I = unknown> extends ZodType {
651
650
  }
652
651
  export declare const ZodTransform: core.$constructor<ZodTransform>;
653
652
  export declare function transform<I = unknown, O = I>(fn: (input: I, ctx: core.ParsePayload) => O, params?: core.$ZodTransformParams): ZodTransform<Awaited<O>, I>;
654
- export interface ZodOptional<T extends SomeType = SomeType> extends ZodType {
653
+ export interface ZodOptional<T extends core.$ZodType = core.$ZodType> extends ZodType {
655
654
  _zod: core.$ZodOptionalInternals<T>;
656
655
  unwrap(): T;
657
656
  }
658
657
  export declare const ZodOptional: core.$constructor<ZodOptional>;
659
- export declare function optional<T extends SomeType>(innerType: T, params?: core.$ZodOptionalParams): ZodOptional<T>;
660
- export interface ZodNullable<T extends SomeType = SomeType> extends ZodType {
658
+ export declare function optional<T extends core.$ZodType>(innerType: T, params?: core.$ZodOptionalParams): ZodOptional<T>;
659
+ export interface ZodNullable<T extends core.$ZodType = core.$ZodType> extends ZodType {
661
660
  _zod: core.$ZodNullableInternals<T>;
662
661
  unwrap(): T;
663
662
  }
664
663
  export declare const ZodNullable: core.$constructor<ZodNullable>;
665
- export declare function nullable<T extends SomeType>(innerType: T, params?: core.$ZodNullableParams): ZodNullable<T>;
666
- export declare function nullish<T extends SomeType>(innerType: T): ZodOptional<ZodNullable<T>>;
667
- export interface ZodDefault<T extends SomeType = SomeType> extends ZodType {
664
+ export declare function nullable<T extends core.$ZodType>(innerType: T, params?: core.$ZodNullableParams): ZodNullable<T>;
665
+ export declare function nullish<T extends core.$ZodType>(innerType: T): ZodOptional<ZodNullable<T>>;
666
+ export interface ZodDefault<T extends core.$ZodType = core.$ZodType> extends ZodType {
668
667
  _zod: core.$ZodDefaultInternals<T>;
669
668
  unwrap(): T;
670
669
  /** @deprecated Use `.unwrap()` instead. */
671
670
  removeDefault(): T;
672
671
  }
673
672
  export declare const ZodDefault: core.$constructor<ZodDefault>;
674
- export declare function _default<T extends SomeType>(innerType: T, defaultValue: util.NoUndefined<core.output<T>> | (() => util.NoUndefined<core.output<T>>), params?: core.$ZodDefaultParams): ZodDefault<T>;
675
- export interface ZodNonOptional<T extends SomeType = SomeType> extends ZodType {
673
+ export declare function _default<T extends core.$ZodType>(innerType: T, defaultValue: util.NoUndefined<core.output<T>> | (() => util.NoUndefined<core.output<T>>), params?: core.$ZodDefaultParams): ZodDefault<T>;
674
+ export interface ZodNonOptional<T extends core.$ZodType = core.$ZodType> extends ZodType {
676
675
  _zod: core.$ZodNonOptionalInternals<T>;
677
676
  unwrap(): T;
678
677
  }
679
678
  export declare const ZodNonOptional: core.$constructor<ZodNonOptional>;
680
- export declare function nonoptional<T extends SomeType>(innerType: T, params?: core.$ZodNonOptionalParams): ZodNonOptional<T>;
681
- export interface ZodSuccess<T extends SomeType = SomeType> extends ZodType {
679
+ export declare function nonoptional<T extends core.$ZodType>(innerType: T, params?: core.$ZodNonOptionalParams): ZodNonOptional<T>;
680
+ export interface ZodSuccess<T extends core.$ZodType = core.$ZodType> extends ZodType {
682
681
  _zod: core.$ZodSuccessInternals<T>;
683
682
  unwrap(): T;
684
683
  }
685
684
  export declare const ZodSuccess: core.$constructor<ZodSuccess>;
686
- export declare function success<T extends SomeType>(innerType: T, params?: core.$ZodSuccessParams): ZodSuccess<T>;
687
- export interface ZodCatch<T extends SomeType = SomeType> extends ZodType {
685
+ export declare function success<T extends core.$ZodType>(innerType: T, params?: core.$ZodSuccessParams): ZodSuccess<T>;
686
+ export interface ZodCatch<T extends core.$ZodType = core.$ZodType> extends ZodType {
688
687
  _zod: core.$ZodCatchInternals<T>;
689
688
  unwrap(): T;
690
689
  /** @deprecated Use `.unwrap()` instead. */
691
690
  removeCatch(): T;
692
691
  }
693
692
  export declare const ZodCatch: core.$constructor<ZodCatch>;
694
- declare function _catch<T extends SomeType>(innerType: T, catchValue: core.output<T> | ((ctx: core.$ZodCatchCtx) => core.output<T>), params?: core.$ZodCatchParams): ZodCatch<T>;
693
+ declare function _catch<T extends core.$ZodType>(innerType: T, catchValue: core.output<T> | ((ctx: core.$ZodCatchCtx) => core.output<T>), params?: core.$ZodCatchParams): ZodCatch<T>;
695
694
  export { _catch as catch };
696
695
  export interface ZodNaN extends ZodType {
697
696
  _zod: core.$ZodNaNInternals;
698
697
  }
699
698
  export declare const ZodNaN: core.$constructor<ZodNaN>;
700
699
  export declare function nan(params?: string | core.$ZodNaNParams): ZodNaN;
701
- export interface ZodPipe<A extends SomeType = SomeType, B extends SomeType = SomeType> extends ZodType {
700
+ export interface ZodPipe<A extends core.$ZodType = core.$ZodType, B extends core.$ZodType = core.$ZodType> extends ZodType {
702
701
  _zod: core.$ZodPipeInternals<A, B>;
703
702
  in: A;
704
703
  out: B;
705
704
  }
706
705
  export declare const ZodPipe: core.$constructor<ZodPipe>;
707
706
  export declare function pipe<const A extends core.$ZodType, B extends core.$ZodType<unknown, core.output<A>> = core.$ZodType<unknown, core.output<A>>>(in_: A, out: B | core.$ZodType<unknown, core.output<A>>, params?: core.$ZodPipeParams): ZodPipe<A, B>;
708
- export interface ZodReadonly<T extends SomeType = SomeType> extends ZodType {
707
+ export interface ZodReadonly<T extends core.$ZodType = core.$ZodType> extends ZodType {
709
708
  _zod: core.$ZodReadonlyInternals<T>;
710
709
  }
711
710
  export declare const ZodReadonly: core.$constructor<ZodReadonly>;
712
- export declare function readonly<T extends SomeType>(innerType: T, params?: core.$ZodReadonlyParams): ZodReadonly<T>;
711
+ export declare function readonly<T extends core.$ZodType>(innerType: T, params?: core.$ZodReadonlyParams): ZodReadonly<T>;
713
712
  export interface ZodTemplateLiteral<Template extends string = string> extends ZodType {
714
713
  _zod: core.$ZodTemplateLiteralInternals<Template>;
715
714
  }
716
715
  export declare const ZodTemplateLiteral: core.$constructor<ZodTemplateLiteral>;
717
716
  export declare function templateLiteral<const Parts extends core.$TemplateLiteralPart[]>(parts: Parts, params?: core.$ZodTemplateLiteralParams): ZodTemplateLiteral<core.$PartsToTemplateLiteral<Parts>>;
718
- export interface ZodLazy<T extends SomeType = SomeType> extends ZodType {
717
+ export interface ZodLazy<T extends core.$ZodType = core.$ZodType> extends ZodType {
719
718
  _zod: core.$ZodLazyInternals<T>;
720
719
  unwrap(): T;
721
720
  }
722
721
  export declare const ZodLazy: core.$constructor<ZodLazy>;
723
- export declare function lazy<T extends SomeType>(getter: () => T): ZodLazy<T>;
724
- export interface ZodPromise<T extends SomeType = SomeType> extends ZodType {
722
+ export declare function lazy<T extends core.$ZodType>(getter: () => T): ZodLazy<T>;
723
+ export interface ZodPromise<T extends core.$ZodType = core.$ZodType> extends ZodType {
725
724
  _zod: core.$ZodPromiseInternals<T>;
726
725
  unwrap(): T;
727
726
  }
728
727
  export declare const ZodPromise: core.$constructor<ZodPromise>;
729
- export declare function promise<T extends SomeType>(innerType: T, params?: core.$ZodPromiseParams): ZodPromise<T>;
728
+ export declare function promise<T extends core.$ZodType>(innerType: T, params?: core.$ZodPromiseParams): ZodPromise<T>;
730
729
  export interface ZodCustom<O = unknown, I = unknown> extends ZodType {
731
730
  _zod: core.$ZodCustomInternals<O, I>;
732
731
  }
@@ -15,23 +15,13 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
35
25
  Object.defineProperty(exports, "__esModule", { value: true });
36
26
  exports.ZodLiteral = exports.ZodEnum = exports.ZodSet = exports.ZodMap = exports.ZodRecord = exports.ZodTuple = exports.ZodIntersection = exports.ZodDiscriminatedUnion = exports.ZodUnion = exports.ZodObject = exports.ZodInterface = exports.ZodObjectLike = exports.ZodArray = exports.ZodDate = exports.ZodVoid = exports.ZodNever = exports.ZodUnknown = exports.ZodAny = exports.ZodNull = exports.ZodUndefined = exports.ZodSymbol = exports.ZodBigIntFormat = exports.ZodBigInt = exports.ZodBoolean = exports.ZodNumberFormat = exports.ZodNumber = exports.ZodJWT = exports.ZodE164 = exports.ZodBase64URL = exports.ZodBase64 = exports.ZodCIDRv6 = exports.ZodCIDRv4 = exports.ZodIPv6 = exports.ZodIPv4 = exports.ZodKSUID = exports.ZodXID = exports.ZodULID = exports.ZodCUID2 = exports.ZodCUID = exports.ZodNanoID = exports.ZodEmoji = exports.ZodURL = exports.ZodUUID = exports.ZodGUID = exports.ZodEmail = exports.ZodStringFormat = exports.ZodString = exports.ZodType = exports.coerce = exports.iso = void 0;
37
27
  exports.stringbool = exports.ZodCustom = exports.ZodPromise = exports.ZodLazy = exports.ZodTemplateLiteral = exports.ZodReadonly = exports.ZodPipe = exports.ZodNaN = exports.ZodCatch = exports.ZodSuccess = exports.ZodNonOptional = exports.ZodDefault = exports.ZodNullable = exports.ZodOptional = exports.ZodTransform = exports.ZodFile = void 0;
@@ -242,7 +232,7 @@ exports.ZodString = core.$constructor("ZodString", (inst, def) => {
242
232
  inst.time = (params) => inst.check(iso.time(params));
243
233
  inst.duration = (params) => inst.check(iso.duration(params));
244
234
  // validations
245
- inst.regex = (params) => inst.check(checks.regex(params));
235
+ inst.regex = (...args) => inst.check(checks.regex(...args));
246
236
  inst.includes = (...args) => inst.check(checks.includes(...args));
247
237
  inst.startsWith = (params) => inst.check(checks.startsWith(params));
248
238
  inst.endsWith = (params) => inst.check(checks.endsWith(params));
@@ -3,7 +3,6 @@ import { util } from "@zod/core";
3
3
  import * as parse from "./parse.js";
4
4
  export * as iso from "./iso.js";
5
5
  export * as coerce from "./coerce.js";
6
- type SomeType = core.$ZodType;
7
6
  export interface RefinementCtx<T = unknown> extends core.ParsePayload<T> {
8
7
  addIssue(arg: string | core.$ZodRawIssue | Partial<core.$ZodIssueCustom>): void;
9
8
  }
@@ -377,7 +376,7 @@ export interface ZodDate extends _ZodDate<Date> {
377
376
  }
378
377
  export declare const ZodDate: core.$constructor<ZodDate>;
379
378
  export declare function date(params?: string | core.$ZodDateParams): ZodDate;
380
- export interface ZodArray<T extends SomeType = SomeType> extends ZodType {
379
+ export interface ZodArray<T extends core.$ZodType = core.$ZodType> extends ZodType {
381
380
  _zod: core.$ZodArrayInternals<T>;
382
381
  element: T;
383
382
  min(minLength: number, params?: string | core.$ZodCheckMinLengthParams): this;
@@ -386,7 +385,7 @@ export interface ZodArray<T extends SomeType = SomeType> extends ZodType {
386
385
  length(len: number, params?: string | core.$ZodCheckLengthEqualsParams): this;
387
386
  }
388
387
  export declare const ZodArray: core.$constructor<ZodArray>;
389
- export declare function array<T extends SomeType>(element: T, params?: core.$ZodArrayParams): ZodArray<T>;
388
+ export declare function array<T extends core.$ZodType>(element: T, params?: core.$ZodArrayParams): ZodArray<T>;
390
389
  export interface ZodObjectLike<out O = object, out I = object> extends ZodType {
391
390
  _zod: core.$ZodObjectLikeInternals<O, I>;
392
391
  }
@@ -407,7 +406,7 @@ type ZodInterfaceRequired<T extends ZodInterface, Keys extends keyof T["_zod"]["
407
406
  defaulted: T["_zod"]["defaulted"];
408
407
  extra: T["_zod"]["extra"];
409
408
  }>;
410
- type MergeInterfaces<A extends ZodInterface, B extends ZodInterface> = ZodInterface<util.ExtendShape<A["_zod"]["def"]["shape"], B["_zod"]["def"]["shape"]>, util.MergeInterfaceParams<A, B>>;
409
+ export type MergeInterfaces<A extends ZodInterface, B extends ZodInterface> = ZodInterface<util.ExtendShape<A["_zod"]["def"]["shape"], B["_zod"]["def"]["shape"]>, util.MergeInterfaceParams<A, B>>;
411
410
  export interface ZodInterface<out Shape extends core.$ZodLooseShape = core.$ZodLooseShape, out Params extends core.$ZodInterfaceNamedParams = core.$ZodInterfaceNamedParams> extends ZodType {
412
411
  _zod: core.$ZodInterfaceInternals<Shape, Params>;
413
412
  keyof(): ZodEnum<util.ToEnum<util.InterfaceKeys<string & keyof Shape>>>;
@@ -433,7 +432,7 @@ export interface ZodInterface<out Shape extends core.$ZodLooseShape = core.$ZodL
433
432
  }>;
434
433
  extend<U extends ZodInterface>(int: U): MergeInterfaces<this, U>;
435
434
  extend<U extends core.$ZodLooseShape>(shape: U): MergeInterfaces<this, ZodInterface<U, util.InitInterfaceParams<U, {}>>>;
436
- /** @deprecated Use `.extend()` */
435
+ /** @deprecated Use `A.extend(B)` */
437
436
  merge<U extends ZodInterface>(incoming: U): MergeInterfaces<this, U>;
438
437
  pick<const M extends util.Exactly<util.Mask<string & keyof Shape>, M>>(mask: M): ZodInterface<util.Flatten<Pick<Shape, keyof Shape & keyof M>>, {
439
438
  optional: Extract<Params["optional"], keyof M>;
@@ -488,7 +487,7 @@ export interface ZodObject<out Shape extends core.$ZodShape = core.$ZodShape, Ex
488
487
  }, Extra>;
489
488
  }
490
489
  export declare const ZodObject: core.$constructor<ZodObject>;
491
- export declare function object<T extends core.$ZodShape = Record<never, SomeType>>(shape?: T, params?: core.$ZodObjectLikeParams): ZodObject<T, {}>;
490
+ export declare function object<T extends core.$ZodShape = Record<never, core.$ZodType>>(shape?: T, params?: core.$ZodObjectLikeParams): ZodObject<T, {}>;
492
491
  export declare function strictObject<T extends core.$ZodShape>(shape: T, params?: core.$ZodObjectParams): ZodObject<T, {}>;
493
492
  export declare function looseObject<T extends core.$ZodShape>(shape: T, params?: core.$ZodObjectParams): ZodObject<T, {
494
493
  [k: string]: unknown;
@@ -557,13 +556,13 @@ export declare function required<T extends {
557
556
  defaulted: T["_zod"]["defaulted"];
558
557
  extra: T["_zod"]["extra"];
559
558
  }>;
560
- export interface ZodUnion<T extends readonly SomeType[] = readonly SomeType[]> extends ZodType {
559
+ export interface ZodUnion<T extends readonly core.$ZodType[] = readonly core.$ZodType[]> extends ZodType {
561
560
  _zod: core.$ZodUnionInternals<T>;
562
561
  options: T;
563
562
  }
564
563
  export declare const ZodUnion: core.$constructor<ZodUnion>;
565
- export declare function union<const T extends readonly SomeType[]>(options: T, params?: core.$ZodUnionParams): ZodUnion<T>;
566
- export interface ZodDiscriminatedUnion<Options extends readonly SomeType[] = readonly SomeType[]> extends ZodUnion<Options> {
564
+ export declare function union<const T extends readonly core.$ZodType[]>(options: T, params?: core.$ZodUnionParams): ZodUnion<T>;
565
+ export interface ZodDiscriminatedUnion<Options extends readonly core.$ZodType[] = readonly core.$ZodType[]> extends ZodUnion<Options> {
567
566
  _zod: core.$ZodDiscriminatedUnionInternals<Options>;
568
567
  }
569
568
  export declare const ZodDiscriminatedUnion: core.$constructor<ZodDiscriminatedUnion>;
@@ -575,34 +574,34 @@ export interface $ZodTypeDiscriminable extends ZodType {
575
574
  }
576
575
  export declare function discriminatedUnion<Types extends [$ZodTypeDiscriminable, ...$ZodTypeDiscriminable[]]>(disc: string, options: Types, params?: core.$ZodDiscriminatedUnionParams): ZodDiscriminatedUnion<Types>;
577
576
  export declare function discriminatedUnion<Types extends [$ZodTypeDiscriminable, ...$ZodTypeDiscriminable[]]>(options: Types, params?: core.$ZodDiscriminatedUnionParams): ZodDiscriminatedUnion<Types>;
578
- export interface ZodIntersection<A extends SomeType = SomeType, B extends SomeType = SomeType> extends ZodType {
577
+ export interface ZodIntersection<A extends core.$ZodType = core.$ZodType, B extends core.$ZodType = core.$ZodType> extends ZodType {
579
578
  _zod: core.$ZodIntersectionInternals<A, B>;
580
579
  }
581
580
  export declare const ZodIntersection: core.$constructor<ZodIntersection>;
582
- export declare function intersection<T extends SomeType, U extends SomeType>(left: T, right: U, params?: core.$ZodIntersectionParams): ZodIntersection<T, U>;
583
- export interface ZodTuple<T extends util.TupleItems = util.TupleItems, Rest extends SomeType | null = SomeType | null> extends ZodType {
581
+ export declare function intersection<T extends core.$ZodType, U extends core.$ZodType>(left: T, right: U, params?: core.$ZodIntersectionParams): ZodIntersection<T, U>;
582
+ export interface ZodTuple<T extends util.TupleItems = util.TupleItems, Rest extends core.$ZodType | null = core.$ZodType | null> extends ZodType {
584
583
  _zod: core.$ZodTupleInternals<T, Rest>;
585
584
  rest<Rest extends core.$ZodType>(rest: Rest): ZodTuple<T, Rest>;
586
585
  }
587
586
  export declare const ZodTuple: core.$constructor<ZodTuple>;
588
- export declare function tuple<T extends readonly [SomeType, ...SomeType[]]>(items: T, params?: core.$ZodTupleParams): ZodTuple<T, null>;
589
- export declare function tuple<T extends readonly [SomeType, ...SomeType[]], Rest extends SomeType>(items: T, rest: Rest, params?: core.$ZodTupleParams): ZodTuple<T, Rest>;
587
+ export declare function tuple<T extends readonly [core.$ZodType, ...core.$ZodType[]]>(items: T, params?: core.$ZodTupleParams): ZodTuple<T, null>;
588
+ export declare function tuple<T extends readonly [core.$ZodType, ...core.$ZodType[]], Rest extends core.$ZodType>(items: T, rest: Rest, params?: core.$ZodTupleParams): ZodTuple<T, Rest>;
590
589
  export declare function tuple(items: [], params?: core.$ZodTupleParams): ZodTuple<[], null>;
591
- export interface ZodRecord<Key extends core.$ZodRecordKey = core.$ZodRecordKey, Value extends SomeType = SomeType> extends ZodType {
590
+ export interface ZodRecord<Key extends core.$ZodRecordKey = core.$ZodRecordKey, Value extends core.$ZodType = core.$ZodType> extends ZodType {
592
591
  _zod: core.$ZodRecordInternals<Key, Value>;
593
592
  keyType: Key;
594
593
  valueType: Value;
595
594
  }
596
595
  export declare const ZodRecord: core.$constructor<ZodRecord>;
597
- export declare function record<Key extends core.$ZodRecordKey, Value extends SomeType>(keyType: Key, valueType: Value, params?: core.$ZodRecordParams): ZodRecord<Key, Value>;
598
- export interface ZodMap<Key extends SomeType = SomeType, Value extends SomeType = SomeType> extends ZodType {
596
+ export declare function record<Key extends core.$ZodRecordKey, Value extends core.$ZodType>(keyType: Key, valueType: Value, params?: core.$ZodRecordParams): ZodRecord<Key, Value>;
597
+ export interface ZodMap<Key extends core.$ZodType = core.$ZodType, Value extends core.$ZodType = core.$ZodType> extends ZodType {
599
598
  _zod: core.$ZodMapInternals<Key, Value>;
600
599
  keyType: Key;
601
600
  valueType: Value;
602
601
  }
603
602
  export declare const ZodMap: core.$constructor<ZodMap>;
604
- export declare function map<Key extends SomeType, Value extends SomeType>(keyType: Key, valueType: Value, params?: core.$ZodMapParams): ZodMap<Key, Value>;
605
- export interface ZodSet<T extends SomeType = SomeType> extends ZodType {
603
+ export declare function map<Key extends core.$ZodType, Value extends core.$ZodType>(keyType: Key, valueType: Value, params?: core.$ZodMapParams): ZodMap<Key, Value>;
604
+ export interface ZodSet<T extends core.$ZodType = core.$ZodType> extends ZodType {
606
605
  _zod: core.$ZodSetInternals<T>;
607
606
  min(minSize: number, params?: core.$ZodCheckMinSizeParams): this;
608
607
  /** */
@@ -611,7 +610,7 @@ export interface ZodSet<T extends SomeType = SomeType> extends ZodType {
611
610
  size(size: number, params?: core.$ZodCheckSizeEqualsParams): this;
612
611
  }
613
612
  export declare const ZodSet: core.$constructor<ZodSet>;
614
- export declare function set<Value extends SomeType>(valueType: Value, params?: core.$ZodSetParams): ZodSet<Value>;
613
+ export declare function set<Value extends core.$ZodType>(valueType: Value, params?: core.$ZodSetParams): ZodSet<Value>;
615
614
  export interface ZodEnum<T extends util.EnumLike = util.EnumLike> extends ZodType {
616
615
  _zod: core.$ZodEnumInternals<T>;
617
616
  enum: T;
@@ -651,82 +650,82 @@ export interface ZodTransform<O = unknown, I = unknown> extends ZodType {
651
650
  }
652
651
  export declare const ZodTransform: core.$constructor<ZodTransform>;
653
652
  export declare function transform<I = unknown, O = I>(fn: (input: I, ctx: core.ParsePayload) => O, params?: core.$ZodTransformParams): ZodTransform<Awaited<O>, I>;
654
- export interface ZodOptional<T extends SomeType = SomeType> extends ZodType {
653
+ export interface ZodOptional<T extends core.$ZodType = core.$ZodType> extends ZodType {
655
654
  _zod: core.$ZodOptionalInternals<T>;
656
655
  unwrap(): T;
657
656
  }
658
657
  export declare const ZodOptional: core.$constructor<ZodOptional>;
659
- export declare function optional<T extends SomeType>(innerType: T, params?: core.$ZodOptionalParams): ZodOptional<T>;
660
- export interface ZodNullable<T extends SomeType = SomeType> extends ZodType {
658
+ export declare function optional<T extends core.$ZodType>(innerType: T, params?: core.$ZodOptionalParams): ZodOptional<T>;
659
+ export interface ZodNullable<T extends core.$ZodType = core.$ZodType> extends ZodType {
661
660
  _zod: core.$ZodNullableInternals<T>;
662
661
  unwrap(): T;
663
662
  }
664
663
  export declare const ZodNullable: core.$constructor<ZodNullable>;
665
- export declare function nullable<T extends SomeType>(innerType: T, params?: core.$ZodNullableParams): ZodNullable<T>;
666
- export declare function nullish<T extends SomeType>(innerType: T): ZodOptional<ZodNullable<T>>;
667
- export interface ZodDefault<T extends SomeType = SomeType> extends ZodType {
664
+ export declare function nullable<T extends core.$ZodType>(innerType: T, params?: core.$ZodNullableParams): ZodNullable<T>;
665
+ export declare function nullish<T extends core.$ZodType>(innerType: T): ZodOptional<ZodNullable<T>>;
666
+ export interface ZodDefault<T extends core.$ZodType = core.$ZodType> extends ZodType {
668
667
  _zod: core.$ZodDefaultInternals<T>;
669
668
  unwrap(): T;
670
669
  /** @deprecated Use `.unwrap()` instead. */
671
670
  removeDefault(): T;
672
671
  }
673
672
  export declare const ZodDefault: core.$constructor<ZodDefault>;
674
- export declare function _default<T extends SomeType>(innerType: T, defaultValue: util.NoUndefined<core.output<T>> | (() => util.NoUndefined<core.output<T>>), params?: core.$ZodDefaultParams): ZodDefault<T>;
675
- export interface ZodNonOptional<T extends SomeType = SomeType> extends ZodType {
673
+ export declare function _default<T extends core.$ZodType>(innerType: T, defaultValue: util.NoUndefined<core.output<T>> | (() => util.NoUndefined<core.output<T>>), params?: core.$ZodDefaultParams): ZodDefault<T>;
674
+ export interface ZodNonOptional<T extends core.$ZodType = core.$ZodType> extends ZodType {
676
675
  _zod: core.$ZodNonOptionalInternals<T>;
677
676
  unwrap(): T;
678
677
  }
679
678
  export declare const ZodNonOptional: core.$constructor<ZodNonOptional>;
680
- export declare function nonoptional<T extends SomeType>(innerType: T, params?: core.$ZodNonOptionalParams): ZodNonOptional<T>;
681
- export interface ZodSuccess<T extends SomeType = SomeType> extends ZodType {
679
+ export declare function nonoptional<T extends core.$ZodType>(innerType: T, params?: core.$ZodNonOptionalParams): ZodNonOptional<T>;
680
+ export interface ZodSuccess<T extends core.$ZodType = core.$ZodType> extends ZodType {
682
681
  _zod: core.$ZodSuccessInternals<T>;
683
682
  unwrap(): T;
684
683
  }
685
684
  export declare const ZodSuccess: core.$constructor<ZodSuccess>;
686
- export declare function success<T extends SomeType>(innerType: T, params?: core.$ZodSuccessParams): ZodSuccess<T>;
687
- export interface ZodCatch<T extends SomeType = SomeType> extends ZodType {
685
+ export declare function success<T extends core.$ZodType>(innerType: T, params?: core.$ZodSuccessParams): ZodSuccess<T>;
686
+ export interface ZodCatch<T extends core.$ZodType = core.$ZodType> extends ZodType {
688
687
  _zod: core.$ZodCatchInternals<T>;
689
688
  unwrap(): T;
690
689
  /** @deprecated Use `.unwrap()` instead. */
691
690
  removeCatch(): T;
692
691
  }
693
692
  export declare const ZodCatch: core.$constructor<ZodCatch>;
694
- declare function _catch<T extends SomeType>(innerType: T, catchValue: core.output<T> | ((ctx: core.$ZodCatchCtx) => core.output<T>), params?: core.$ZodCatchParams): ZodCatch<T>;
693
+ declare function _catch<T extends core.$ZodType>(innerType: T, catchValue: core.output<T> | ((ctx: core.$ZodCatchCtx) => core.output<T>), params?: core.$ZodCatchParams): ZodCatch<T>;
695
694
  export { _catch as catch };
696
695
  export interface ZodNaN extends ZodType {
697
696
  _zod: core.$ZodNaNInternals;
698
697
  }
699
698
  export declare const ZodNaN: core.$constructor<ZodNaN>;
700
699
  export declare function nan(params?: string | core.$ZodNaNParams): ZodNaN;
701
- export interface ZodPipe<A extends SomeType = SomeType, B extends SomeType = SomeType> extends ZodType {
700
+ export interface ZodPipe<A extends core.$ZodType = core.$ZodType, B extends core.$ZodType = core.$ZodType> extends ZodType {
702
701
  _zod: core.$ZodPipeInternals<A, B>;
703
702
  in: A;
704
703
  out: B;
705
704
  }
706
705
  export declare const ZodPipe: core.$constructor<ZodPipe>;
707
706
  export declare function pipe<const A extends core.$ZodType, B extends core.$ZodType<unknown, core.output<A>> = core.$ZodType<unknown, core.output<A>>>(in_: A, out: B | core.$ZodType<unknown, core.output<A>>, params?: core.$ZodPipeParams): ZodPipe<A, B>;
708
- export interface ZodReadonly<T extends SomeType = SomeType> extends ZodType {
707
+ export interface ZodReadonly<T extends core.$ZodType = core.$ZodType> extends ZodType {
709
708
  _zod: core.$ZodReadonlyInternals<T>;
710
709
  }
711
710
  export declare const ZodReadonly: core.$constructor<ZodReadonly>;
712
- export declare function readonly<T extends SomeType>(innerType: T, params?: core.$ZodReadonlyParams): ZodReadonly<T>;
711
+ export declare function readonly<T extends core.$ZodType>(innerType: T, params?: core.$ZodReadonlyParams): ZodReadonly<T>;
713
712
  export interface ZodTemplateLiteral<Template extends string = string> extends ZodType {
714
713
  _zod: core.$ZodTemplateLiteralInternals<Template>;
715
714
  }
716
715
  export declare const ZodTemplateLiteral: core.$constructor<ZodTemplateLiteral>;
717
716
  export declare function templateLiteral<const Parts extends core.$TemplateLiteralPart[]>(parts: Parts, params?: core.$ZodTemplateLiteralParams): ZodTemplateLiteral<core.$PartsToTemplateLiteral<Parts>>;
718
- export interface ZodLazy<T extends SomeType = SomeType> extends ZodType {
717
+ export interface ZodLazy<T extends core.$ZodType = core.$ZodType> extends ZodType {
719
718
  _zod: core.$ZodLazyInternals<T>;
720
719
  unwrap(): T;
721
720
  }
722
721
  export declare const ZodLazy: core.$constructor<ZodLazy>;
723
- export declare function lazy<T extends SomeType>(getter: () => T): ZodLazy<T>;
724
- export interface ZodPromise<T extends SomeType = SomeType> extends ZodType {
722
+ export declare function lazy<T extends core.$ZodType>(getter: () => T): ZodLazy<T>;
723
+ export interface ZodPromise<T extends core.$ZodType = core.$ZodType> extends ZodType {
725
724
  _zod: core.$ZodPromiseInternals<T>;
726
725
  unwrap(): T;
727
726
  }
728
727
  export declare const ZodPromise: core.$constructor<ZodPromise>;
729
- export declare function promise<T extends SomeType>(innerType: T, params?: core.$ZodPromiseParams): ZodPromise<T>;
728
+ export declare function promise<T extends core.$ZodType>(innerType: T, params?: core.$ZodPromiseParams): ZodPromise<T>;
730
729
  export interface ZodCustom<O = unknown, I = unknown> extends ZodType {
731
730
  _zod: core.$ZodCustomInternals<O, I>;
732
731
  }
@@ -118,7 +118,7 @@ export const ZodString = /*@__PURE__*/ core.$constructor("ZodString", (inst, def
118
118
  inst.time = (params) => inst.check(iso.time(params));
119
119
  inst.duration = (params) => inst.check(iso.duration(params));
120
120
  // validations
121
- inst.regex = (params) => inst.check(checks.regex(params));
121
+ inst.regex = (...args) => inst.check(checks.regex(...args));
122
122
  inst.includes = (...args) => inst.check(checks.includes(...args));
123
123
  inst.startsWith = (params) => inst.check(checks.startsWith(params));
124
124
  inst.endsWith = (params) => inst.check(checks.endsWith(params));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zod",
3
- "version": "4.0.0-beta.20250411T195319",
3
+ "version": "4.0.0-beta.20250412T083508",
4
4
  "type": "module",
5
5
  "author": "Colin McDonnell <zod@colinhacks.com>",
6
6
  "description": "TypeScript-first schema declaration and validation library with static type inference",
@@ -70,7 +70,7 @@
70
70
  }
71
71
  },
72
72
  "dependencies": {
73
- "@zod/core": "0.4.0"
73
+ "@zod/core": "0.4.2"
74
74
  },
75
75
  "scripts": {
76
76
  "clean": "rm -rf dist",
package/src/schemas.ts CHANGED
@@ -7,8 +7,6 @@ import * as parse from "./parse.js";
7
7
  export * as iso from "./iso.js";
8
8
  export * as coerce from "./coerce.js";
9
9
 
10
- type SomeType = core.$ZodType;
11
-
12
10
  ///////////////////////////////////////////
13
11
  ///////////////////////////////////////////
14
12
  //////////// ////////////
@@ -325,7 +323,7 @@ export const ZodString: core.$constructor<ZodString> = /*@__PURE__*/ core.$const
325
323
  inst.duration = (params) => inst.check(iso.duration(params as any));
326
324
 
327
325
  // validations
328
- inst.regex = (params) => inst.check(checks.regex(params));
326
+ inst.regex = (...args) => inst.check(checks.regex(...args));
329
327
  inst.includes = (...args) => inst.check(checks.includes(...args));
330
328
  inst.startsWith = (params) => inst.check(checks.startsWith(params));
331
329
  inst.endsWith = (params) => inst.check(checks.endsWith(params));
@@ -983,7 +981,7 @@ export function date(params?: string | core.$ZodDateParams): ZodDate {
983
981
  }
984
982
 
985
983
  // ZodArray
986
- export interface ZodArray<T extends SomeType = SomeType> extends ZodType {
984
+ export interface ZodArray<T extends core.$ZodType = core.$ZodType> extends ZodType {
987
985
  _zod: core.$ZodArrayInternals<T>;
988
986
 
989
987
  element: T;
@@ -1003,8 +1001,8 @@ export const ZodArray: core.$constructor<ZodArray> = /*@__PURE__*/ core.$constru
1003
1001
  inst.length = (len, params) => inst.check(checks.length(len, params));
1004
1002
  });
1005
1003
 
1006
- export function array<T extends SomeType>(element: T, params?: core.$ZodArrayParams): ZodArray<T>;
1007
- export function array<T extends SomeType>(element: SomeType, params?: any): ZodArray<T> {
1004
+ export function array<T extends core.$ZodType>(element: T, params?: core.$ZodArrayParams): ZodArray<T>;
1005
+ export function array<T extends core.$ZodType>(element: core.$ZodType, params?: any): ZodArray<T> {
1008
1006
  return core._array(ZodArray, element, params) as any;
1009
1007
  }
1010
1008
 
@@ -1067,7 +1065,7 @@ type ZodInterfaceRequired<
1067
1065
  }
1068
1066
  >;
1069
1067
 
1070
- type MergeInterfaces<A extends ZodInterface, B extends ZodInterface> = ZodInterface<
1068
+ export type MergeInterfaces<A extends ZodInterface, B extends ZodInterface> = ZodInterface<
1071
1069
  util.ExtendShape<A["_zod"]["def"]["shape"], B["_zod"]["def"]["shape"]>,
1072
1070
  util.MergeInterfaceParams<A, B>
1073
1071
  >;
@@ -1121,7 +1119,7 @@ export interface ZodInterface<
1121
1119
  shape: U
1122
1120
  ): MergeInterfaces<this, ZodInterface<U, util.InitInterfaceParams<U, {}>>>;
1123
1121
 
1124
- /** @deprecated Use `.extend()` */
1122
+ /** @deprecated Use `A.extend(B)` */
1125
1123
  merge<U extends ZodInterface>(incoming: U): MergeInterfaces<this, U>;
1126
1124
 
1127
1125
  pick<const M extends util.Exactly<util.Mask<string & keyof Shape>, M>>(
@@ -1350,7 +1348,7 @@ export const ZodObject: core.$constructor<ZodObject> = /*@__PURE__*/ core.$const
1350
1348
  inst.partial = (...args: any[]) => util.partialObjectLike(ZodOptional, inst, args[0] as object);
1351
1349
  inst.required = (...args: any[]) => util.requiredObjectLike(ZodNonOptional, inst, args[0] as object);
1352
1350
  });
1353
- export function object<T extends core.$ZodShape = Record<never, SomeType>>(
1351
+ export function object<T extends core.$ZodShape = Record<never, core.$ZodType>>(
1354
1352
  shape?: T,
1355
1353
  params?: core.$ZodObjectLikeParams
1356
1354
  ): ZodObject<T, {}> {
@@ -1594,7 +1592,7 @@ export function required(schema: ZodObjectLike, mask?: object): ZodObjectLike {
1594
1592
  }
1595
1593
 
1596
1594
  // ZodUnion
1597
- export interface ZodUnion<T extends readonly SomeType[] = readonly SomeType[]> extends ZodType {
1595
+ export interface ZodUnion<T extends readonly core.$ZodType[] = readonly core.$ZodType[]> extends ZodType {
1598
1596
  _zod: core.$ZodUnionInternals<T>;
1599
1597
  options: T;
1600
1598
  }
@@ -1604,7 +1602,10 @@ export const ZodUnion: core.$constructor<ZodUnion> = /*@__PURE__*/ core.$constru
1604
1602
  inst.options = def.options;
1605
1603
  });
1606
1604
 
1607
- export function union<const T extends readonly SomeType[]>(options: T, params?: core.$ZodUnionParams): ZodUnion<T> {
1605
+ export function union<const T extends readonly core.$ZodType[]>(
1606
+ options: T,
1607
+ params?: core.$ZodUnionParams
1608
+ ): ZodUnion<T> {
1608
1609
  return new ZodUnion({
1609
1610
  type: "union",
1610
1611
  options,
@@ -1613,7 +1614,7 @@ export function union<const T extends readonly SomeType[]>(options: T, params?:
1613
1614
  }
1614
1615
 
1615
1616
  // ZodDiscriminatedUnion
1616
- export interface ZodDiscriminatedUnion<Options extends readonly SomeType[] = readonly SomeType[]>
1617
+ export interface ZodDiscriminatedUnion<Options extends readonly core.$ZodType[] = readonly core.$ZodType[]>
1617
1618
  extends ZodUnion<Options> {
1618
1619
  _zod: core.$ZodDiscriminatedUnionInternals<Options>;
1619
1620
  }
@@ -1653,7 +1654,8 @@ export function discriminatedUnion(...args: any[]): any {
1653
1654
  }
1654
1655
 
1655
1656
  // ZodIntersection
1656
- export interface ZodIntersection<A extends SomeType = SomeType, B extends SomeType = SomeType> extends ZodType {
1657
+ export interface ZodIntersection<A extends core.$ZodType = core.$ZodType, B extends core.$ZodType = core.$ZodType>
1658
+ extends ZodType {
1657
1659
  _zod: core.$ZodIntersectionInternals<A, B>;
1658
1660
  }
1659
1661
  export const ZodIntersection: core.$constructor<ZodIntersection> = /*@__PURE__*/ core.$constructor(
@@ -1664,7 +1666,7 @@ export const ZodIntersection: core.$constructor<ZodIntersection> = /*@__PURE__*/
1664
1666
  }
1665
1667
  );
1666
1668
 
1667
- export function intersection<T extends SomeType, U extends SomeType>(
1669
+ export function intersection<T extends core.$ZodType, U extends core.$ZodType>(
1668
1670
  left: T,
1669
1671
  right: U,
1670
1672
  params?: core.$ZodIntersectionParams
@@ -1678,8 +1680,10 @@ export function intersection<T extends SomeType, U extends SomeType>(
1678
1680
  }
1679
1681
 
1680
1682
  // ZodTuple
1681
- export interface ZodTuple<T extends util.TupleItems = util.TupleItems, Rest extends SomeType | null = SomeType | null>
1682
- extends ZodType {
1683
+ export interface ZodTuple<
1684
+ T extends util.TupleItems = util.TupleItems,
1685
+ Rest extends core.$ZodType | null = core.$ZodType | null,
1686
+ > extends ZodType {
1683
1687
  _zod: core.$ZodTupleInternals<T, Rest>;
1684
1688
  rest<Rest extends core.$ZodType>(rest: Rest): ZodTuple<T, Rest>;
1685
1689
  }
@@ -1693,19 +1697,19 @@ export const ZodTuple: core.$constructor<ZodTuple> = /*@__PURE__*/ core.$constru
1693
1697
  }) as any;
1694
1698
  });
1695
1699
 
1696
- export function tuple<T extends readonly [SomeType, ...SomeType[]]>(
1700
+ export function tuple<T extends readonly [core.$ZodType, ...core.$ZodType[]]>(
1697
1701
  items: T,
1698
1702
  params?: core.$ZodTupleParams
1699
1703
  ): ZodTuple<T, null>;
1700
- export function tuple<T extends readonly [SomeType, ...SomeType[]], Rest extends SomeType>(
1704
+ export function tuple<T extends readonly [core.$ZodType, ...core.$ZodType[]], Rest extends core.$ZodType>(
1701
1705
  items: T,
1702
1706
  rest: Rest,
1703
1707
  params?: core.$ZodTupleParams
1704
1708
  ): ZodTuple<T, Rest>;
1705
1709
  export function tuple(items: [], params?: core.$ZodTupleParams): ZodTuple<[], null>;
1706
1710
  export function tuple(
1707
- items: SomeType[],
1708
- _paramsOrRest?: core.$ZodTupleParams | SomeType,
1711
+ items: core.$ZodType[],
1712
+ _paramsOrRest?: core.$ZodTupleParams | core.$ZodType,
1709
1713
  _params?: core.$ZodTupleParams
1710
1714
  ) {
1711
1715
  const hasRest = _paramsOrRest instanceof core.$ZodType;
@@ -1720,8 +1724,10 @@ export function tuple(
1720
1724
  }
1721
1725
 
1722
1726
  // ZodRecord
1723
- export interface ZodRecord<Key extends core.$ZodRecordKey = core.$ZodRecordKey, Value extends SomeType = SomeType>
1724
- extends ZodType {
1727
+ export interface ZodRecord<
1728
+ Key extends core.$ZodRecordKey = core.$ZodRecordKey,
1729
+ Value extends core.$ZodType = core.$ZodType,
1730
+ > extends ZodType {
1725
1731
  _zod: core.$ZodRecordInternals<Key, Value>;
1726
1732
  keyType: Key;
1727
1733
  valueType: Value;
@@ -1734,7 +1740,7 @@ export const ZodRecord: core.$constructor<ZodRecord> = /*@__PURE__*/ core.$const
1734
1740
  inst.valueType = def.valueType;
1735
1741
  });
1736
1742
 
1737
- export function record<Key extends core.$ZodRecordKey, Value extends SomeType>(
1743
+ export function record<Key extends core.$ZodRecordKey, Value extends core.$ZodType>(
1738
1744
  keyType: Key,
1739
1745
  valueType: Value,
1740
1746
  params?: core.$ZodRecordParams
@@ -1748,7 +1754,8 @@ export function record<Key extends core.$ZodRecordKey, Value extends SomeType>(
1748
1754
  }
1749
1755
 
1750
1756
  // ZodMap
1751
- export interface ZodMap<Key extends SomeType = SomeType, Value extends SomeType = SomeType> extends ZodType {
1757
+ export interface ZodMap<Key extends core.$ZodType = core.$ZodType, Value extends core.$ZodType = core.$ZodType>
1758
+ extends ZodType {
1752
1759
  _zod: core.$ZodMapInternals<Key, Value>;
1753
1760
 
1754
1761
  keyType: Key;
@@ -1761,7 +1768,7 @@ export const ZodMap: core.$constructor<ZodMap> = /*@__PURE__*/ core.$constructor
1761
1768
  inst.valueType = def.valueType;
1762
1769
  });
1763
1770
 
1764
- export function map<Key extends SomeType, Value extends SomeType>(
1771
+ export function map<Key extends core.$ZodType, Value extends core.$ZodType>(
1765
1772
  keyType: Key,
1766
1773
  valueType: Value,
1767
1774
  params?: core.$ZodMapParams
@@ -1775,7 +1782,7 @@ export function map<Key extends SomeType, Value extends SomeType>(
1775
1782
  }
1776
1783
 
1777
1784
  // ZodSet
1778
- export interface ZodSet<T extends SomeType = SomeType> extends ZodType {
1785
+ export interface ZodSet<T extends core.$ZodType = core.$ZodType> extends ZodType {
1779
1786
  _zod: core.$ZodSetInternals<T>;
1780
1787
  min(minSize: number, params?: core.$ZodCheckMinSizeParams): this;
1781
1788
  /** */
@@ -1793,7 +1800,7 @@ export const ZodSet: core.$constructor<ZodSet> = /*@__PURE__*/ core.$constructor
1793
1800
  inst.size = (...args) => inst.check(core._size(...args));
1794
1801
  });
1795
1802
 
1796
- export function set<Value extends SomeType>(valueType: Value, params?: core.$ZodSetParams): ZodSet<Value> {
1803
+ export function set<Value extends core.$ZodType>(valueType: Value, params?: core.$ZodSetParams): ZodSet<Value> {
1797
1804
  return new ZodSet({
1798
1805
  type: "set",
1799
1806
  valueType,
@@ -1986,7 +1993,7 @@ export function transform<I = unknown, O = I>(
1986
1993
  }
1987
1994
 
1988
1995
  // ZodOptional
1989
- export interface ZodOptional<T extends SomeType = SomeType> extends ZodType {
1996
+ export interface ZodOptional<T extends core.$ZodType = core.$ZodType> extends ZodType {
1990
1997
  _zod: core.$ZodOptionalInternals<T>;
1991
1998
 
1992
1999
  unwrap(): T;
@@ -2001,7 +2008,7 @@ export const ZodOptional: core.$constructor<ZodOptional> = /*@__PURE__*/ core.$c
2001
2008
  }
2002
2009
  );
2003
2010
 
2004
- export function optional<T extends SomeType>(innerType: T, params?: core.$ZodOptionalParams): ZodOptional<T> {
2011
+ export function optional<T extends core.$ZodType>(innerType: T, params?: core.$ZodOptionalParams): ZodOptional<T> {
2005
2012
  return new ZodOptional({
2006
2013
  type: "optional",
2007
2014
  innerType,
@@ -2010,7 +2017,7 @@ export function optional<T extends SomeType>(innerType: T, params?: core.$ZodOpt
2010
2017
  }
2011
2018
 
2012
2019
  // ZodNullable
2013
- export interface ZodNullable<T extends SomeType = SomeType> extends ZodType {
2020
+ export interface ZodNullable<T extends core.$ZodType = core.$ZodType> extends ZodType {
2014
2021
  _zod: core.$ZodNullableInternals<T>;
2015
2022
 
2016
2023
  unwrap(): T;
@@ -2025,7 +2032,7 @@ export const ZodNullable: core.$constructor<ZodNullable> = /*@__PURE__*/ core.$c
2025
2032
  }
2026
2033
  );
2027
2034
 
2028
- export function nullable<T extends SomeType>(innerType: T, params?: core.$ZodNullableParams): ZodNullable<T> {
2035
+ export function nullable<T extends core.$ZodType>(innerType: T, params?: core.$ZodNullableParams): ZodNullable<T> {
2029
2036
  return new ZodNullable({
2030
2037
  type: "nullable",
2031
2038
  innerType,
@@ -2034,12 +2041,12 @@ export function nullable<T extends SomeType>(innerType: T, params?: core.$ZodNul
2034
2041
  }
2035
2042
 
2036
2043
  // nullish
2037
- export function nullish<T extends SomeType>(innerType: T): ZodOptional<ZodNullable<T>> {
2044
+ export function nullish<T extends core.$ZodType>(innerType: T): ZodOptional<ZodNullable<T>> {
2038
2045
  return optional(nullable(innerType));
2039
2046
  }
2040
2047
 
2041
2048
  // ZodDefault
2042
- export interface ZodDefault<T extends SomeType = SomeType> extends ZodType {
2049
+ export interface ZodDefault<T extends core.$ZodType = core.$ZodType> extends ZodType {
2043
2050
  _zod: core.$ZodDefaultInternals<T>;
2044
2051
 
2045
2052
  unwrap(): T;
@@ -2054,7 +2061,7 @@ export const ZodDefault: core.$constructor<ZodDefault> = /*@__PURE__*/ core.$con
2054
2061
  inst.removeDefault = inst.unwrap;
2055
2062
  });
2056
2063
 
2057
- export function _default<T extends SomeType>(
2064
+ export function _default<T extends core.$ZodType>(
2058
2065
  innerType: T,
2059
2066
  defaultValue: util.NoUndefined<core.output<T>> | (() => util.NoUndefined<core.output<T>>),
2060
2067
  params?: core.$ZodDefaultParams
@@ -2068,7 +2075,7 @@ export function _default<T extends SomeType>(
2068
2075
  }
2069
2076
 
2070
2077
  // ZodNonOptional
2071
- export interface ZodNonOptional<T extends SomeType = SomeType> extends ZodType {
2078
+ export interface ZodNonOptional<T extends core.$ZodType = core.$ZodType> extends ZodType {
2072
2079
  _zod: core.$ZodNonOptionalInternals<T>;
2073
2080
 
2074
2081
  unwrap(): T;
@@ -2083,7 +2090,10 @@ export const ZodNonOptional: core.$constructor<ZodNonOptional> = /*@__PURE__*/ c
2083
2090
  }
2084
2091
  );
2085
2092
 
2086
- export function nonoptional<T extends SomeType>(innerType: T, params?: core.$ZodNonOptionalParams): ZodNonOptional<T> {
2093
+ export function nonoptional<T extends core.$ZodType>(
2094
+ innerType: T,
2095
+ params?: core.$ZodNonOptionalParams
2096
+ ): ZodNonOptional<T> {
2087
2097
  return new ZodNonOptional({
2088
2098
  type: "nonoptional",
2089
2099
  innerType,
@@ -2092,7 +2102,7 @@ export function nonoptional<T extends SomeType>(innerType: T, params?: core.$Zod
2092
2102
  }
2093
2103
 
2094
2104
  // ZodSuccess
2095
- export interface ZodSuccess<T extends SomeType = SomeType> extends ZodType {
2105
+ export interface ZodSuccess<T extends core.$ZodType = core.$ZodType> extends ZodType {
2096
2106
  _zod: core.$ZodSuccessInternals<T>;
2097
2107
 
2098
2108
  unwrap(): T;
@@ -2104,7 +2114,7 @@ export const ZodSuccess: core.$constructor<ZodSuccess> = /*@__PURE__*/ core.$con
2104
2114
  inst.unwrap = () => inst._zod.def.innerType;
2105
2115
  });
2106
2116
 
2107
- export function success<T extends SomeType>(innerType: T, params?: core.$ZodSuccessParams): ZodSuccess<T> {
2117
+ export function success<T extends core.$ZodType>(innerType: T, params?: core.$ZodSuccessParams): ZodSuccess<T> {
2108
2118
  return new ZodSuccess({
2109
2119
  type: "success",
2110
2120
  innerType,
@@ -2113,7 +2123,7 @@ export function success<T extends SomeType>(innerType: T, params?: core.$ZodSucc
2113
2123
  }
2114
2124
 
2115
2125
  // ZodCatch
2116
- export interface ZodCatch<T extends SomeType = SomeType> extends ZodType {
2126
+ export interface ZodCatch<T extends core.$ZodType = core.$ZodType> extends ZodType {
2117
2127
  _zod: core.$ZodCatchInternals<T>;
2118
2128
 
2119
2129
  unwrap(): T;
@@ -2128,7 +2138,7 @@ export const ZodCatch: core.$constructor<ZodCatch> = /*@__PURE__*/ core.$constru
2128
2138
  inst.removeCatch = inst.unwrap;
2129
2139
  });
2130
2140
 
2131
- function _catch<T extends SomeType>(
2141
+ function _catch<T extends core.$ZodType>(
2132
2142
  innerType: T,
2133
2143
  catchValue: core.output<T> | ((ctx: core.$ZodCatchCtx) => core.output<T>),
2134
2144
  params?: core.$ZodCatchParams
@@ -2158,7 +2168,8 @@ export function nan(params?: string | core.$ZodNaNParams): ZodNaN {
2158
2168
  }
2159
2169
 
2160
2170
  // ZodPipe
2161
- export interface ZodPipe<A extends SomeType = SomeType, B extends SomeType = SomeType> extends ZodType {
2171
+ export interface ZodPipe<A extends core.$ZodType = core.$ZodType, B extends core.$ZodType = core.$ZodType>
2172
+ extends ZodType {
2162
2173
  _zod: core.$ZodPipeInternals<A, B>;
2163
2174
 
2164
2175
  in: A;
@@ -2186,7 +2197,7 @@ export function pipe(in_: core.$ZodType, out: core.$ZodType, params?: core.$ZodP
2186
2197
  }
2187
2198
 
2188
2199
  // ZodReadonly
2189
- export interface ZodReadonly<T extends SomeType = SomeType> extends ZodType {
2200
+ export interface ZodReadonly<T extends core.$ZodType = core.$ZodType> extends ZodType {
2190
2201
  _zod: core.$ZodReadonlyInternals<T>;
2191
2202
  }
2192
2203
  export const ZodReadonly: core.$constructor<ZodReadonly> = /*@__PURE__*/ core.$constructor(
@@ -2197,7 +2208,7 @@ export const ZodReadonly: core.$constructor<ZodReadonly> = /*@__PURE__*/ core.$c
2197
2208
  }
2198
2209
  );
2199
2210
 
2200
- export function readonly<T extends SomeType>(innerType: T, params?: core.$ZodReadonlyParams): ZodReadonly<T> {
2211
+ export function readonly<T extends core.$ZodType>(innerType: T, params?: core.$ZodReadonlyParams): ZodReadonly<T> {
2201
2212
  return new ZodReadonly({
2202
2213
  type: "readonly",
2203
2214
  innerType,
@@ -2229,7 +2240,7 @@ export function templateLiteral<const Parts extends core.$TemplateLiteralPart[]>
2229
2240
  }
2230
2241
 
2231
2242
  // ZodLazy
2232
- export interface ZodLazy<T extends SomeType = SomeType> extends ZodType {
2243
+ export interface ZodLazy<T extends core.$ZodType = core.$ZodType> extends ZodType {
2233
2244
  _zod: core.$ZodLazyInternals<T>;
2234
2245
 
2235
2246
  unwrap(): T;
@@ -2241,7 +2252,7 @@ export const ZodLazy: core.$constructor<ZodLazy> = /*@__PURE__*/ core.$construct
2241
2252
  inst.unwrap = () => inst._zod.def.getter();
2242
2253
  });
2243
2254
 
2244
- export function lazy<T extends SomeType>(getter: () => T): ZodLazy<T> {
2255
+ export function lazy<T extends core.$ZodType>(getter: () => T): ZodLazy<T> {
2245
2256
  return new ZodLazy({
2246
2257
  type: "lazy",
2247
2258
  getter,
@@ -2249,7 +2260,7 @@ export function lazy<T extends SomeType>(getter: () => T): ZodLazy<T> {
2249
2260
  }
2250
2261
 
2251
2262
  // ZodPromise
2252
- export interface ZodPromise<T extends SomeType = SomeType> extends ZodType {
2263
+ export interface ZodPromise<T extends core.$ZodType = core.$ZodType> extends ZodType {
2253
2264
  _zod: core.$ZodPromiseInternals<T>;
2254
2265
 
2255
2266
  unwrap(): T;
@@ -2261,7 +2272,7 @@ export const ZodPromise: core.$constructor<ZodPromise> = /*@__PURE__*/ core.$con
2261
2272
  inst.unwrap = () => inst._zod.def.innerType;
2262
2273
  });
2263
2274
 
2264
- export function promise<T extends SomeType>(innerType: T, params?: core.$ZodPromiseParams): ZodPromise<T> {
2275
+ export function promise<T extends core.$ZodType>(innerType: T, params?: core.$ZodPromiseParams): ZodPromise<T> {
2265
2276
  return new ZodPromise({
2266
2277
  type: "promise",
2267
2278
  innerType,