zod 4.5.4 → 4.6.1

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.
Files changed (359) hide show
  1. package/compile.cjs +19 -0
  2. package/index.cjs +19 -0
  3. package/locales/index.cjs +19 -0
  4. package/mini/index.cjs +19 -0
  5. package/package.json +8 -7
  6. package/src/v3/helpers/errorUtil.ts +1 -1
  7. package/src/v4/classic/checks.ts +0 -1
  8. package/src/v4/classic/external.ts +2 -0
  9. package/src/v4/classic/from-json-schema.ts +248 -25
  10. package/src/v4/classic/schemas.ts +255 -164
  11. package/src/v4/classic/tests/assignability.test.ts +59 -9
  12. package/src/v4/classic/tests/bigint.test.ts +6 -0
  13. package/src/v4/classic/tests/continuability.test.ts +2 -2
  14. package/src/v4/classic/tests/cyclic-data.test.ts +274 -0
  15. package/src/v4/classic/tests/discriminated-unions.test.ts +112 -6
  16. package/src/v4/classic/tests/enum.test.ts +9 -0
  17. package/src/v4/classic/tests/error.test.ts +130 -1
  18. package/src/v4/classic/tests/firstparty.test.ts +4 -0
  19. package/src/v4/classic/tests/from-json-schema.test.ts +157 -0
  20. package/src/v4/classic/tests/iban.test.ts +81 -0
  21. package/src/v4/classic/tests/instance-footprint.test.ts +18 -2
  22. package/src/v4/classic/tests/instanceof.test.ts +27 -7
  23. package/src/v4/classic/tests/issue-schema.test.ts +88 -56
  24. package/src/v4/classic/tests/object.test.ts +56 -0
  25. package/src/v4/classic/tests/optin-ladder.test.ts +3 -2
  26. package/src/v4/classic/tests/properties.test.ts +225 -0
  27. package/src/v4/classic/tests/recursive-types.test.ts +46 -1
  28. package/src/v4/classic/tests/standard-schema.test.ts +19 -0
  29. package/src/v4/classic/tests/string.test.ts +25 -0
  30. package/src/v4/classic/tests/template-literal.test.ts +33 -1
  31. package/src/v4/classic/tests/to-json-schema.test.ts +147 -3
  32. package/src/v4/classic/tests/validate.test.ts +569 -0
  33. package/src/v4/core/api.ts +30 -6
  34. package/src/v4/core/checks.ts +1 -101
  35. package/src/v4/core/compile.ts +194 -82
  36. package/src/v4/core/doc.ts +6 -2
  37. package/src/v4/core/errors.ts +3 -6
  38. package/src/v4/core/json-schema-generator.ts +2 -2
  39. package/src/v4/core/json-schema-processors.ts +226 -68
  40. package/src/v4/core/memoizer.ts +78 -28
  41. package/src/v4/core/parse.ts +37 -16
  42. package/src/v4/core/regexes.ts +10 -4
  43. package/src/v4/core/schemas.ts +350 -113
  44. package/src/v4/core/tests/cached.test.ts +54 -0
  45. package/src/v4/core/tests/compile-generative.test.ts +445 -0
  46. package/src/v4/core/tests/compile.test.ts +222 -2
  47. package/src/v4/core/tests/email-regex.test.ts +140 -0
  48. package/src/v4/core/tests/locales/tg.test.ts +85 -0
  49. package/src/v4/core/tests/polyfill-collision.test.ts +46 -0
  50. package/src/v4/core/to-json-schema.ts +10 -8
  51. package/src/v4/core/util.ts +222 -147
  52. package/src/v4/core/versions.ts +2 -2
  53. package/src/v4/core/visit.ts +11 -0
  54. package/src/v4/locales/ar.ts +1 -0
  55. package/src/v4/locales/az.ts +1 -0
  56. package/src/v4/locales/be.ts +1 -0
  57. package/src/v4/locales/bg.ts +1 -0
  58. package/src/v4/locales/bn.ts +1 -0
  59. package/src/v4/locales/ca.ts +1 -0
  60. package/src/v4/locales/ckb.ts +1 -0
  61. package/src/v4/locales/cs.ts +1 -0
  62. package/src/v4/locales/da.ts +1 -0
  63. package/src/v4/locales/de.ts +1 -0
  64. package/src/v4/locales/el.ts +1 -0
  65. package/src/v4/locales/en.ts +1 -0
  66. package/src/v4/locales/eo.ts +1 -0
  67. package/src/v4/locales/es.ts +1 -0
  68. package/src/v4/locales/fa.ts +1 -0
  69. package/src/v4/locales/fi.ts +1 -0
  70. package/src/v4/locales/fr-CA.ts +1 -0
  71. package/src/v4/locales/fr.ts +1 -0
  72. package/src/v4/locales/gu.ts +1 -0
  73. package/src/v4/locales/he.ts +1 -0
  74. package/src/v4/locales/hi.ts +1 -0
  75. package/src/v4/locales/hr.ts +1 -0
  76. package/src/v4/locales/hu.ts +1 -0
  77. package/src/v4/locales/hy.ts +1 -0
  78. package/src/v4/locales/id.ts +1 -0
  79. package/src/v4/locales/index.ts +1 -0
  80. package/src/v4/locales/is.ts +1 -0
  81. package/src/v4/locales/it.ts +1 -0
  82. package/src/v4/locales/ja.ts +1 -0
  83. package/src/v4/locales/ka.ts +1 -0
  84. package/src/v4/locales/km.ts +1 -0
  85. package/src/v4/locales/kn.ts +1 -0
  86. package/src/v4/locales/ko.ts +1 -0
  87. package/src/v4/locales/lt.ts +1 -0
  88. package/src/v4/locales/mk.ts +1 -0
  89. package/src/v4/locales/ms.ts +1 -0
  90. package/src/v4/locales/ne.ts +1 -0
  91. package/src/v4/locales/nl.ts +1 -0
  92. package/src/v4/locales/nn.ts +1 -0
  93. package/src/v4/locales/no.ts +1 -0
  94. package/src/v4/locales/ota.ts +1 -0
  95. package/src/v4/locales/pl.ts +1 -0
  96. package/src/v4/locales/ps.ts +1 -0
  97. package/src/v4/locales/pt-BR.ts +1 -0
  98. package/src/v4/locales/pt.ts +1 -0
  99. package/src/v4/locales/ro.ts +1 -0
  100. package/src/v4/locales/ru.ts +1 -0
  101. package/src/v4/locales/sk.ts +1 -0
  102. package/src/v4/locales/sl.ts +1 -0
  103. package/src/v4/locales/sv.ts +1 -0
  104. package/src/v4/locales/ta.ts +1 -0
  105. package/src/v4/locales/tg.ts +134 -0
  106. package/src/v4/locales/th.ts +1 -0
  107. package/src/v4/locales/tk.ts +1 -0
  108. package/src/v4/locales/tr.ts +1 -0
  109. package/src/v4/locales/uk.ts +1 -0
  110. package/src/v4/locales/ur.ts +1 -0
  111. package/src/v4/locales/uz.ts +1 -0
  112. package/src/v4/locales/vi.ts +1 -0
  113. package/src/v4/locales/yo.ts +1 -0
  114. package/src/v4/locales/zh-CN.ts +1 -0
  115. package/src/v4/locales/zh-TW.ts +1 -0
  116. package/src/v4/mini/checks.ts +0 -1
  117. package/src/v4/mini/external.ts +2 -0
  118. package/src/v4/mini/schemas.ts +38 -2
  119. package/src/v4/mini/tests/checks.test.ts +1 -1
  120. package/src/v4/mini/tests/computed.test.ts +11 -17
  121. package/src/v4/mini/tests/index.test.ts +8 -0
  122. package/src/v4/mini/tests/recursive-types.test.ts +16 -0
  123. package/src/v4/mini/tests/string.test.ts +16 -0
  124. package/v3/ZodError.cjs +19 -0
  125. package/v3/errors.cjs +19 -0
  126. package/v3/external.cjs +19 -0
  127. package/v3/helpers/enumUtil.cjs +19 -0
  128. package/v3/helpers/errorUtil.cjs +20 -1
  129. package/v3/helpers/errorUtil.js +1 -1
  130. package/v3/helpers/parseUtil.cjs +19 -0
  131. package/v3/helpers/partialUtil.cjs +19 -0
  132. package/v3/helpers/typeAliases.cjs +19 -0
  133. package/v3/helpers/util.cjs +19 -0
  134. package/v3/index.cjs +19 -0
  135. package/v3/standard-schema.cjs +19 -0
  136. package/v3/types.cjs +19 -0
  137. package/v4/classic/checks.cjs +20 -2
  138. package/v4/classic/checks.d.cts +1 -1
  139. package/v4/classic/checks.d.ts +1 -1
  140. package/v4/classic/checks.js +1 -1
  141. package/v4/classic/coerce.cjs +19 -0
  142. package/v4/classic/compat.cjs +19 -0
  143. package/v4/classic/deep-partial.cjs +19 -0
  144. package/v4/classic/errors.cjs +19 -0
  145. package/v4/classic/external.cjs +22 -1
  146. package/v4/classic/external.d.cts +1 -1
  147. package/v4/classic/external.d.ts +1 -1
  148. package/v4/classic/external.js +1 -1
  149. package/v4/classic/from-json-schema.cjs +264 -24
  150. package/v4/classic/from-json-schema.js +245 -24
  151. package/v4/classic/in-out.cjs +19 -0
  152. package/v4/classic/index.cjs +19 -0
  153. package/v4/classic/iso.cjs +19 -0
  154. package/v4/classic/parse.cjs +19 -0
  155. package/v4/classic/schemas.cjs +100 -31
  156. package/v4/classic/schemas.d.cts +17 -1
  157. package/v4/classic/schemas.d.ts +17 -1
  158. package/v4/classic/schemas.js +77 -29
  159. package/v4/core/api.cjs +37 -2
  160. package/v4/core/api.d.cts +6 -4
  161. package/v4/core/api.d.ts +6 -4
  162. package/v4/core/api.js +17 -2
  163. package/v4/core/checks.cjs +19 -96
  164. package/v4/core/checks.d.cts +1 -1
  165. package/v4/core/checks.d.ts +1 -1
  166. package/v4/core/checks.js +0 -96
  167. package/v4/core/compile.cjs +165 -66
  168. package/v4/core/compile.d.cts +18 -4
  169. package/v4/core/compile.d.ts +18 -4
  170. package/v4/core/compile.js +146 -67
  171. package/v4/core/core.cjs +19 -0
  172. package/v4/core/doc.cjs +26 -2
  173. package/v4/core/doc.js +7 -2
  174. package/v4/core/errors.cjs +21 -5
  175. package/v4/core/errors.js +2 -5
  176. package/v4/core/index.cjs +19 -0
  177. package/v4/core/json-schema-generator.cjs +20 -1
  178. package/v4/core/json-schema-generator.js +2 -2
  179. package/v4/core/json-schema-processors.cjs +215 -63
  180. package/v4/core/json-schema-processors.d.cts +17 -0
  181. package/v4/core/json-schema-processors.d.ts +17 -0
  182. package/v4/core/json-schema-processors.js +195 -64
  183. package/v4/core/json-schema.cjs +19 -0
  184. package/v4/core/memoizer.cjs +114 -23
  185. package/v4/core/memoizer.js +72 -23
  186. package/v4/core/parse.cjs +56 -16
  187. package/v4/core/parse.js +37 -16
  188. package/v4/core/regexes.cjs +29 -6
  189. package/v4/core/regexes.d.cts +2 -0
  190. package/v4/core/regexes.d.ts +2 -0
  191. package/v4/core/regexes.js +8 -4
  192. package/v4/core/registries.cjs +19 -0
  193. package/v4/core/schemas.cjs +322 -95
  194. package/v4/core/schemas.d.cts +42 -7
  195. package/v4/core/schemas.d.ts +42 -7
  196. package/v4/core/schemas.js +301 -94
  197. package/v4/core/standard-schema.cjs +19 -0
  198. package/v4/core/to-json-schema.cjs +29 -7
  199. package/v4/core/to-json-schema.d.cts +7 -3
  200. package/v4/core/to-json-schema.d.ts +7 -3
  201. package/v4/core/to-json-schema.js +8 -7
  202. package/v4/core/util.cjs +181 -143
  203. package/v4/core/util.d.cts +25 -4
  204. package/v4/core/util.d.ts +25 -4
  205. package/v4/core/util.js +160 -143
  206. package/v4/core/versions.cjs +21 -2
  207. package/v4/core/versions.d.cts +1 -1
  208. package/v4/core/versions.d.ts +1 -1
  209. package/v4/core/versions.js +2 -2
  210. package/v4/core/visit.cjs +31 -0
  211. package/v4/core/visit.js +12 -0
  212. package/v4/index.cjs +19 -0
  213. package/v4/locales/ar.cjs +1 -0
  214. package/v4/locales/ar.js +1 -0
  215. package/v4/locales/az.cjs +1 -0
  216. package/v4/locales/az.js +1 -0
  217. package/v4/locales/be.cjs +1 -0
  218. package/v4/locales/be.js +1 -0
  219. package/v4/locales/bg.cjs +1 -0
  220. package/v4/locales/bg.js +1 -0
  221. package/v4/locales/bn.cjs +1 -0
  222. package/v4/locales/bn.js +1 -0
  223. package/v4/locales/ca.cjs +1 -0
  224. package/v4/locales/ca.js +1 -0
  225. package/v4/locales/ckb.cjs +1 -0
  226. package/v4/locales/ckb.js +1 -0
  227. package/v4/locales/cs.cjs +1 -0
  228. package/v4/locales/cs.js +1 -0
  229. package/v4/locales/da.cjs +1 -0
  230. package/v4/locales/da.js +1 -0
  231. package/v4/locales/de.cjs +1 -0
  232. package/v4/locales/de.js +1 -0
  233. package/v4/locales/el.cjs +1 -0
  234. package/v4/locales/el.js +1 -0
  235. package/v4/locales/en.cjs +1 -0
  236. package/v4/locales/en.js +1 -0
  237. package/v4/locales/eo.cjs +1 -0
  238. package/v4/locales/eo.js +1 -0
  239. package/v4/locales/es.cjs +1 -0
  240. package/v4/locales/es.js +1 -0
  241. package/v4/locales/fa.cjs +1 -0
  242. package/v4/locales/fa.js +1 -0
  243. package/v4/locales/fi.cjs +1 -0
  244. package/v4/locales/fi.js +1 -0
  245. package/v4/locales/fr-CA.cjs +1 -0
  246. package/v4/locales/fr-CA.js +1 -0
  247. package/v4/locales/fr.cjs +1 -0
  248. package/v4/locales/fr.js +1 -0
  249. package/v4/locales/gu.cjs +1 -0
  250. package/v4/locales/gu.js +1 -0
  251. package/v4/locales/he.cjs +1 -0
  252. package/v4/locales/he.js +1 -0
  253. package/v4/locales/hi.cjs +1 -0
  254. package/v4/locales/hi.js +1 -0
  255. package/v4/locales/hr.cjs +1 -0
  256. package/v4/locales/hr.js +1 -0
  257. package/v4/locales/hu.cjs +1 -0
  258. package/v4/locales/hu.js +1 -0
  259. package/v4/locales/hy.cjs +1 -0
  260. package/v4/locales/hy.js +1 -0
  261. package/v4/locales/id.cjs +1 -0
  262. package/v4/locales/id.js +1 -0
  263. package/v4/locales/index.cjs +22 -1
  264. package/v4/locales/index.d.cts +1 -0
  265. package/v4/locales/index.d.ts +1 -0
  266. package/v4/locales/index.js +1 -0
  267. package/v4/locales/is.cjs +1 -0
  268. package/v4/locales/is.js +1 -0
  269. package/v4/locales/it.cjs +1 -0
  270. package/v4/locales/it.js +1 -0
  271. package/v4/locales/ja.cjs +1 -0
  272. package/v4/locales/ja.js +1 -0
  273. package/v4/locales/ka.cjs +1 -0
  274. package/v4/locales/ka.js +1 -0
  275. package/v4/locales/km.cjs +1 -0
  276. package/v4/locales/km.js +1 -0
  277. package/v4/locales/kn.cjs +1 -0
  278. package/v4/locales/kn.js +1 -0
  279. package/v4/locales/ko.cjs +1 -0
  280. package/v4/locales/ko.js +1 -0
  281. package/v4/locales/lt.cjs +1 -0
  282. package/v4/locales/lt.js +1 -0
  283. package/v4/locales/mk.cjs +1 -0
  284. package/v4/locales/mk.js +1 -0
  285. package/v4/locales/ms.cjs +1 -0
  286. package/v4/locales/ms.js +1 -0
  287. package/v4/locales/ne.cjs +1 -0
  288. package/v4/locales/ne.js +1 -0
  289. package/v4/locales/nl.cjs +1 -0
  290. package/v4/locales/nl.js +1 -0
  291. package/v4/locales/nn.cjs +1 -0
  292. package/v4/locales/nn.js +1 -0
  293. package/v4/locales/no.cjs +1 -0
  294. package/v4/locales/no.js +1 -0
  295. package/v4/locales/ota.cjs +1 -0
  296. package/v4/locales/ota.js +1 -0
  297. package/v4/locales/pl.cjs +1 -0
  298. package/v4/locales/pl.js +1 -0
  299. package/v4/locales/ps.cjs +1 -0
  300. package/v4/locales/ps.js +1 -0
  301. package/v4/locales/pt-BR.cjs +1 -0
  302. package/v4/locales/pt-BR.js +1 -0
  303. package/v4/locales/pt.cjs +1 -0
  304. package/v4/locales/pt.js +1 -0
  305. package/v4/locales/ro.cjs +1 -0
  306. package/v4/locales/ro.js +1 -0
  307. package/v4/locales/ru.cjs +1 -0
  308. package/v4/locales/ru.js +1 -0
  309. package/v4/locales/sk.cjs +1 -0
  310. package/v4/locales/sk.js +1 -0
  311. package/v4/locales/sl.cjs +1 -0
  312. package/v4/locales/sl.js +1 -0
  313. package/v4/locales/sv.cjs +1 -0
  314. package/v4/locales/sv.js +1 -0
  315. package/v4/locales/ta.cjs +1 -0
  316. package/v4/locales/ta.js +1 -0
  317. package/v4/locales/tg.cjs +143 -0
  318. package/v4/locales/tg.d.cts +5 -0
  319. package/v4/locales/tg.d.ts +4 -0
  320. package/v4/locales/tg.js +116 -0
  321. package/v4/locales/th.cjs +1 -0
  322. package/v4/locales/th.js +1 -0
  323. package/v4/locales/tk.cjs +1 -0
  324. package/v4/locales/tk.js +1 -0
  325. package/v4/locales/tr.cjs +1 -0
  326. package/v4/locales/tr.js +1 -0
  327. package/v4/locales/uk.cjs +1 -0
  328. package/v4/locales/uk.js +1 -0
  329. package/v4/locales/ur.cjs +1 -0
  330. package/v4/locales/ur.js +1 -0
  331. package/v4/locales/uz.cjs +1 -0
  332. package/v4/locales/uz.js +1 -0
  333. package/v4/locales/vi.cjs +1 -0
  334. package/v4/locales/vi.js +1 -0
  335. package/v4/locales/yo.cjs +1 -0
  336. package/v4/locales/yo.js +1 -0
  337. package/v4/locales/zh-CN.cjs +1 -0
  338. package/v4/locales/zh-CN.js +1 -0
  339. package/v4/locales/zh-TW.cjs +1 -0
  340. package/v4/locales/zh-TW.js +1 -0
  341. package/v4/mini/checks.cjs +20 -2
  342. package/v4/mini/checks.d.cts +1 -1
  343. package/v4/mini/checks.d.ts +1 -1
  344. package/v4/mini/checks.js +1 -1
  345. package/v4/mini/coerce.cjs +19 -0
  346. package/v4/mini/deep-partial.cjs +19 -0
  347. package/v4/mini/external.cjs +22 -1
  348. package/v4/mini/external.d.cts +1 -1
  349. package/v4/mini/external.d.ts +1 -1
  350. package/v4/mini/external.js +1 -1
  351. package/v4/mini/in-out.cjs +19 -0
  352. package/v4/mini/index.cjs +19 -0
  353. package/v4/mini/iso.cjs +19 -0
  354. package/v4/mini/parse.cjs +19 -0
  355. package/v4/mini/schemas.cjs +42 -4
  356. package/v4/mini/schemas.d.cts +8 -0
  357. package/v4/mini/schemas.d.ts +8 -0
  358. package/v4/mini/schemas.js +19 -2
  359. package/v4-mini/index.cjs +19 -0
@@ -21,6 +21,8 @@ export interface ParseContextInternal<T extends errors.$ZodIssueBase = never> ex
21
21
  readonly async?: boolean | undefined;
22
22
  readonly direction?: "forward" | "backward";
23
23
  readonly skipChecks?: boolean;
24
+ /** Set only by `validate`/`validateAsync`. A container may stop before its next child, never inside one, so a map entry and a tuple's fixed items parse whole. */
25
+ readonly abortEarly?: boolean;
24
26
  }
25
27
  /** Gives a container cycle support: `attach` wraps its parse, and `alloc` registers the object it builds into before any child is parsed so a reference back to the same input resolves to it. */
26
28
  export interface $ZodMemoizer {
@@ -39,7 +41,7 @@ export interface ParsePayload<T = unknown> {
39
41
  }
40
42
  export type CheckFn<T> = (input: ParsePayload<T>) => util.MaybeAsync<void>;
41
43
  export interface $ZodTypeDef {
42
- type: "string" | "number" | "int" | "boolean" | "bigint" | "symbol" | "null" | "undefined" | "void" | "never" | "any" | "unknown" | "date" | "object" | "record" | "file" | "array" | "tuple" | "union" | "intersection" | "map" | "set" | "enum" | "literal" | "nullable" | "optional" | "nonoptional" | "success" | "transform" | "default" | "prefault" | "catch" | "nan" | "pipe" | "readonly" | "template_literal" | "promise" | "lazy" | "function" | "custom";
44
+ type: "string" | "number" | "int" | "boolean" | "bigint" | "symbol" | "null" | "undefined" | "void" | "never" | "any" | "unknown" | "date" | "object" | "record" | "file" | "array" | "tuple" | "union" | "intersection" | "map" | "set" | "enum" | "literal" | "nullable" | "optional" | "nonoptional" | "success" | "transform" | "default" | "prefault" | "catch" | "nan" | "pipe" | "readonly" | "template_literal" | "promise" | "lazy" | "function" | "custom" | "properties";
43
45
  error?: errors.$ZodErrorMap<never> | undefined;
44
46
  checks?: checks.$ZodCheck<never>[];
45
47
  }
@@ -371,7 +373,9 @@ export interface $ZodBase64Internals extends $ZodStringFormatInternals<"base64">
371
373
  export interface $ZodBase64 extends $ZodType {
372
374
  _zod: $ZodBase64Internals;
373
375
  }
376
+ export declare const base64Charset: RegExp;
374
377
  export declare const $ZodBase64: core.$constructor<$ZodBase64>;
378
+ export declare const base64urlCharset: RegExp;
375
379
  export declare function isValidBase64URL(data: string): boolean;
376
380
  export interface $ZodBase64URLDef extends $ZodStringFormatDef<"base64url"> {
377
381
  }
@@ -399,6 +403,16 @@ export interface $ZodCreditCard extends $ZodType {
399
403
  _zod: $ZodCreditCardInternals;
400
404
  }
401
405
  export declare const $ZodCreditCard: core.$constructor<$ZodCreditCard>;
406
+ export declare function isValidIBAN(input: string): boolean;
407
+ export interface $ZodIBANDef extends $ZodStringFormatDef<"iban"> {
408
+ }
409
+ export interface $ZodIBANInternals extends $ZodStringFormatInternals<"iban"> {
410
+ def: $ZodIBANDef;
411
+ }
412
+ export interface $ZodIBAN extends $ZodType {
413
+ _zod: $ZodIBANInternals;
414
+ }
415
+ export declare const $ZodIBAN: core.$constructor<$ZodIBAN>;
402
416
  export declare function isValidJWT(token: string, algorithm?: util.JWTAlgorithm | null): boolean;
403
417
  export interface $ZodJWTDef extends $ZodStringFormatDef<"jwt"> {
404
418
  alg?: util.JWTAlgorithm | undefined;
@@ -617,12 +631,16 @@ type OptionalInSchema = {
617
631
  optin: "optional" | "defaulted";
618
632
  };
619
633
  };
620
- export type $InferObjectOutput<T extends $ZodLooseShape, Extra extends Record<string, unknown>> = string extends keyof T ? util.IsAny<T[keyof T]> extends true ? Record<string, unknown> : Record<string, core.output<T[keyof T]>> : keyof (T & Extra) extends never ? Record<string, never> : util.Prettify<{
634
+ export type $InferObjectOutput<T extends $ZodLooseShape, Extra extends Record<string, unknown>> = string extends keyof T ? util.IsAny<T[keyof T]> extends true ? Record<string, unknown> : {
635
+ [k in string]: core.output<T[keyof T]>;
636
+ } : keyof (T & Extra) extends never ? Record<string, never> : util.Prettify<{
621
637
  -readonly [k in keyof T as T[k] extends OptionalOutSchema ? never : k]: T[k]["_zod"]["output"];
622
638
  } & {
623
639
  -readonly [k in keyof T as T[k] extends OptionalOutSchema ? k : never]?: T[k]["_zod"]["output"];
624
640
  } & Extra>;
625
- export type $InferObjectInput<T extends $ZodLooseShape, Extra extends Record<string, unknown>> = string extends keyof T ? util.IsAny<T[keyof T]> extends true ? Record<string, unknown> : Record<string, core.input<T[keyof T]>> : keyof (T & Extra) extends never ? Record<string, never> : util.Prettify<{
641
+ export type $InferObjectInput<T extends $ZodLooseShape, Extra extends Record<string, unknown>> = string extends keyof T ? util.IsAny<T[keyof T]> extends true ? Record<string, unknown> : {
642
+ [k in string]: core.input<T[keyof T]>;
643
+ } : keyof (T & Extra) extends never ? Record<string, never> : util.Prettify<{
626
644
  -readonly [k in keyof T as T[k] extends OptionalInSchema ? never : k]: T[k]["_zod"]["input"];
627
645
  } & {
628
646
  -readonly [k in keyof T as T[k] extends OptionalInSchema ? k : never]?: T[k]["_zod"]["input"];
@@ -715,7 +733,7 @@ export interface $ZodDiscriminatedUnionInternals<Options extends readonly SomeTy
715
733
  def: $ZodDiscriminatedUnionDef<Options, Disc>;
716
734
  propValues: util.PropValues;
717
735
  bag: util.LoosePartial<{
718
- optionsMap: Map<util.Primitive, $ZodType>;
736
+ optionsMap: Map<util.Primitive, $ZodType | null>;
719
737
  }>;
720
738
  }
721
739
  /** The discriminator values a member of `Options` can declare. An omittable discriminator contributes `undefined`, matching what `propValues` claims for it. */
@@ -734,7 +752,7 @@ export type $DiscriminatedOption<Options extends readonly SomeType[], Disc exten
734
752
  };
735
753
  } ? Disc extends keyof Out ? V extends Out[Disc] ? Options[I] : never : never : never;
736
754
  }[number];
737
- /** Returns the option of `union` whose discriminator claims `value`. */
755
+ /** Returns the option whose discriminator claims `value`, or throws if ambiguous. */
738
756
  export declare function getDiscriminatedOption<Options extends readonly SomeType[], Disc extends string, const V extends $DiscriminatorValue<Options, Disc>>(union: $ZodDiscriminatedUnion<Options, Disc>, value: V): $DiscriminatedOption<Options, Disc, V>;
739
757
  export interface $ZodDiscriminatedUnion<Options extends readonly SomeType[] = readonly $ZodType[], Disc extends string = string> extends $ZodType {
740
758
  _zod: $ZodDiscriminatedUnionInternals<Options, Disc>;
@@ -1249,5 +1267,22 @@ export interface $ZodCustom<O = unknown, I = unknown> extends $ZodType {
1249
1267
  _zod: $ZodCustomInternals<O, I>;
1250
1268
  }
1251
1269
  export declare const $ZodCustom: core.$constructor<$ZodCustom>;
1252
- export type $ZodTypes = $ZodString | $ZodNumber | $ZodBigInt | $ZodBoolean | $ZodDate | $ZodSymbol | $ZodUndefined | $ZodNullable | $ZodNull | $ZodAny | $ZodUnknown | $ZodNever | $ZodVoid | $ZodArray | $ZodObject | $ZodUnion | $ZodIntersection | $ZodTuple | $ZodRecord | $ZodMap | $ZodSet | $ZodLiteral | $ZodEnum | $ZodFunction | $ZodPromise | $ZodLazy | $ZodOptional | $ZodDefault | $ZodPrefault | $ZodTemplateLiteral | $ZodCustom | $ZodTransform | $ZodNonOptional | $ZodReadonly | $ZodNaN | $ZodPipe | $ZodSuccess | $ZodCatch | $ZodFile;
1253
- export type $ZodStringFormatTypes = $ZodGUID | $ZodUUID | $ZodEmail | $ZodURL | $ZodEmoji | $ZodNanoID | $ZodCUID | $ZodCUID2 | $ZodULID | $ZodXID | $ZodKSUID | $ZodISODateTime | $ZodISODate | $ZodISOTime | $ZodISODuration | $ZodIPv4 | $ZodIPv6 | $ZodMAC | $ZodCIDRv4 | $ZodCIDRv6 | $ZodBase64 | $ZodBase64URL | $ZodE164 | $ZodCreditCard | $ZodJWT | $ZodCustomStringFormat<"hex"> | $ZodCustomStringFormat<util.HashFormat> | $ZodCustomStringFormat<"hostname">;
1270
+ export interface $ZodPropertiesDef<Shape extends $ZodShape = $ZodShape> extends $ZodTypeDef, checks.$ZodCheckDef {
1271
+ type: "properties";
1272
+ check: "properties";
1273
+ shape: Shape;
1274
+ }
1275
+ export interface $ZodPropertiesInternals<Shape extends $ZodShape = $ZodShape> extends $ZodTypeInternals<$InferObjectInput<Shape, {}>, $InferObjectInput<Shape, {}>>, checks.$ZodCheckInternals<{
1276
+ -readonly [k in keyof Shape]: util.Widen<core.input<Shape[k]>>;
1277
+ }> {
1278
+ def: $ZodPropertiesDef<Shape>;
1279
+ isst: errors.$ZodIssueInvalidType;
1280
+ issc: errors.$ZodIssue;
1281
+ }
1282
+ export interface $ZodProperties<Shape extends $ZodShape = $ZodShape> extends $ZodType {
1283
+ _zod: $ZodPropertiesInternals<Shape>;
1284
+ [Symbol.iterator](): Iterator<this>;
1285
+ }
1286
+ export declare const $ZodProperties: core.$constructor<$ZodProperties>;
1287
+ export type $ZodTypes = $ZodString | $ZodNumber | $ZodBigInt | $ZodBoolean | $ZodDate | $ZodSymbol | $ZodUndefined | $ZodNullable | $ZodNull | $ZodAny | $ZodUnknown | $ZodNever | $ZodVoid | $ZodArray | $ZodObject | $ZodUnion | $ZodIntersection | $ZodTuple | $ZodRecord | $ZodMap | $ZodSet | $ZodLiteral | $ZodEnum | $ZodFunction | $ZodPromise | $ZodLazy | $ZodOptional | $ZodDefault | $ZodPrefault | $ZodTemplateLiteral | $ZodCustom | $ZodProperties | $ZodTransform | $ZodNonOptional | $ZodReadonly | $ZodNaN | $ZodPipe | $ZodSuccess | $ZodCatch | $ZodFile;
1288
+ export type $ZodStringFormatTypes = $ZodGUID | $ZodUUID | $ZodEmail | $ZodURL | $ZodEmoji | $ZodNanoID | $ZodCUID | $ZodCUID2 | $ZodULID | $ZodXID | $ZodKSUID | $ZodISODateTime | $ZodISODate | $ZodISOTime | $ZodISODuration | $ZodIPv4 | $ZodIPv6 | $ZodMAC | $ZodCIDRv4 | $ZodCIDRv6 | $ZodBase64 | $ZodBase64URL | $ZodE164 | $ZodCreditCard | $ZodIBAN | $ZodJWT | $ZodCustomStringFormat<"hex"> | $ZodCustomStringFormat<util.HashFormat> | $ZodCustomStringFormat<"hostname">;
@@ -21,6 +21,8 @@ export interface ParseContextInternal<T extends errors.$ZodIssueBase = never> ex
21
21
  readonly async?: boolean | undefined;
22
22
  readonly direction?: "forward" | "backward";
23
23
  readonly skipChecks?: boolean;
24
+ /** Set only by `validate`/`validateAsync`. A container may stop before its next child, never inside one, so a map entry and a tuple's fixed items parse whole. */
25
+ readonly abortEarly?: boolean;
24
26
  }
25
27
  /** Gives a container cycle support: `attach` wraps its parse, and `alloc` registers the object it builds into before any child is parsed so a reference back to the same input resolves to it. */
26
28
  export interface $ZodMemoizer {
@@ -39,7 +41,7 @@ export interface ParsePayload<T = unknown> {
39
41
  }
40
42
  export type CheckFn<T> = (input: ParsePayload<T>) => util.MaybeAsync<void>;
41
43
  export interface $ZodTypeDef {
42
- type: "string" | "number" | "int" | "boolean" | "bigint" | "symbol" | "null" | "undefined" | "void" | "never" | "any" | "unknown" | "date" | "object" | "record" | "file" | "array" | "tuple" | "union" | "intersection" | "map" | "set" | "enum" | "literal" | "nullable" | "optional" | "nonoptional" | "success" | "transform" | "default" | "prefault" | "catch" | "nan" | "pipe" | "readonly" | "template_literal" | "promise" | "lazy" | "function" | "custom";
44
+ type: "string" | "number" | "int" | "boolean" | "bigint" | "symbol" | "null" | "undefined" | "void" | "never" | "any" | "unknown" | "date" | "object" | "record" | "file" | "array" | "tuple" | "union" | "intersection" | "map" | "set" | "enum" | "literal" | "nullable" | "optional" | "nonoptional" | "success" | "transform" | "default" | "prefault" | "catch" | "nan" | "pipe" | "readonly" | "template_literal" | "promise" | "lazy" | "function" | "custom" | "properties";
43
45
  error?: errors.$ZodErrorMap<never> | undefined;
44
46
  checks?: checks.$ZodCheck<never>[];
45
47
  }
@@ -371,7 +373,9 @@ export interface $ZodBase64Internals extends $ZodStringFormatInternals<"base64">
371
373
  export interface $ZodBase64 extends $ZodType {
372
374
  _zod: $ZodBase64Internals;
373
375
  }
376
+ export declare const base64Charset: RegExp;
374
377
  export declare const $ZodBase64: core.$constructor<$ZodBase64>;
378
+ export declare const base64urlCharset: RegExp;
375
379
  export declare function isValidBase64URL(data: string): boolean;
376
380
  export interface $ZodBase64URLDef extends $ZodStringFormatDef<"base64url"> {
377
381
  }
@@ -399,6 +403,16 @@ export interface $ZodCreditCard extends $ZodType {
399
403
  _zod: $ZodCreditCardInternals;
400
404
  }
401
405
  export declare const $ZodCreditCard: core.$constructor<$ZodCreditCard>;
406
+ export declare function isValidIBAN(input: string): boolean;
407
+ export interface $ZodIBANDef extends $ZodStringFormatDef<"iban"> {
408
+ }
409
+ export interface $ZodIBANInternals extends $ZodStringFormatInternals<"iban"> {
410
+ def: $ZodIBANDef;
411
+ }
412
+ export interface $ZodIBAN extends $ZodType {
413
+ _zod: $ZodIBANInternals;
414
+ }
415
+ export declare const $ZodIBAN: core.$constructor<$ZodIBAN>;
402
416
  export declare function isValidJWT(token: string, algorithm?: util.JWTAlgorithm | null): boolean;
403
417
  export interface $ZodJWTDef extends $ZodStringFormatDef<"jwt"> {
404
418
  alg?: util.JWTAlgorithm | undefined;
@@ -617,12 +631,16 @@ type OptionalInSchema = {
617
631
  optin: "optional" | "defaulted";
618
632
  };
619
633
  };
620
- export type $InferObjectOutput<T extends $ZodLooseShape, Extra extends Record<string, unknown>> = string extends keyof T ? util.IsAny<T[keyof T]> extends true ? Record<string, unknown> : Record<string, core.output<T[keyof T]>> : keyof (T & Extra) extends never ? Record<string, never> : util.Prettify<{
634
+ export type $InferObjectOutput<T extends $ZodLooseShape, Extra extends Record<string, unknown>> = string extends keyof T ? util.IsAny<T[keyof T]> extends true ? Record<string, unknown> : {
635
+ [k in string]: core.output<T[keyof T]>;
636
+ } : keyof (T & Extra) extends never ? Record<string, never> : util.Prettify<{
621
637
  -readonly [k in keyof T as T[k] extends OptionalOutSchema ? never : k]: T[k]["_zod"]["output"];
622
638
  } & {
623
639
  -readonly [k in keyof T as T[k] extends OptionalOutSchema ? k : never]?: T[k]["_zod"]["output"];
624
640
  } & Extra>;
625
- export type $InferObjectInput<T extends $ZodLooseShape, Extra extends Record<string, unknown>> = string extends keyof T ? util.IsAny<T[keyof T]> extends true ? Record<string, unknown> : Record<string, core.input<T[keyof T]>> : keyof (T & Extra) extends never ? Record<string, never> : util.Prettify<{
641
+ export type $InferObjectInput<T extends $ZodLooseShape, Extra extends Record<string, unknown>> = string extends keyof T ? util.IsAny<T[keyof T]> extends true ? Record<string, unknown> : {
642
+ [k in string]: core.input<T[keyof T]>;
643
+ } : keyof (T & Extra) extends never ? Record<string, never> : util.Prettify<{
626
644
  -readonly [k in keyof T as T[k] extends OptionalInSchema ? never : k]: T[k]["_zod"]["input"];
627
645
  } & {
628
646
  -readonly [k in keyof T as T[k] extends OptionalInSchema ? k : never]?: T[k]["_zod"]["input"];
@@ -715,7 +733,7 @@ export interface $ZodDiscriminatedUnionInternals<Options extends readonly SomeTy
715
733
  def: $ZodDiscriminatedUnionDef<Options, Disc>;
716
734
  propValues: util.PropValues;
717
735
  bag: util.LoosePartial<{
718
- optionsMap: Map<util.Primitive, $ZodType>;
736
+ optionsMap: Map<util.Primitive, $ZodType | null>;
719
737
  }>;
720
738
  }
721
739
  /** The discriminator values a member of `Options` can declare. An omittable discriminator contributes `undefined`, matching what `propValues` claims for it. */
@@ -734,7 +752,7 @@ export type $DiscriminatedOption<Options extends readonly SomeType[], Disc exten
734
752
  };
735
753
  } ? Disc extends keyof Out ? V extends Out[Disc] ? Options[I] : never : never : never;
736
754
  }[number];
737
- /** Returns the option of `union` whose discriminator claims `value`. */
755
+ /** Returns the option whose discriminator claims `value`, or throws if ambiguous. */
738
756
  export declare function getDiscriminatedOption<Options extends readonly SomeType[], Disc extends string, const V extends $DiscriminatorValue<Options, Disc>>(union: $ZodDiscriminatedUnion<Options, Disc>, value: V): $DiscriminatedOption<Options, Disc, V>;
739
757
  export interface $ZodDiscriminatedUnion<Options extends readonly SomeType[] = readonly $ZodType[], Disc extends string = string> extends $ZodType {
740
758
  _zod: $ZodDiscriminatedUnionInternals<Options, Disc>;
@@ -1249,5 +1267,22 @@ export interface $ZodCustom<O = unknown, I = unknown> extends $ZodType {
1249
1267
  _zod: $ZodCustomInternals<O, I>;
1250
1268
  }
1251
1269
  export declare const $ZodCustom: core.$constructor<$ZodCustom>;
1252
- export type $ZodTypes = $ZodString | $ZodNumber | $ZodBigInt | $ZodBoolean | $ZodDate | $ZodSymbol | $ZodUndefined | $ZodNullable | $ZodNull | $ZodAny | $ZodUnknown | $ZodNever | $ZodVoid | $ZodArray | $ZodObject | $ZodUnion | $ZodIntersection | $ZodTuple | $ZodRecord | $ZodMap | $ZodSet | $ZodLiteral | $ZodEnum | $ZodFunction | $ZodPromise | $ZodLazy | $ZodOptional | $ZodDefault | $ZodPrefault | $ZodTemplateLiteral | $ZodCustom | $ZodTransform | $ZodNonOptional | $ZodReadonly | $ZodNaN | $ZodPipe | $ZodSuccess | $ZodCatch | $ZodFile;
1253
- export type $ZodStringFormatTypes = $ZodGUID | $ZodUUID | $ZodEmail | $ZodURL | $ZodEmoji | $ZodNanoID | $ZodCUID | $ZodCUID2 | $ZodULID | $ZodXID | $ZodKSUID | $ZodISODateTime | $ZodISODate | $ZodISOTime | $ZodISODuration | $ZodIPv4 | $ZodIPv6 | $ZodMAC | $ZodCIDRv4 | $ZodCIDRv6 | $ZodBase64 | $ZodBase64URL | $ZodE164 | $ZodCreditCard | $ZodJWT | $ZodCustomStringFormat<"hex"> | $ZodCustomStringFormat<util.HashFormat> | $ZodCustomStringFormat<"hostname">;
1270
+ export interface $ZodPropertiesDef<Shape extends $ZodShape = $ZodShape> extends $ZodTypeDef, checks.$ZodCheckDef {
1271
+ type: "properties";
1272
+ check: "properties";
1273
+ shape: Shape;
1274
+ }
1275
+ export interface $ZodPropertiesInternals<Shape extends $ZodShape = $ZodShape> extends $ZodTypeInternals<$InferObjectInput<Shape, {}>, $InferObjectInput<Shape, {}>>, checks.$ZodCheckInternals<{
1276
+ -readonly [k in keyof Shape]: util.Widen<core.input<Shape[k]>>;
1277
+ }> {
1278
+ def: $ZodPropertiesDef<Shape>;
1279
+ isst: errors.$ZodIssueInvalidType;
1280
+ issc: errors.$ZodIssue;
1281
+ }
1282
+ export interface $ZodProperties<Shape extends $ZodShape = $ZodShape> extends $ZodType {
1283
+ _zod: $ZodPropertiesInternals<Shape>;
1284
+ [Symbol.iterator](): Iterator<this>;
1285
+ }
1286
+ export declare const $ZodProperties: core.$constructor<$ZodProperties>;
1287
+ export type $ZodTypes = $ZodString | $ZodNumber | $ZodBigInt | $ZodBoolean | $ZodDate | $ZodSymbol | $ZodUndefined | $ZodNullable | $ZodNull | $ZodAny | $ZodUnknown | $ZodNever | $ZodVoid | $ZodArray | $ZodObject | $ZodUnion | $ZodIntersection | $ZodTuple | $ZodRecord | $ZodMap | $ZodSet | $ZodLiteral | $ZodEnum | $ZodFunction | $ZodPromise | $ZodLazy | $ZodOptional | $ZodDefault | $ZodPrefault | $ZodTemplateLiteral | $ZodCustom | $ZodProperties | $ZodTransform | $ZodNonOptional | $ZodReadonly | $ZodNaN | $ZodPipe | $ZodSuccess | $ZodCatch | $ZodFile;
1288
+ export type $ZodStringFormatTypes = $ZodGUID | $ZodUUID | $ZodEmail | $ZodURL | $ZodEmoji | $ZodNanoID | $ZodCUID | $ZodCUID2 | $ZodULID | $ZodXID | $ZodKSUID | $ZodISODateTime | $ZodISODate | $ZodISOTime | $ZodISODuration | $ZodIPv4 | $ZodIPv6 | $ZodMAC | $ZodCIDRv4 | $ZodCIDRv6 | $ZodBase64 | $ZodBase64URL | $ZodE164 | $ZodCreditCard | $ZodIBAN | $ZodJWT | $ZodCustomStringFormat<"hex"> | $ZodCustomStringFormat<util.HashFormat> | $ZodCustomStringFormat<"hostname">;