zod 3.25.40 → 3.25.42-beta.0

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.
@@ -29,7 +29,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
29
29
  return (mod && mod.__esModule) ? mod : { "default": mod };
30
30
  };
31
31
  Object.defineProperty(exports, "__esModule", { value: true });
32
- exports.locales = exports.toJSONSchema = exports.flattenError = exports.formatError = exports.prettifyError = exports.treeifyError = exports.regexes = exports.clone = exports.$brand = exports.$input = exports.$output = exports.function = exports.config = exports.registry = exports.globalRegistry = exports.core = void 0;
32
+ exports.coerce = exports.iso = exports.ZodISODuration = exports.ZodISOTime = exports.ZodISODate = exports.ZodISODateTime = exports.locales = exports.toJSONSchema = exports.flattenError = exports.formatError = exports.prettifyError = exports.treeifyError = exports.regexes = exports.clone = exports.$brand = exports.$input = exports.$output = exports.function = exports.config = exports.registry = exports.globalRegistry = exports.core = void 0;
33
33
  exports.core = __importStar(require("zod/v4/core"));
34
34
  __exportStar(require("./schemas.js"), exports);
35
35
  __exportStar(require("./checks.js"), exports);
@@ -55,4 +55,14 @@ Object.defineProperty(exports, "prettifyError", { enumerable: true, get: functio
55
55
  Object.defineProperty(exports, "formatError", { enumerable: true, get: function () { return core_2.formatError; } });
56
56
  Object.defineProperty(exports, "flattenError", { enumerable: true, get: function () { return core_2.flattenError; } });
57
57
  Object.defineProperty(exports, "toJSONSchema", { enumerable: true, get: function () { return core_2.toJSONSchema; } });
58
- Object.defineProperty(exports, "locales", { enumerable: true, get: function () { return core_2.locales; } });
58
+ exports.locales = __importStar(require("../locales/index.js"));
59
+ // iso
60
+ // must be exported from top-level
61
+ // https://github.com/colinhacks/zod/issues/4491
62
+ var iso_js_1 = require("./iso.js");
63
+ Object.defineProperty(exports, "ZodISODateTime", { enumerable: true, get: function () { return iso_js_1.ZodISODateTime; } });
64
+ Object.defineProperty(exports, "ZodISODate", { enumerable: true, get: function () { return iso_js_1.ZodISODate; } });
65
+ Object.defineProperty(exports, "ZodISOTime", { enumerable: true, get: function () { return iso_js_1.ZodISOTime; } });
66
+ Object.defineProperty(exports, "ZodISODuration", { enumerable: true, get: function () { return iso_js_1.ZodISODuration; } });
67
+ exports.iso = __importStar(require("./iso.js"));
68
+ exports.coerce = __importStar(require("./coerce.js"));
@@ -23,8 +23,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.ZodFile = exports.ZodLiteral = exports.ZodEnum = exports.ZodSet = exports.ZodMap = exports.ZodRecord = exports.ZodTuple = exports.ZodIntersection = exports.ZodDiscriminatedUnion = exports.ZodUnion = exports.ZodObject = 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._ZodString = exports.ZodType = exports.coerce = exports.iso = void 0;
27
- exports.stringbool = exports.ZodCustom = exports.ZodPromise = exports.ZodLazy = exports.ZodTemplateLiteral = exports.ZodReadonly = exports.ZodPipe = exports.ZodNaN = exports.ZodCatch = exports.ZodSuccess = exports.ZodNonOptional = exports.ZodPrefault = exports.ZodDefault = exports.ZodNullable = exports.ZodOptional = exports.ZodTransform = void 0;
26
+ exports.ZodOptional = exports.ZodTransform = exports.ZodFile = exports.ZodLiteral = exports.ZodEnum = exports.ZodSet = exports.ZodMap = exports.ZodRecord = exports.ZodTuple = exports.ZodIntersection = exports.ZodDiscriminatedUnion = exports.ZodUnion = exports.ZodObject = 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._ZodString = exports.ZodType = void 0;
27
+ exports.stringbool = exports.ZodCustom = exports.ZodPromise = exports.ZodLazy = exports.ZodTemplateLiteral = exports.ZodReadonly = exports.ZodPipe = exports.ZodNaN = exports.ZodCatch = exports.ZodSuccess = exports.ZodNonOptional = exports.ZodPrefault = exports.ZodDefault = exports.ZodNullable = void 0;
28
28
  exports.string = string;
29
29
  exports.email = email;
30
30
  exports.guid = guid;
@@ -110,8 +110,6 @@ const core_1 = require("zod/v4/core");
110
110
  const checks = __importStar(require("./checks.js"));
111
111
  const iso = __importStar(require("./iso.js"));
112
112
  const parse = __importStar(require("./parse.js"));
113
- exports.iso = __importStar(require("./iso.js"));
114
- exports.coerce = __importStar(require("./coerce.js"));
115
113
  exports.ZodType = core.$constructor("ZodType", (inst, def) => {
116
114
  core.$ZodType.init(inst, def);
117
115
  inst.def = def;
@@ -26,7 +26,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
26
26
  return result;
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.JSONSchema = exports.locales = exports.regexes = exports.util = void 0;
29
+ exports.JSONSchema = exports.regexes = exports.util = void 0;
30
30
  __exportStar(require("./core.js"), exports);
31
31
  __exportStar(require("./parse.js"), exports);
32
32
  __exportStar(require("./errors.js"), exports);
@@ -35,7 +35,6 @@ __exportStar(require("./checks.js"), exports);
35
35
  __exportStar(require("./versions.js"), exports);
36
36
  exports.util = __importStar(require("./util.js"));
37
37
  exports.regexes = __importStar(require("./regexes.js"));
38
- exports.locales = __importStar(require("../locales/index.js"));
39
38
  __exportStar(require("./registries.js"), exports);
40
39
  __exportStar(require("./doc.js"), exports);
41
40
  __exportStar(require("./function.js"), exports);
@@ -26,7 +26,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
26
26
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.locales = exports.toJSONSchema = exports.flattenError = exports.formatError = exports.prettifyError = exports.treeifyError = exports.regexes = exports.clone = exports.function = exports.$brand = exports.$input = exports.$output = exports.config = exports.registry = exports.globalRegistry = exports.core = void 0;
29
+ exports.coerce = exports.ZodMiniISODuration = exports.ZodMiniISOTime = exports.ZodMiniISODate = exports.ZodMiniISODateTime = exports.iso = exports.locales = exports.toJSONSchema = exports.flattenError = exports.formatError = exports.prettifyError = exports.treeifyError = exports.regexes = exports.clone = exports.function = exports.$brand = exports.$input = exports.$output = exports.config = exports.registry = exports.globalRegistry = exports.core = void 0;
30
30
  exports.core = __importStar(require("zod/v4/core"));
31
31
  __exportStar(require("./parse.js"), exports);
32
32
  __exportStar(require("./schemas.js"), exports);
@@ -46,6 +46,15 @@ Object.defineProperty(exports, "prettifyError", { enumerable: true, get: functio
46
46
  Object.defineProperty(exports, "formatError", { enumerable: true, get: function () { return core_1.formatError; } });
47
47
  Object.defineProperty(exports, "flattenError", { enumerable: true, get: function () { return core_1.flattenError; } });
48
48
  Object.defineProperty(exports, "toJSONSchema", { enumerable: true, get: function () { return core_1.toJSONSchema; } });
49
- Object.defineProperty(exports, "locales", { enumerable: true, get: function () { return core_1.locales; } });
49
+ exports.locales = __importStar(require("../locales/index.js"));
50
50
  /** A special constant with type `never` */
51
51
  // export const NEVER = {} as never;
52
+ // iso
53
+ exports.iso = __importStar(require("./iso.js"));
54
+ var iso_js_1 = require("./iso.js");
55
+ Object.defineProperty(exports, "ZodMiniISODateTime", { enumerable: true, get: function () { return iso_js_1.ZodMiniISODateTime; } });
56
+ Object.defineProperty(exports, "ZodMiniISODate", { enumerable: true, get: function () { return iso_js_1.ZodMiniISODate; } });
57
+ Object.defineProperty(exports, "ZodMiniISOTime", { enumerable: true, get: function () { return iso_js_1.ZodMiniISOTime; } });
58
+ Object.defineProperty(exports, "ZodMiniISODuration", { enumerable: true, get: function () { return iso_js_1.ZodMiniISODuration; } });
59
+ // coerce
60
+ exports.coerce = __importStar(require("./coerce.js"));
@@ -23,8 +23,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.ZodMiniTransform = exports.ZodMiniFile = exports.ZodMiniLiteral = exports.ZodMiniEnum = exports.ZodMiniSet = exports.ZodMiniMap = exports.ZodMiniRecord = exports.ZodMiniTuple = exports.ZodMiniIntersection = exports.ZodMiniDiscriminatedUnion = exports.ZodMiniUnion = exports.ZodMiniObject = exports.ZodMiniArray = exports.ZodMiniDate = exports.ZodMiniVoid = exports.ZodMiniNever = exports.ZodMiniUnknown = exports.ZodMiniAny = exports.ZodMiniNull = exports.ZodMiniUndefined = exports.ZodMiniSymbol = exports.ZodMiniBigIntFormat = exports.ZodMiniBigInt = exports.ZodMiniBoolean = exports.ZodMiniNumberFormat = exports.ZodMiniNumber = exports.ZodMiniJWT = exports.ZodMiniE164 = exports.ZodMiniBase64URL = exports.ZodMiniBase64 = exports.ZodMiniCIDRv6 = exports.ZodMiniCIDRv4 = exports.ZodMiniIPv6 = exports.ZodMiniIPv4 = exports.ZodMiniKSUID = exports.ZodMiniXID = exports.ZodMiniULID = exports.ZodMiniCUID2 = exports.ZodMiniCUID = exports.ZodMiniNanoID = exports.ZodMiniEmoji = exports.ZodMiniURL = exports.ZodMiniUUID = exports.ZodMiniGUID = exports.ZodMiniEmail = exports.ZodMiniStringFormat = exports.ZodMiniString = exports.ZodMiniType = exports.iso = exports.coerce = void 0;
27
- exports.stringbool = exports.ZodMiniCustom = exports.ZodMiniPromise = exports.ZodMiniLazy = exports.ZodMiniTemplateLiteral = exports.ZodMiniReadonly = exports.ZodMiniPipe = exports.ZodMiniNaN = exports.ZodMiniCatch = exports.ZodMiniSuccess = exports.ZodMiniNonOptional = exports.ZodMiniPrefault = exports.ZodMiniDefault = exports.ZodMiniNullable = exports.ZodMiniOptional = void 0;
26
+ exports.ZodMiniNullable = exports.ZodMiniOptional = exports.ZodMiniTransform = exports.ZodMiniFile = exports.ZodMiniLiteral = exports.ZodMiniEnum = exports.ZodMiniSet = exports.ZodMiniMap = exports.ZodMiniRecord = exports.ZodMiniTuple = exports.ZodMiniIntersection = exports.ZodMiniDiscriminatedUnion = exports.ZodMiniUnion = exports.ZodMiniObject = exports.ZodMiniArray = exports.ZodMiniDate = exports.ZodMiniVoid = exports.ZodMiniNever = exports.ZodMiniUnknown = exports.ZodMiniAny = exports.ZodMiniNull = exports.ZodMiniUndefined = exports.ZodMiniSymbol = exports.ZodMiniBigIntFormat = exports.ZodMiniBigInt = exports.ZodMiniBoolean = exports.ZodMiniNumberFormat = exports.ZodMiniNumber = exports.ZodMiniJWT = exports.ZodMiniE164 = exports.ZodMiniBase64URL = exports.ZodMiniBase64 = exports.ZodMiniCIDRv6 = exports.ZodMiniCIDRv4 = exports.ZodMiniIPv6 = exports.ZodMiniIPv4 = exports.ZodMiniKSUID = exports.ZodMiniXID = exports.ZodMiniULID = exports.ZodMiniCUID2 = exports.ZodMiniCUID = exports.ZodMiniNanoID = exports.ZodMiniEmoji = exports.ZodMiniURL = exports.ZodMiniUUID = exports.ZodMiniGUID = exports.ZodMiniEmail = exports.ZodMiniStringFormat = exports.ZodMiniString = exports.ZodMiniType = void 0;
27
+ exports.stringbool = exports.ZodMiniCustom = exports.ZodMiniPromise = exports.ZodMiniLazy = exports.ZodMiniTemplateLiteral = exports.ZodMiniReadonly = exports.ZodMiniPipe = exports.ZodMiniNaN = exports.ZodMiniCatch = exports.ZodMiniSuccess = exports.ZodMiniNonOptional = exports.ZodMiniPrefault = exports.ZodMiniDefault = void 0;
28
28
  exports.string = string;
29
29
  exports.email = email;
30
30
  exports.guid = guid;
@@ -112,8 +112,6 @@ exports.json = json;
112
112
  const core = __importStar(require("zod/v4/core"));
113
113
  const core_1 = require("zod/v4/core");
114
114
  const parse = __importStar(require("./parse.js"));
115
- exports.coerce = __importStar(require("./coerce.js"));
116
- exports.iso = __importStar(require("./iso.js"));
117
115
  exports.ZodMiniType = core.$constructor("ZodMiniType", (inst, def) => {
118
116
  if (!inst._zod)
119
117
  throw new Error("Uninitialized schema in mixin ZodMiniType.");
@@ -8,4 +8,11 @@ export * from "./compat.js";
8
8
  import { config } from "zod/v4/core";
9
9
  import en from "zod/v4/locales/en.js";
10
10
  config(en());
11
- export { globalRegistry, registry, config, function, $output, $input, $brand, clone, regexes, treeifyError, prettifyError, formatError, flattenError, toJSONSchema, locales, } from "zod/v4/core";
11
+ export { globalRegistry, registry, config, function, $output, $input, $brand, clone, regexes, treeifyError, prettifyError, formatError, flattenError, toJSONSchema, } from "zod/v4/core";
12
+ export * as locales from "../locales/index.js";
13
+ // iso
14
+ // must be exported from top-level
15
+ // https://github.com/colinhacks/zod/issues/4491
16
+ export { ZodISODateTime, ZodISODate, ZodISOTime, ZodISODuration } from "./iso.js";
17
+ export * as iso from "./iso.js";
18
+ export * as coerce from "./coerce.js";
@@ -3,8 +3,6 @@ import { util } from "zod/v4/core";
3
3
  import * as checks from "./checks.js";
4
4
  import * as iso from "./iso.js";
5
5
  import * as parse from "./parse.js";
6
- export * as iso from "./iso.js";
7
- export * as coerce from "./coerce.js";
8
6
  export const ZodType = /*@__PURE__*/ core.$constructor("ZodType", (inst, def) => {
9
7
  core.$ZodType.init(inst, def);
10
8
  inst.def = def;
@@ -6,7 +6,6 @@ export * from "./checks.js";
6
6
  export * from "./versions.js";
7
7
  export * as util from "./util.js";
8
8
  export * as regexes from "./regexes.js";
9
- export * as locales from "../locales/index.js";
10
9
  export * from "./registries.js";
11
10
  export * from "./doc.js";
12
11
  export * from "./function.js";
@@ -8,7 +8,7 @@ const Sizable = {
8
8
  function getSizing(origin) {
9
9
  return Sizable[origin] ?? null;
10
10
  }
11
- export const parsedType = (data) => {
11
+ export const parsedType = /* __PURE__ */ (data) => {
12
12
  const t = typeof data;
13
13
  switch (t) {
14
14
  case "number": {
@@ -2,6 +2,12 @@ export * as core from "zod/v4/core";
2
2
  export * from "./parse.js";
3
3
  export * from "./schemas.js";
4
4
  export * from "./checks.js";
5
- export { globalRegistry, registry, config, $output, $input, $brand, function, clone, regexes, treeifyError, prettifyError, formatError, flattenError, toJSONSchema, locales, } from "zod/v4/core";
5
+ export { globalRegistry, registry, config, $output, $input, $brand, function, clone, regexes, treeifyError, prettifyError, formatError, flattenError, toJSONSchema, } from "zod/v4/core";
6
+ export * as locales from "../locales/index.js";
6
7
  /** A special constant with type `never` */
7
8
  // export const NEVER = {} as never;
9
+ // iso
10
+ export * as iso from "./iso.js";
11
+ export { ZodMiniISODateTime, ZodMiniISODate, ZodMiniISOTime, ZodMiniISODuration, } from "./iso.js";
12
+ // coerce
13
+ export * as coerce from "./coerce.js";
@@ -1,8 +1,6 @@
1
1
  import * as core from "zod/v4/core";
2
2
  import { util } from "zod/v4/core";
3
3
  import * as parse from "./parse.js";
4
- export * as coerce from "./coerce.js";
5
- export * as iso from "./iso.js";
6
4
  export const ZodMiniType = /*@__PURE__*/ core.$constructor("ZodMiniType", (inst, def) => {
7
5
  if (!inst._zod)
8
6
  throw new Error("Uninitialized schema in mixin ZodMiniType.");
@@ -5,4 +5,9 @@ export * from "./errors.js";
5
5
  export * from "./parse.js";
6
6
  export * from "./compat.js";
7
7
  export type { infer, output, input } from "zod/v4/core";
8
- export { globalRegistry, type GlobalMeta, registry, config, function, $output, $input, $brand, clone, regexes, treeifyError, prettifyError, formatError, flattenError, toJSONSchema, locales, } from "zod/v4/core";
8
+ export { globalRegistry, type GlobalMeta, registry, config, function, $output, $input, $brand, clone, regexes, treeifyError, prettifyError, formatError, flattenError, toJSONSchema, } from "zod/v4/core";
9
+ export * as locales from "../locales/index.js";
10
+ export { ZodISODateTime, ZodISODate, ZodISOTime, ZodISODuration } from "./iso.js";
11
+ export * as iso from "./iso.js";
12
+ export type { ZodCoercedString, ZodCoercedNumber, ZodCoercedBigInt, ZodCoercedBoolean, ZodCoercedDate, } from "./coerce.js";
13
+ export * as coerce from "./coerce.js";
@@ -1,8 +1,6 @@
1
1
  import * as core from "zod/v4/core";
2
2
  import { util } from "zod/v4/core";
3
3
  import * as parse from "./parse.js";
4
- export * as iso from "./iso.js";
5
- export * as coerce from "./coerce.js";
6
4
  export interface RefinementCtx<T = unknown> extends core.ParsePayload<T> {
7
5
  addIssue(arg: string | core.$ZodRawIssue | Partial<core.$ZodIssueCustom>): void;
8
6
  }
@@ -6,7 +6,6 @@ export * from "./checks.js";
6
6
  export * from "./versions.js";
7
7
  export * as util from "./util.js";
8
8
  export * as regexes from "./regexes.js";
9
- export * as locales from "../locales/index.js";
10
9
  export * from "./registries.js";
11
10
  export * from "./doc.js";
12
11
  export * from "./function.js";
@@ -3,5 +3,9 @@ export * from "./parse.js";
3
3
  export * from "./schemas.js";
4
4
  export * from "./checks.js";
5
5
  export type { infer, output, input } from "zod/v4/core";
6
- export { globalRegistry, registry, config, $output, $input, $brand, function, clone, regexes, treeifyError, prettifyError, formatError, flattenError, toJSONSchema, locales, } from "zod/v4/core";
6
+ export { globalRegistry, registry, config, $output, $input, $brand, function, clone, regexes, treeifyError, prettifyError, formatError, flattenError, toJSONSchema, } from "zod/v4/core";
7
+ export * as locales from "../locales/index.js";
7
8
  /** A special constant with type `never` */
9
+ export * as iso from "./iso.js";
10
+ export { ZodMiniISODateTime, ZodMiniISODate, ZodMiniISOTime, ZodMiniISODuration, } from "./iso.js";
11
+ export * as coerce from "./coerce.js";
@@ -1,7 +1,5 @@
1
1
  import * as core from "zod/v4/core";
2
2
  import { util } from "zod/v4/core";
3
- export * as coerce from "./coerce.js";
4
- export * as iso from "./iso.js";
5
3
  type SomeType = core.$ZodType;
6
4
  export interface ZodMiniType<out Output = unknown, out Input = unknown> extends core.$ZodType<Output, Input> {
7
5
  check(...checks: (core.CheckFn<this["_zod"]["output"]> | core.$ZodCheck<this["_zod"]["output"]>)[]): this;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zod",
3
- "version": "3.25.40",
3
+ "version": "3.25.42-beta.0",
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",