zod 3.25.0 → 3.25.3

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 (385) hide show
  1. package/dist/commonjs/index.d.ts +3 -0
  2. package/dist/commonjs/index.js +22 -0
  3. package/dist/commonjs/package.json +3 -0
  4. package/dist/commonjs/v3/ZodError.d.ts +164 -0
  5. package/dist/commonjs/v3/ZodError.js +137 -0
  6. package/dist/commonjs/v3/benchmarks/datetime.d.ts +5 -0
  7. package/dist/commonjs/v3/benchmarks/datetime.js +54 -0
  8. package/dist/commonjs/v3/benchmarks/discriminatedUnion.d.ts +5 -0
  9. package/dist/commonjs/v3/benchmarks/discriminatedUnion.js +79 -0
  10. package/dist/commonjs/v3/benchmarks/index.d.ts +1 -0
  11. package/dist/commonjs/v3/benchmarks/index.js +59 -0
  12. package/dist/commonjs/v3/benchmarks/ipv4.d.ts +5 -0
  13. package/dist/commonjs/v3/benchmarks/ipv4.js +54 -0
  14. package/dist/commonjs/v3/benchmarks/object.d.ts +5 -0
  15. package/dist/commonjs/v3/benchmarks/object.js +70 -0
  16. package/dist/commonjs/v3/benchmarks/primitives.d.ts +5 -0
  17. package/dist/commonjs/v3/benchmarks/primitives.js +159 -0
  18. package/dist/commonjs/v3/benchmarks/realworld.d.ts +5 -0
  19. package/dist/commonjs/v3/benchmarks/realworld.js +56 -0
  20. package/dist/commonjs/v3/benchmarks/string.d.ts +5 -0
  21. package/dist/commonjs/v3/benchmarks/string.js +55 -0
  22. package/dist/commonjs/v3/benchmarks/union.d.ts +5 -0
  23. package/dist/commonjs/v3/benchmarks/union.js +79 -0
  24. package/dist/commonjs/v3/errors.d.ts +5 -0
  25. package/dist/commonjs/v3/errors.js +17 -0
  26. package/dist/commonjs/v3/external.d.ts +6 -0
  27. package/dist/commonjs/v3/external.js +22 -0
  28. package/dist/commonjs/v3/helpers/enumUtil.d.ts +8 -0
  29. package/dist/commonjs/v3/helpers/enumUtil.js +2 -0
  30. package/dist/commonjs/v3/helpers/errorUtil.d.ts +9 -0
  31. package/dist/commonjs/v3/helpers/errorUtil.js +9 -0
  32. package/dist/commonjs/v3/helpers/parseUtil.d.ts +78 -0
  33. package/dist/commonjs/v3/helpers/parseUtil.js +124 -0
  34. package/dist/commonjs/v3/helpers/partialUtil.d.ts +8 -0
  35. package/dist/commonjs/v3/helpers/partialUtil.js +2 -0
  36. package/dist/commonjs/v3/helpers/typeAliases.d.ts +2 -0
  37. package/dist/commonjs/v3/helpers/typeAliases.js +2 -0
  38. package/dist/commonjs/v3/helpers/util.d.ts +85 -0
  39. package/dist/commonjs/v3/helpers/util.js +137 -0
  40. package/dist/commonjs/v3/index.d.ts +4 -0
  41. package/dist/commonjs/v3/index.js +43 -0
  42. package/dist/commonjs/v3/locales/en.d.ts +3 -0
  43. package/dist/commonjs/v3/locales/en.js +109 -0
  44. package/dist/commonjs/v3/standard-schema.d.ts +102 -0
  45. package/dist/commonjs/v3/standard-schema.js +2 -0
  46. package/dist/commonjs/v3/tests/Mocker.d.ts +17 -0
  47. package/dist/commonjs/v3/tests/Mocker.js +57 -0
  48. package/dist/commonjs/v3/tests/language-server.source.d.ts +70 -0
  49. package/dist/commonjs/v3/tests/language-server.source.js +81 -0
  50. package/dist/commonjs/v3/types.d.ts +1031 -0
  51. package/dist/commonjs/v3/types.js +3795 -0
  52. package/dist/commonjs/v4/classic/checks.d.ts +1 -0
  53. package/dist/commonjs/v4/classic/checks.js +32 -0
  54. package/dist/commonjs/v4/classic/coerce.d.ts +17 -0
  55. package/dist/commonjs/v4/classic/coerce.js +57 -0
  56. package/dist/commonjs/v4/classic/compat.d.ts +48 -0
  57. package/dist/commonjs/v4/classic/compat.js +73 -0
  58. package/dist/commonjs/v4/classic/errors.d.ts +30 -0
  59. package/dist/commonjs/v4/classic/errors.js +76 -0
  60. package/dist/commonjs/v4/classic/external.d.ts +8 -0
  61. package/dist/commonjs/v4/classic/external.js +68 -0
  62. package/dist/commonjs/v4/classic/index.d.ts +4 -0
  63. package/dist/commonjs/v4/classic/index.js +43 -0
  64. package/dist/commonjs/v4/classic/iso.d.ts +22 -0
  65. package/dist/commonjs/v4/classic/iso.js +70 -0
  66. package/dist/commonjs/v4/classic/parse.d.ts +23 -0
  67. package/dist/commonjs/v4/classic/parse.js +42 -0
  68. package/dist/commonjs/v4/classic/schemas.d.ts +653 -0
  69. package/dist/commonjs/v4/classic/schemas.js +1123 -0
  70. package/dist/commonjs/v4/core/api.d.ts +273 -0
  71. package/dist/commonjs/v4/core/api.js +1004 -0
  72. package/dist/commonjs/v4/core/checks.d.ts +277 -0
  73. package/dist/commonjs/v4/core/checks.js +571 -0
  74. package/dist/commonjs/v4/core/config.d.ts +9 -0
  75. package/dist/commonjs/v4/core/config.js +10 -0
  76. package/dist/commonjs/v4/core/core.d.ts +43 -0
  77. package/dist/commonjs/v4/core/core.js +59 -0
  78. package/dist/commonjs/v4/core/doc.d.ts +14 -0
  79. package/dist/commonjs/v4/core/doc.js +40 -0
  80. package/dist/commonjs/v4/core/errors.d.ts +204 -0
  81. package/dist/commonjs/v4/core/errors.js +203 -0
  82. package/dist/commonjs/v4/core/function.d.ts +35 -0
  83. package/dist/commonjs/v4/core/function.js +107 -0
  84. package/dist/commonjs/v4/core/index.d.ts +15 -0
  85. package/dist/commonjs/v4/core/index.js +54 -0
  86. package/dist/commonjs/v4/core/json-schema.d.ts +100 -0
  87. package/dist/commonjs/v4/core/json-schema.js +2 -0
  88. package/dist/commonjs/v4/core/parse.d.ts +25 -0
  89. package/dist/commonjs/v4/core/parse.js +97 -0
  90. package/dist/commonjs/v4/core/regexes.d.ts +62 -0
  91. package/dist/commonjs/v4/core/regexes.js +101 -0
  92. package/dist/commonjs/v4/core/registries.d.ts +32 -0
  93. package/dist/commonjs/v4/core/registries.js +47 -0
  94. package/dist/commonjs/v4/core/schemas.d.ts +975 -0
  95. package/dist/commonjs/v4/core/schemas.js +1781 -0
  96. package/dist/commonjs/v4/core/standard-schema.d.ts +55 -0
  97. package/dist/commonjs/v4/core/standard-schema.js +2 -0
  98. package/dist/commonjs/v4/core/to-json-schema.d.ts +84 -0
  99. package/dist/commonjs/v4/core/to-json-schema.js +670 -0
  100. package/dist/commonjs/v4/core/util.d.ts +186 -0
  101. package/dist/commonjs/v4/core/util.js +515 -0
  102. package/dist/commonjs/v4/core/versions.d.ts +5 -0
  103. package/dist/commonjs/v4/core/versions.js +8 -0
  104. package/dist/commonjs/v4/core/zsf.d.ts +91 -0
  105. package/dist/commonjs/v4/core/zsf.js +172 -0
  106. package/dist/commonjs/v4/index.d.ts +3 -0
  107. package/dist/commonjs/v4/index.js +22 -0
  108. package/dist/commonjs/v4/locales/ar.d.ts +7 -0
  109. package/dist/commonjs/v4/locales/ar.js +153 -0
  110. package/dist/commonjs/v4/locales/az.d.ts +7 -0
  111. package/dist/commonjs/v4/locales/az.js +152 -0
  112. package/dist/commonjs/v4/locales/be.d.ts +7 -0
  113. package/dist/commonjs/v4/locales/be.js +201 -0
  114. package/dist/commonjs/v4/locales/ca.d.ts +7 -0
  115. package/dist/commonjs/v4/locales/ca.js +155 -0
  116. package/dist/commonjs/v4/locales/cs.d.ts +7 -0
  117. package/dist/commonjs/v4/locales/cs.js +172 -0
  118. package/dist/commonjs/v4/locales/de.d.ts +7 -0
  119. package/dist/commonjs/v4/locales/de.js +153 -0
  120. package/dist/commonjs/v4/locales/en.d.ts +7 -0
  121. package/dist/commonjs/v4/locales/en.js +155 -0
  122. package/dist/commonjs/v4/locales/es.d.ts +7 -0
  123. package/dist/commonjs/v4/locales/es.js +154 -0
  124. package/dist/commonjs/v4/locales/fa.d.ts +7 -0
  125. package/dist/commonjs/v4/locales/fa.js +159 -0
  126. package/dist/commonjs/v4/locales/fi.d.ts +7 -0
  127. package/dist/commonjs/v4/locales/fi.js +159 -0
  128. package/dist/commonjs/v4/locales/fr.d.ts +7 -0
  129. package/dist/commonjs/v4/locales/fr.js +153 -0
  130. package/dist/commonjs/v4/locales/frCA.d.ts +7 -0
  131. package/dist/commonjs/v4/locales/frCA.js +154 -0
  132. package/dist/commonjs/v4/locales/he.d.ts +7 -0
  133. package/dist/commonjs/v4/locales/he.js +154 -0
  134. package/dist/commonjs/v4/locales/hu.d.ts +7 -0
  135. package/dist/commonjs/v4/locales/hu.js +154 -0
  136. package/dist/commonjs/v4/locales/id.d.ts +7 -0
  137. package/dist/commonjs/v4/locales/id.js +153 -0
  138. package/dist/commonjs/v4/locales/index.d.ts +34 -0
  139. package/dist/commonjs/v4/locales/index.js +74 -0
  140. package/dist/commonjs/v4/locales/it.d.ts +7 -0
  141. package/dist/commonjs/v4/locales/it.js +154 -0
  142. package/dist/commonjs/v4/locales/ja.d.ts +7 -0
  143. package/dist/commonjs/v4/locales/ja.js +152 -0
  144. package/dist/commonjs/v4/locales/ko.d.ts +7 -0
  145. package/dist/commonjs/v4/locales/ko.js +158 -0
  146. package/dist/commonjs/v4/locales/mk.d.ts +7 -0
  147. package/dist/commonjs/v4/locales/mk.js +155 -0
  148. package/dist/commonjs/v4/locales/ms.d.ts +7 -0
  149. package/dist/commonjs/v4/locales/ms.js +153 -0
  150. package/dist/commonjs/v4/locales/no.d.ts +7 -0
  151. package/dist/commonjs/v4/locales/no.js +153 -0
  152. package/dist/commonjs/v4/locales/ota.d.ts +7 -0
  153. package/dist/commonjs/v4/locales/ota.js +154 -0
  154. package/dist/commonjs/v4/locales/pl.d.ts +7 -0
  155. package/dist/commonjs/v4/locales/pl.js +154 -0
  156. package/dist/commonjs/v4/locales/pt.d.ts +7 -0
  157. package/dist/commonjs/v4/locales/pt.js +153 -0
  158. package/dist/commonjs/v4/locales/ru.d.ts +7 -0
  159. package/dist/commonjs/v4/locales/ru.js +201 -0
  160. package/dist/commonjs/v4/locales/sl.d.ts +7 -0
  161. package/dist/commonjs/v4/locales/sl.js +154 -0
  162. package/dist/commonjs/v4/locales/ta.d.ts +7 -0
  163. package/dist/commonjs/v4/locales/ta.js +154 -0
  164. package/dist/commonjs/v4/locales/th.d.ts +7 -0
  165. package/dist/commonjs/v4/locales/th.js +154 -0
  166. package/dist/commonjs/v4/locales/tr.d.ts +7 -0
  167. package/dist/commonjs/v4/locales/tr.js +152 -0
  168. package/dist/commonjs/v4/locales/ua.d.ts +7 -0
  169. package/dist/commonjs/v4/locales/ua.js +154 -0
  170. package/dist/commonjs/v4/locales/ur.d.ts +7 -0
  171. package/dist/commonjs/v4/locales/ur.js +154 -0
  172. package/dist/commonjs/v4/locales/vi.d.ts +7 -0
  173. package/dist/commonjs/v4/locales/vi.js +153 -0
  174. package/dist/commonjs/v4/locales/zh-CN.d.ts +7 -0
  175. package/dist/commonjs/v4/locales/zh-CN.js +153 -0
  176. package/dist/commonjs/v4/locales/zh-tw.d.ts +7 -0
  177. package/dist/commonjs/v4/locales/zh-tw.js +154 -0
  178. package/dist/commonjs/v4/mini/checks.d.ts +1 -0
  179. package/dist/commonjs/v4/mini/checks.js +34 -0
  180. package/dist/commonjs/v4/mini/coerce.d.ts +7 -0
  181. package/dist/commonjs/v4/mini/coerce.js +57 -0
  182. package/dist/commonjs/v4/mini/external.d.ts +7 -0
  183. package/dist/commonjs/v4/mini/external.js +61 -0
  184. package/dist/commonjs/v4/mini/index.d.ts +3 -0
  185. package/dist/commonjs/v4/mini/index.js +42 -0
  186. package/dist/commonjs/v4/mini/iso.d.ts +22 -0
  187. package/dist/commonjs/v4/mini/iso.js +70 -0
  188. package/dist/commonjs/v4/mini/parse.d.ts +1 -0
  189. package/dist/commonjs/v4/mini/parse.js +8 -0
  190. package/dist/commonjs/v4/mini/schemas.d.ts +405 -0
  191. package/dist/commonjs/v4/mini/schemas.js +852 -0
  192. package/dist/esm/index.d.ts +3 -0
  193. package/dist/esm/index.js +3 -0
  194. package/dist/esm/package.json +3 -0
  195. package/dist/esm/v3/ZodError.d.ts +164 -0
  196. package/dist/esm/v3/ZodError.js +132 -0
  197. package/dist/esm/v3/benchmarks/datetime.d.ts +5 -0
  198. package/dist/esm/v3/benchmarks/datetime.js +49 -0
  199. package/dist/esm/v3/benchmarks/discriminatedUnion.d.ts +5 -0
  200. package/dist/esm/v3/benchmarks/discriminatedUnion.js +74 -0
  201. package/dist/esm/v3/benchmarks/index.d.ts +1 -0
  202. package/dist/esm/v3/benchmarks/index.js +54 -0
  203. package/dist/esm/v3/benchmarks/ipv4.d.ts +5 -0
  204. package/dist/esm/v3/benchmarks/ipv4.js +49 -0
  205. package/dist/esm/v3/benchmarks/object.d.ts +5 -0
  206. package/dist/esm/v3/benchmarks/object.js +65 -0
  207. package/dist/esm/v3/benchmarks/primitives.d.ts +5 -0
  208. package/dist/esm/v3/benchmarks/primitives.js +154 -0
  209. package/dist/esm/v3/benchmarks/realworld.d.ts +5 -0
  210. package/dist/esm/v3/benchmarks/realworld.js +51 -0
  211. package/dist/esm/v3/benchmarks/string.d.ts +5 -0
  212. package/dist/esm/v3/benchmarks/string.js +50 -0
  213. package/dist/esm/v3/benchmarks/union.d.ts +5 -0
  214. package/dist/esm/v3/benchmarks/union.js +74 -0
  215. package/dist/esm/v3/errors.d.ts +5 -0
  216. package/dist/esm/v3/errors.js +9 -0
  217. package/dist/esm/v3/external.d.ts +6 -0
  218. package/dist/esm/v3/external.js +6 -0
  219. package/dist/esm/v3/helpers/enumUtil.d.ts +8 -0
  220. package/dist/esm/v3/helpers/enumUtil.js +1 -0
  221. package/dist/esm/v3/helpers/errorUtil.d.ts +9 -0
  222. package/dist/esm/v3/helpers/errorUtil.js +6 -0
  223. package/dist/esm/v3/helpers/parseUtil.d.ts +78 -0
  224. package/dist/esm/v3/helpers/parseUtil.js +109 -0
  225. package/dist/esm/v3/helpers/partialUtil.d.ts +8 -0
  226. package/dist/esm/v3/helpers/partialUtil.js +1 -0
  227. package/dist/esm/v3/helpers/typeAliases.d.ts +2 -0
  228. package/dist/esm/v3/helpers/typeAliases.js +1 -0
  229. package/dist/esm/v3/helpers/util.d.ts +85 -0
  230. package/dist/esm/v3/helpers/util.js +133 -0
  231. package/dist/esm/v3/index.d.ts +4 -0
  232. package/dist/esm/v3/index.js +4 -0
  233. package/dist/esm/v3/locales/en.d.ts +3 -0
  234. package/dist/esm/v3/locales/en.js +107 -0
  235. package/dist/esm/v3/standard-schema.d.ts +102 -0
  236. package/dist/esm/v3/standard-schema.js +1 -0
  237. package/dist/esm/v3/tests/Mocker.d.ts +17 -0
  238. package/dist/esm/v3/tests/Mocker.js +53 -0
  239. package/dist/esm/v3/tests/language-server.source.d.ts +70 -0
  240. package/dist/esm/v3/tests/language-server.source.js +45 -0
  241. package/dist/esm/v3/types.d.ts +1031 -0
  242. package/dist/esm/v3/types.js +3713 -0
  243. package/dist/esm/v4/classic/checks.d.ts +1 -0
  244. package/dist/esm/v4/classic/checks.js +1 -0
  245. package/dist/esm/v4/classic/coerce.d.ts +17 -0
  246. package/dist/esm/v4/classic/coerce.js +17 -0
  247. package/dist/esm/v4/classic/compat.d.ts +48 -0
  248. package/dist/esm/v4/classic/compat.js +33 -0
  249. package/dist/esm/v4/classic/errors.d.ts +30 -0
  250. package/dist/esm/v4/classic/errors.js +40 -0
  251. package/dist/esm/v4/classic/external.d.ts +8 -0
  252. package/dist/esm/v4/classic/external.js +11 -0
  253. package/dist/esm/v4/classic/index.d.ts +4 -0
  254. package/dist/esm/v4/classic/index.js +4 -0
  255. package/dist/esm/v4/classic/iso.d.ts +22 -0
  256. package/dist/esm/v4/classic/iso.js +30 -0
  257. package/dist/esm/v4/classic/parse.d.ts +23 -0
  258. package/dist/esm/v4/classic/parse.js +6 -0
  259. package/dist/esm/v4/classic/schemas.d.ts +653 -0
  260. package/dist/esm/v4/classic/schemas.js +1012 -0
  261. package/dist/esm/v4/core/api.d.ts +273 -0
  262. package/dist/esm/v4/core/api.js +867 -0
  263. package/dist/esm/v4/core/checks.d.ts +277 -0
  264. package/dist/esm/v4/core/checks.js +535 -0
  265. package/dist/esm/v4/core/config.d.ts +9 -0
  266. package/dist/esm/v4/core/config.js +6 -0
  267. package/dist/esm/v4/core/core.d.ts +43 -0
  268. package/dist/esm/v4/core/core.js +53 -0
  269. package/dist/esm/v4/core/doc.d.ts +14 -0
  270. package/dist/esm/v4/core/doc.js +36 -0
  271. package/dist/esm/v4/core/errors.d.ts +204 -0
  272. package/dist/esm/v4/core/errors.js +195 -0
  273. package/dist/esm/v4/core/function.d.ts +35 -0
  274. package/dist/esm/v4/core/function.js +70 -0
  275. package/dist/esm/v4/core/index.d.ts +15 -0
  276. package/dist/esm/v4/core/index.js +15 -0
  277. package/dist/esm/v4/core/json-schema.d.ts +100 -0
  278. package/dist/esm/v4/core/json-schema.js +1 -0
  279. package/dist/esm/v4/core/parse.d.ts +25 -0
  280. package/dist/esm/v4/core/parse.js +57 -0
  281. package/dist/esm/v4/core/regexes.d.ts +62 -0
  282. package/dist/esm/v4/core/regexes.js +93 -0
  283. package/dist/esm/v4/core/registries.d.ts +32 -0
  284. package/dist/esm/v4/core/registries.js +42 -0
  285. package/dist/esm/v4/core/schemas.d.ts +975 -0
  286. package/dist/esm/v4/core/schemas.js +1740 -0
  287. package/dist/esm/v4/core/standard-schema.d.ts +55 -0
  288. package/dist/esm/v4/core/standard-schema.js +1 -0
  289. package/dist/esm/v4/core/to-json-schema.d.ts +84 -0
  290. package/dist/esm/v4/core/to-json-schema.js +665 -0
  291. package/dist/esm/v4/core/util.d.ts +186 -0
  292. package/dist/esm/v4/core/util.js +469 -0
  293. package/dist/esm/v4/core/versions.d.ts +5 -0
  294. package/dist/esm/v4/core/versions.js +5 -0
  295. package/dist/esm/v4/core/zsf.d.ts +91 -0
  296. package/dist/esm/v4/core/zsf.js +171 -0
  297. package/dist/esm/v4/index.d.ts +3 -0
  298. package/dist/esm/v4/index.js +3 -0
  299. package/dist/esm/v4/locales/ar.d.ts +7 -0
  300. package/dist/esm/v4/locales/ar.js +115 -0
  301. package/dist/esm/v4/locales/az.d.ts +7 -0
  302. package/dist/esm/v4/locales/az.js +114 -0
  303. package/dist/esm/v4/locales/be.d.ts +7 -0
  304. package/dist/esm/v4/locales/be.js +163 -0
  305. package/dist/esm/v4/locales/ca.d.ts +7 -0
  306. package/dist/esm/v4/locales/ca.js +117 -0
  307. package/dist/esm/v4/locales/cs.d.ts +7 -0
  308. package/dist/esm/v4/locales/cs.js +134 -0
  309. package/dist/esm/v4/locales/de.d.ts +7 -0
  310. package/dist/esm/v4/locales/de.js +115 -0
  311. package/dist/esm/v4/locales/en.d.ts +7 -0
  312. package/dist/esm/v4/locales/en.js +117 -0
  313. package/dist/esm/v4/locales/es.d.ts +7 -0
  314. package/dist/esm/v4/locales/es.js +116 -0
  315. package/dist/esm/v4/locales/fa.d.ts +7 -0
  316. package/dist/esm/v4/locales/fa.js +121 -0
  317. package/dist/esm/v4/locales/fi.d.ts +7 -0
  318. package/dist/esm/v4/locales/fi.js +121 -0
  319. package/dist/esm/v4/locales/fr.d.ts +7 -0
  320. package/dist/esm/v4/locales/fr.js +115 -0
  321. package/dist/esm/v4/locales/frCA.d.ts +7 -0
  322. package/dist/esm/v4/locales/frCA.js +116 -0
  323. package/dist/esm/v4/locales/he.d.ts +7 -0
  324. package/dist/esm/v4/locales/he.js +116 -0
  325. package/dist/esm/v4/locales/hu.d.ts +7 -0
  326. package/dist/esm/v4/locales/hu.js +116 -0
  327. package/dist/esm/v4/locales/id.d.ts +7 -0
  328. package/dist/esm/v4/locales/id.js +115 -0
  329. package/dist/esm/v4/locales/index.d.ts +34 -0
  330. package/dist/esm/v4/locales/index.js +34 -0
  331. package/dist/esm/v4/locales/it.d.ts +7 -0
  332. package/dist/esm/v4/locales/it.js +116 -0
  333. package/dist/esm/v4/locales/ja.d.ts +7 -0
  334. package/dist/esm/v4/locales/ja.js +114 -0
  335. package/dist/esm/v4/locales/ko.d.ts +7 -0
  336. package/dist/esm/v4/locales/ko.js +120 -0
  337. package/dist/esm/v4/locales/mk.d.ts +7 -0
  338. package/dist/esm/v4/locales/mk.js +117 -0
  339. package/dist/esm/v4/locales/ms.d.ts +7 -0
  340. package/dist/esm/v4/locales/ms.js +115 -0
  341. package/dist/esm/v4/locales/no.d.ts +7 -0
  342. package/dist/esm/v4/locales/no.js +115 -0
  343. package/dist/esm/v4/locales/ota.d.ts +7 -0
  344. package/dist/esm/v4/locales/ota.js +116 -0
  345. package/dist/esm/v4/locales/pl.d.ts +7 -0
  346. package/dist/esm/v4/locales/pl.js +116 -0
  347. package/dist/esm/v4/locales/pt.d.ts +7 -0
  348. package/dist/esm/v4/locales/pt.js +115 -0
  349. package/dist/esm/v4/locales/ru.d.ts +7 -0
  350. package/dist/esm/v4/locales/ru.js +163 -0
  351. package/dist/esm/v4/locales/sl.d.ts +7 -0
  352. package/dist/esm/v4/locales/sl.js +116 -0
  353. package/dist/esm/v4/locales/ta.d.ts +7 -0
  354. package/dist/esm/v4/locales/ta.js +116 -0
  355. package/dist/esm/v4/locales/th.d.ts +7 -0
  356. package/dist/esm/v4/locales/th.js +116 -0
  357. package/dist/esm/v4/locales/tr.d.ts +7 -0
  358. package/dist/esm/v4/locales/tr.js +114 -0
  359. package/dist/esm/v4/locales/ua.d.ts +7 -0
  360. package/dist/esm/v4/locales/ua.js +116 -0
  361. package/dist/esm/v4/locales/ur.d.ts +7 -0
  362. package/dist/esm/v4/locales/ur.js +116 -0
  363. package/dist/esm/v4/locales/vi.d.ts +7 -0
  364. package/dist/esm/v4/locales/vi.js +115 -0
  365. package/dist/esm/v4/locales/zh-CN.d.ts +7 -0
  366. package/dist/esm/v4/locales/zh-CN.js +115 -0
  367. package/dist/esm/v4/locales/zh-tw.d.ts +7 -0
  368. package/dist/esm/v4/locales/zh-tw.js +116 -0
  369. package/dist/esm/v4/mini/checks.d.ts +1 -0
  370. package/dist/esm/v4/mini/checks.js +1 -0
  371. package/dist/esm/v4/mini/coerce.d.ts +7 -0
  372. package/dist/esm/v4/mini/coerce.js +17 -0
  373. package/dist/esm/v4/mini/external.d.ts +7 -0
  374. package/dist/esm/v4/mini/external.js +7 -0
  375. package/dist/esm/v4/mini/index.d.ts +3 -0
  376. package/dist/esm/v4/mini/index.js +3 -0
  377. package/dist/esm/v4/mini/iso.d.ts +22 -0
  378. package/dist/esm/v4/mini/iso.js +30 -0
  379. package/dist/esm/v4/mini/parse.d.ts +1 -0
  380. package/dist/esm/v4/mini/parse.js +1 -0
  381. package/dist/esm/v4/mini/schemas.d.ts +405 -0
  382. package/dist/esm/v4/mini/schemas.js +738 -0
  383. package/package.json +1 -1
  384. package/src/v4/core/schemas.ts +0 -2
  385. package/src/v4/core/to-json-schema.ts +1 -1
@@ -0,0 +1,1123 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
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
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ 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;
37
+ 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;
38
+ exports.string = string;
39
+ exports.email = email;
40
+ exports.guid = guid;
41
+ exports.uuid = uuid;
42
+ exports.uuidv4 = uuidv4;
43
+ exports.uuidv6 = uuidv6;
44
+ exports.uuidv7 = uuidv7;
45
+ exports.url = url;
46
+ exports.emoji = emoji;
47
+ exports.nanoid = nanoid;
48
+ exports.cuid = cuid;
49
+ exports.cuid2 = cuid2;
50
+ exports.ulid = ulid;
51
+ exports.xid = xid;
52
+ exports.ksuid = ksuid;
53
+ exports.ipv4 = ipv4;
54
+ exports.ipv6 = ipv6;
55
+ exports.cidrv4 = cidrv4;
56
+ exports.cidrv6 = cidrv6;
57
+ exports.base64 = base64;
58
+ exports.base64url = base64url;
59
+ exports.e164 = e164;
60
+ exports.jwt = jwt;
61
+ exports.number = number;
62
+ exports.int = int;
63
+ exports.float32 = float32;
64
+ exports.float64 = float64;
65
+ exports.int32 = int32;
66
+ exports.uint32 = uint32;
67
+ exports.boolean = boolean;
68
+ exports.bigint = bigint;
69
+ exports.int64 = int64;
70
+ exports.uint64 = uint64;
71
+ exports.symbol = symbol;
72
+ exports.undefined = _undefined;
73
+ exports.null = _null;
74
+ exports.any = any;
75
+ exports.unknown = unknown;
76
+ exports.never = never;
77
+ exports.void = _void;
78
+ exports.date = date;
79
+ exports.array = array;
80
+ exports.keyof = keyof;
81
+ exports.object = object;
82
+ exports.strictObject = strictObject;
83
+ exports.looseObject = looseObject;
84
+ exports.union = union;
85
+ exports.discriminatedUnion = discriminatedUnion;
86
+ exports.intersection = intersection;
87
+ exports.tuple = tuple;
88
+ exports.record = record;
89
+ exports.partialRecord = partialRecord;
90
+ exports.map = map;
91
+ exports.set = set;
92
+ exports.enum = _enum;
93
+ exports.nativeEnum = nativeEnum;
94
+ exports.literal = literal;
95
+ exports.file = file;
96
+ exports.transform = transform;
97
+ exports.optional = optional;
98
+ exports.nullable = nullable;
99
+ exports.nullish = nullish;
100
+ exports._default = _default;
101
+ exports.prefault = prefault;
102
+ exports.nonoptional = nonoptional;
103
+ exports.success = success;
104
+ exports.catch = _catch;
105
+ exports.nan = nan;
106
+ exports.pipe = pipe;
107
+ exports.readonly = readonly;
108
+ exports.templateLiteral = templateLiteral;
109
+ exports.lazy = lazy;
110
+ exports.promise = promise;
111
+ exports.check = check;
112
+ exports.custom = custom;
113
+ exports.refine = refine;
114
+ exports.superRefine = superRefine;
115
+ exports.instanceof = _instanceof;
116
+ exports.json = json;
117
+ exports.preprocess = preprocess;
118
+ const core = __importStar(require("zod/v4/core"));
119
+ const core_1 = require("zod/v4/core");
120
+ const checks = __importStar(require("./checks.js"));
121
+ const iso = __importStar(require("./iso.js"));
122
+ const parse = __importStar(require("./parse.js"));
123
+ exports.iso = __importStar(require("./iso.js"));
124
+ exports.coerce = __importStar(require("./coerce.js"));
125
+ exports.ZodType = core.$constructor("ZodType", (inst, def) => {
126
+ core.$ZodType.init(inst, def);
127
+ inst.def = def;
128
+ inst._def = def;
129
+ // base methods
130
+ inst.check = (...checks) => {
131
+ return inst.clone({
132
+ ...def,
133
+ checks: [
134
+ ...(def.checks ?? []),
135
+ ...checks.map((ch) => typeof ch === "function" ? { _zod: { check: ch, def: { check: "custom" }, onattach: [] } } : ch),
136
+ ],
137
+ }
138
+ // { parent: true }
139
+ );
140
+ };
141
+ inst.clone = (def, params) => core.clone(inst, def, params);
142
+ inst.brand = () => inst;
143
+ inst.register = ((reg, meta) => {
144
+ reg.add(inst, meta);
145
+ return inst;
146
+ });
147
+ // const parse: <T extends core.$ZodType>(
148
+ // schema: T,
149
+ // value: unknown,
150
+ // _ctx?: core.ParseContext<core.$ZodIssue>
151
+ // ) => core.output<T> = /* @__PURE__ */ core._parse(ZodError, parse) as any;
152
+ // const safeParse: <T extends core.$ZodType>(
153
+ // schema: T,
154
+ // value: unknown,
155
+ // _ctx?: core.ParseContext<core.$ZodIssue>
156
+ // ) => ZodSafeParseResult<core.output<T>> = /* @__PURE__ */ core._safeParse(ZodError) as any;
157
+ // const parseAsync: <T extends core.$ZodType>(
158
+ // schema: T,
159
+ // value: unknown,
160
+ // _ctx?: core.ParseContext<core.$ZodIssue>
161
+ // ) => Promise<core.output<T>> = /* @__PURE__ */ core._parseAsync(ZodError) as any;
162
+ // const safeParseAsync: <T extends core.$ZodType>(
163
+ // schema: T,
164
+ // value: unknown,
165
+ // _ctx?: core.ParseContext<core.$ZodIssue>
166
+ // ) => Promise<ZodSafeParseResult<core.output<T>>> = /* @__PURE__ */ core._safeParseAsync(ZodError) as any;
167
+ // parsing
168
+ inst.parse = (data, params) => parse.parse(inst, data, params, { callee: inst.parse });
169
+ inst.safeParse = (data, params) => parse.safeParse(inst, data, params);
170
+ inst.parseAsync = async (data, params) => parse.parseAsync(inst, data, params, { callee: inst.parseAsync });
171
+ inst.safeParseAsync = async (data, params) => parse.safeParseAsync(inst, data, params);
172
+ inst.spa = inst.safeParseAsync;
173
+ // refinements
174
+ inst.refine = (check, params) => inst.check(refine(check, params));
175
+ inst.superRefine = (refinement) => inst.check(superRefine(refinement));
176
+ inst.overwrite = (fn) => inst.check(checks.overwrite(fn));
177
+ // wrappers
178
+ inst.optional = () => optional(inst);
179
+ inst.nullable = () => nullable(inst);
180
+ inst.nullish = () => optional(nullable(inst));
181
+ inst.nonoptional = (params) => nonoptional(inst, params);
182
+ inst.array = () => array(inst);
183
+ inst.or = (arg) => union([inst, arg]);
184
+ inst.and = (arg) => intersection(inst, arg);
185
+ inst.transform = (tx) => pipe(inst, transform(tx));
186
+ inst.default = (def) => _default(inst, def);
187
+ inst.prefault = (def) => prefault(inst, def);
188
+ // inst.coalesce = (def, params) => coalesce(inst, def, params);
189
+ inst.catch = (params) => _catch(inst, params);
190
+ inst.pipe = (target) => pipe(inst, target);
191
+ inst.readonly = () => readonly(inst);
192
+ // meta
193
+ inst.describe = (description) => {
194
+ const cl = inst.clone();
195
+ core.globalRegistry.add(cl, { description });
196
+ return cl;
197
+ };
198
+ Object.defineProperty(inst, "description", {
199
+ get() {
200
+ return core.globalRegistry.get(inst)?.description;
201
+ },
202
+ configurable: true,
203
+ });
204
+ inst.meta = (...args) => {
205
+ if (args.length === 0) {
206
+ return core.globalRegistry.get(inst);
207
+ }
208
+ const cl = inst.clone();
209
+ core.globalRegistry.add(cl, args[0]);
210
+ return cl;
211
+ };
212
+ // helpers
213
+ inst.isOptional = () => inst.safeParse(undefined).success;
214
+ inst.isNullable = () => inst.safeParse(null).success;
215
+ return inst;
216
+ });
217
+ /** @internal */
218
+ exports._ZodString = core.$constructor("_ZodString", (inst, def) => {
219
+ core.$ZodString.init(inst, def);
220
+ exports.ZodType.init(inst, def);
221
+ const bag = inst._zod.bag;
222
+ inst.format = bag.format ?? null;
223
+ inst.minLength = bag.minimum ?? null;
224
+ inst.maxLength = bag.maximum ?? null;
225
+ // validations
226
+ inst.regex = (...args) => inst.check(checks.regex(...args));
227
+ inst.includes = (...args) => inst.check(checks.includes(...args));
228
+ inst.startsWith = (params) => inst.check(checks.startsWith(params));
229
+ inst.endsWith = (params) => inst.check(checks.endsWith(params));
230
+ inst.min = (...args) => inst.check(checks.minLength(...args));
231
+ inst.max = (...args) => inst.check(checks.maxLength(...args));
232
+ inst.length = (...args) => inst.check(checks.length(...args));
233
+ inst.nonempty = (...args) => inst.check(checks.minLength(1, ...args));
234
+ inst.lowercase = (params) => inst.check(checks.lowercase(params));
235
+ inst.uppercase = (params) => inst.check(checks.uppercase(params));
236
+ // transforms
237
+ inst.trim = () => inst.check(checks.trim());
238
+ inst.normalize = (...args) => inst.check(checks.normalize(...args));
239
+ inst.toLowerCase = () => inst.check(checks.toLowerCase());
240
+ inst.toUpperCase = () => inst.check(checks.toUpperCase());
241
+ });
242
+ exports.ZodString = core.$constructor("ZodString", (inst, def) => {
243
+ core.$ZodString.init(inst, def);
244
+ exports._ZodString.init(inst, def);
245
+ inst.email = (params) => inst.check(core._email(exports.ZodEmail, params));
246
+ inst.url = (params) => inst.check(core._url(exports.ZodURL, params));
247
+ inst.jwt = (params) => inst.check(core._jwt(exports.ZodJWT, params));
248
+ inst.emoji = (params) => inst.check(core._emoji(exports.ZodEmoji, params));
249
+ inst.guid = (params) => inst.check(core._guid(exports.ZodGUID, params));
250
+ inst.uuid = (params) => inst.check(core._uuid(exports.ZodUUID, params));
251
+ inst.uuidv4 = (params) => inst.check(core._uuidv4(exports.ZodUUID, params));
252
+ inst.uuidv6 = (params) => inst.check(core._uuidv6(exports.ZodUUID, params));
253
+ inst.uuidv7 = (params) => inst.check(core._uuidv7(exports.ZodUUID, params));
254
+ inst.nanoid = (params) => inst.check(core._nanoid(exports.ZodNanoID, params));
255
+ inst.guid = (params) => inst.check(core._guid(exports.ZodGUID, params));
256
+ inst.cuid = (params) => inst.check(core._cuid(exports.ZodCUID, params));
257
+ inst.cuid2 = (params) => inst.check(core._cuid2(exports.ZodCUID2, params));
258
+ inst.ulid = (params) => inst.check(core._ulid(exports.ZodULID, params));
259
+ inst.base64 = (params) => inst.check(core._base64(exports.ZodBase64, params));
260
+ inst.base64url = (params) => inst.check(core._base64url(exports.ZodBase64URL, params));
261
+ inst.xid = (params) => inst.check(core._xid(exports.ZodXID, params));
262
+ inst.ksuid = (params) => inst.check(core._ksuid(exports.ZodKSUID, params));
263
+ inst.ipv4 = (params) => inst.check(core._ipv4(exports.ZodIPv4, params));
264
+ inst.ipv6 = (params) => inst.check(core._ipv6(exports.ZodIPv6, params));
265
+ inst.cidrv4 = (params) => inst.check(core._cidrv4(exports.ZodCIDRv4, params));
266
+ inst.cidrv6 = (params) => inst.check(core._cidrv6(exports.ZodCIDRv6, params));
267
+ inst.e164 = (params) => inst.check(core._e164(exports.ZodE164, params));
268
+ // iso
269
+ inst.datetime = (params) => inst.check(iso.datetime(params));
270
+ inst.date = (params) => inst.check(iso.date(params));
271
+ inst.time = (params) => inst.check(iso.time(params));
272
+ inst.duration = (params) => inst.check(iso.duration(params));
273
+ });
274
+ function string(params) {
275
+ return core._string(exports.ZodString, params);
276
+ }
277
+ exports.ZodStringFormat = core.$constructor("ZodStringFormat", (inst, def) => {
278
+ core.$ZodStringFormat.init(inst, def);
279
+ exports._ZodString.init(inst, def);
280
+ });
281
+ exports.ZodEmail = core.$constructor("ZodEmail", (inst, def) => {
282
+ // ZodStringFormat.init(inst, def);
283
+ core.$ZodEmail.init(inst, def);
284
+ exports.ZodStringFormat.init(inst, def);
285
+ });
286
+ function email(params) {
287
+ return core._email(exports.ZodEmail, params);
288
+ }
289
+ exports.ZodGUID = core.$constructor("ZodGUID", (inst, def) => {
290
+ // ZodStringFormat.init(inst, def);
291
+ core.$ZodGUID.init(inst, def);
292
+ exports.ZodStringFormat.init(inst, def);
293
+ });
294
+ function guid(params) {
295
+ return core._guid(exports.ZodGUID, params);
296
+ }
297
+ exports.ZodUUID = core.$constructor("ZodUUID", (inst, def) => {
298
+ // ZodStringFormat.init(inst, def);
299
+ core.$ZodUUID.init(inst, def);
300
+ exports.ZodStringFormat.init(inst, def);
301
+ });
302
+ function uuid(params) {
303
+ return core._uuid(exports.ZodUUID, params);
304
+ }
305
+ function uuidv4(params) {
306
+ return core._uuidv4(exports.ZodUUID, params);
307
+ }
308
+ // ZodUUIDv6
309
+ function uuidv6(params) {
310
+ return core._uuidv6(exports.ZodUUID, params);
311
+ }
312
+ // ZodUUIDv7
313
+ function uuidv7(params) {
314
+ return core._uuidv7(exports.ZodUUID, params);
315
+ }
316
+ exports.ZodURL = core.$constructor("ZodURL", (inst, def) => {
317
+ // ZodStringFormat.init(inst, def);
318
+ core.$ZodURL.init(inst, def);
319
+ exports.ZodStringFormat.init(inst, def);
320
+ });
321
+ function url(params) {
322
+ return core._url(exports.ZodURL, params);
323
+ }
324
+ exports.ZodEmoji = core.$constructor("ZodEmoji", (inst, def) => {
325
+ // ZodStringFormat.init(inst, def);
326
+ core.$ZodEmoji.init(inst, def);
327
+ exports.ZodStringFormat.init(inst, def);
328
+ });
329
+ function emoji(params) {
330
+ return core._emoji(exports.ZodEmoji, params);
331
+ }
332
+ exports.ZodNanoID = core.$constructor("ZodNanoID", (inst, def) => {
333
+ // ZodStringFormat.init(inst, def);
334
+ core.$ZodNanoID.init(inst, def);
335
+ exports.ZodStringFormat.init(inst, def);
336
+ });
337
+ function nanoid(params) {
338
+ return core._nanoid(exports.ZodNanoID, params);
339
+ }
340
+ exports.ZodCUID = core.$constructor("ZodCUID", (inst, def) => {
341
+ // ZodStringFormat.init(inst, def);
342
+ core.$ZodCUID.init(inst, def);
343
+ exports.ZodStringFormat.init(inst, def);
344
+ });
345
+ function cuid(params) {
346
+ return core._cuid(exports.ZodCUID, params);
347
+ }
348
+ exports.ZodCUID2 = core.$constructor("ZodCUID2", (inst, def) => {
349
+ // ZodStringFormat.init(inst, def);
350
+ core.$ZodCUID2.init(inst, def);
351
+ exports.ZodStringFormat.init(inst, def);
352
+ });
353
+ function cuid2(params) {
354
+ return core._cuid2(exports.ZodCUID2, params);
355
+ }
356
+ exports.ZodULID = core.$constructor("ZodULID", (inst, def) => {
357
+ // ZodStringFormat.init(inst, def);
358
+ core.$ZodULID.init(inst, def);
359
+ exports.ZodStringFormat.init(inst, def);
360
+ });
361
+ function ulid(params) {
362
+ return core._ulid(exports.ZodULID, params);
363
+ }
364
+ exports.ZodXID = core.$constructor("ZodXID", (inst, def) => {
365
+ // ZodStringFormat.init(inst, def);
366
+ core.$ZodXID.init(inst, def);
367
+ exports.ZodStringFormat.init(inst, def);
368
+ });
369
+ function xid(params) {
370
+ return core._xid(exports.ZodXID, params);
371
+ }
372
+ exports.ZodKSUID = core.$constructor("ZodKSUID", (inst, def) => {
373
+ // ZodStringFormat.init(inst, def);
374
+ core.$ZodKSUID.init(inst, def);
375
+ exports.ZodStringFormat.init(inst, def);
376
+ });
377
+ function ksuid(params) {
378
+ return core._ksuid(exports.ZodKSUID, params);
379
+ }
380
+ exports.ZodIPv4 = core.$constructor("ZodIPv4", (inst, def) => {
381
+ // ZodStringFormat.init(inst, def);
382
+ core.$ZodIPv4.init(inst, def);
383
+ exports.ZodStringFormat.init(inst, def);
384
+ });
385
+ function ipv4(params) {
386
+ return core._ipv4(exports.ZodIPv4, params);
387
+ }
388
+ exports.ZodIPv6 = core.$constructor("ZodIPv6", (inst, def) => {
389
+ // ZodStringFormat.init(inst, def);
390
+ core.$ZodIPv6.init(inst, def);
391
+ exports.ZodStringFormat.init(inst, def);
392
+ });
393
+ function ipv6(params) {
394
+ return core._ipv6(exports.ZodIPv6, params);
395
+ }
396
+ exports.ZodCIDRv4 = core.$constructor("ZodCIDRv4", (inst, def) => {
397
+ core.$ZodCIDRv4.init(inst, def);
398
+ exports.ZodStringFormat.init(inst, def);
399
+ });
400
+ function cidrv4(params) {
401
+ return core._cidrv4(exports.ZodCIDRv4, params);
402
+ }
403
+ exports.ZodCIDRv6 = core.$constructor("ZodCIDRv6", (inst, def) => {
404
+ core.$ZodCIDRv6.init(inst, def);
405
+ exports.ZodStringFormat.init(inst, def);
406
+ });
407
+ function cidrv6(params) {
408
+ return core._cidrv6(exports.ZodCIDRv6, params);
409
+ }
410
+ exports.ZodBase64 = core.$constructor("ZodBase64", (inst, def) => {
411
+ // ZodStringFormat.init(inst, def);
412
+ core.$ZodBase64.init(inst, def);
413
+ exports.ZodStringFormat.init(inst, def);
414
+ });
415
+ function base64(params) {
416
+ return core._base64(exports.ZodBase64, params);
417
+ }
418
+ exports.ZodBase64URL = core.$constructor("ZodBase64URL", (inst, def) => {
419
+ // ZodStringFormat.init(inst, def);
420
+ core.$ZodBase64URL.init(inst, def);
421
+ exports.ZodStringFormat.init(inst, def);
422
+ });
423
+ function base64url(params) {
424
+ return core._base64url(exports.ZodBase64URL, params);
425
+ }
426
+ exports.ZodE164 = core.$constructor("ZodE164", (inst, def) => {
427
+ // ZodStringFormat.init(inst, def);
428
+ core.$ZodE164.init(inst, def);
429
+ exports.ZodStringFormat.init(inst, def);
430
+ });
431
+ function e164(params) {
432
+ return core._e164(exports.ZodE164, params);
433
+ }
434
+ exports.ZodJWT = core.$constructor("ZodJWT", (inst, def) => {
435
+ // ZodStringFormat.init(inst, def);
436
+ core.$ZodJWT.init(inst, def);
437
+ exports.ZodStringFormat.init(inst, def);
438
+ });
439
+ function jwt(params) {
440
+ return core._jwt(exports.ZodJWT, params);
441
+ }
442
+ exports.ZodNumber = core.$constructor("ZodNumber", (inst, def) => {
443
+ core.$ZodNumber.init(inst, def);
444
+ exports.ZodType.init(inst, def);
445
+ inst.gt = (value, params) => inst.check(checks.gt(value, params));
446
+ inst.gte = (value, params) => inst.check(checks.gte(value, params));
447
+ inst.min = (value, params) => inst.check(checks.gte(value, params));
448
+ inst.lt = (value, params) => inst.check(checks.lt(value, params));
449
+ inst.lte = (value, params) => inst.check(checks.lte(value, params));
450
+ inst.max = (value, params) => inst.check(checks.lte(value, params));
451
+ inst.int = (params) => inst.check(int(params));
452
+ inst.safe = (params) => inst.check(int(params));
453
+ inst.positive = (params) => inst.check(checks.gt(0, params));
454
+ inst.nonnegative = (params) => inst.check(checks.gte(0, params));
455
+ inst.negative = (params) => inst.check(checks.lt(0, params));
456
+ inst.nonpositive = (params) => inst.check(checks.lte(0, params));
457
+ inst.multipleOf = (value, params) => inst.check(checks.multipleOf(value, params));
458
+ inst.step = (value, params) => inst.check(checks.multipleOf(value, params));
459
+ // inst.finite = (params) => inst.check(core.finite(params));
460
+ inst.finite = () => inst;
461
+ const bag = inst._zod.bag;
462
+ inst.minValue =
463
+ Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null;
464
+ inst.maxValue =
465
+ Math.min(bag.maximum ?? Number.POSITIVE_INFINITY, bag.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null;
466
+ inst.isInt = (bag.format ?? "").includes("int") || Number.isSafeInteger(bag.multipleOf ?? 0.5);
467
+ inst.isFinite = true;
468
+ inst.format = bag.format ?? null;
469
+ });
470
+ function number(params) {
471
+ return core._number(exports.ZodNumber, params);
472
+ }
473
+ exports.ZodNumberFormat = core.$constructor("ZodNumberFormat", (inst, def) => {
474
+ core.$ZodNumberFormat.init(inst, def);
475
+ exports.ZodNumber.init(inst, def);
476
+ });
477
+ function int(params) {
478
+ return core._int(exports.ZodNumberFormat, params);
479
+ }
480
+ function float32(params) {
481
+ return core._float32(exports.ZodNumberFormat, params);
482
+ }
483
+ function float64(params) {
484
+ return core._float64(exports.ZodNumberFormat, params);
485
+ }
486
+ function int32(params) {
487
+ return core._int32(exports.ZodNumberFormat, params);
488
+ }
489
+ function uint32(params) {
490
+ return core._uint32(exports.ZodNumberFormat, params);
491
+ }
492
+ exports.ZodBoolean = core.$constructor("ZodBoolean", (inst, def) => {
493
+ core.$ZodBoolean.init(inst, def);
494
+ exports.ZodType.init(inst, def);
495
+ });
496
+ function boolean(params) {
497
+ return core._boolean(exports.ZodBoolean, params);
498
+ }
499
+ exports.ZodBigInt = core.$constructor("ZodBigInt", (inst, def) => {
500
+ core.$ZodBigInt.init(inst, def);
501
+ exports.ZodType.init(inst, def);
502
+ inst.gte = (value, params) => inst.check(checks.gte(value, params));
503
+ inst.min = (value, params) => inst.check(checks.gte(value, params));
504
+ inst.gt = (value, params) => inst.check(checks.gt(value, params));
505
+ inst.gte = (value, params) => inst.check(checks.gte(value, params));
506
+ inst.min = (value, params) => inst.check(checks.gte(value, params));
507
+ inst.lt = (value, params) => inst.check(checks.lt(value, params));
508
+ inst.lte = (value, params) => inst.check(checks.lte(value, params));
509
+ inst.max = (value, params) => inst.check(checks.lte(value, params));
510
+ inst.positive = (params) => inst.check(checks.gt(BigInt(0), params));
511
+ inst.negative = (params) => inst.check(checks.lt(BigInt(0), params));
512
+ inst.nonpositive = (params) => inst.check(checks.lte(BigInt(0), params));
513
+ inst.nonnegative = (params) => inst.check(checks.gte(BigInt(0), params));
514
+ inst.multipleOf = (value, params) => inst.check(checks.multipleOf(value, params));
515
+ const bag = inst._zod.bag;
516
+ inst.minValue = bag.minimum ?? null;
517
+ inst.maxValue = bag.maximum ?? null;
518
+ inst.format = bag.format ?? null;
519
+ });
520
+ function bigint(params) {
521
+ return core._bigint(exports.ZodBigInt, params);
522
+ }
523
+ exports.ZodBigIntFormat = core.$constructor("ZodBigIntFormat", (inst, def) => {
524
+ core.$ZodBigIntFormat.init(inst, def);
525
+ exports.ZodBigInt.init(inst, def);
526
+ });
527
+ // int64
528
+ function int64(params) {
529
+ return core._int64(exports.ZodBigIntFormat, params);
530
+ }
531
+ // uint64
532
+ function uint64(params) {
533
+ return core._uint64(exports.ZodBigIntFormat, params);
534
+ }
535
+ exports.ZodSymbol = core.$constructor("ZodSymbol", (inst, def) => {
536
+ core.$ZodSymbol.init(inst, def);
537
+ exports.ZodType.init(inst, def);
538
+ });
539
+ function symbol(params) {
540
+ return core._symbol(exports.ZodSymbol, params);
541
+ }
542
+ exports.ZodUndefined = core.$constructor("ZodUndefined", (inst, def) => {
543
+ core.$ZodUndefined.init(inst, def);
544
+ exports.ZodType.init(inst, def);
545
+ });
546
+ function _undefined(params) {
547
+ return core._undefined(exports.ZodUndefined, params);
548
+ }
549
+ exports.ZodNull = core.$constructor("ZodNull", (inst, def) => {
550
+ core.$ZodNull.init(inst, def);
551
+ exports.ZodType.init(inst, def);
552
+ });
553
+ function _null(params) {
554
+ return core._null(exports.ZodNull, params);
555
+ }
556
+ exports.ZodAny = core.$constructor("ZodAny", (inst, def) => {
557
+ core.$ZodAny.init(inst, def);
558
+ exports.ZodType.init(inst, def);
559
+ });
560
+ function any() {
561
+ return core._any(exports.ZodAny);
562
+ }
563
+ exports.ZodUnknown = core.$constructor("ZodUnknown", (inst, def) => {
564
+ core.$ZodUnknown.init(inst, def);
565
+ exports.ZodType.init(inst, def);
566
+ });
567
+ function unknown() {
568
+ return core._unknown(exports.ZodUnknown);
569
+ }
570
+ exports.ZodNever = core.$constructor("ZodNever", (inst, def) => {
571
+ core.$ZodNever.init(inst, def);
572
+ exports.ZodType.init(inst, def);
573
+ });
574
+ function never(params) {
575
+ return core._never(exports.ZodNever, params);
576
+ }
577
+ exports.ZodVoid = core.$constructor("ZodVoid", (inst, def) => {
578
+ core.$ZodVoid.init(inst, def);
579
+ exports.ZodType.init(inst, def);
580
+ });
581
+ function _void(params) {
582
+ return core._void(exports.ZodVoid, params);
583
+ }
584
+ exports.ZodDate = core.$constructor("ZodDate", (inst, def) => {
585
+ core.$ZodDate.init(inst, def);
586
+ exports.ZodType.init(inst, def);
587
+ inst.min = (value, params) => inst.check(checks.gte(value, params));
588
+ inst.max = (value, params) => inst.check(checks.lte(value, params));
589
+ const c = inst._zod.bag;
590
+ inst.minDate = c.minimum ? new Date(c.minimum) : null;
591
+ inst.maxDate = c.maximum ? new Date(c.maximum) : null;
592
+ });
593
+ function date(params) {
594
+ return core._date(exports.ZodDate, params);
595
+ }
596
+ exports.ZodArray = core.$constructor("ZodArray", (inst, def) => {
597
+ core.$ZodArray.init(inst, def);
598
+ exports.ZodType.init(inst, def);
599
+ inst.element = def.element;
600
+ inst.min = (minLength, params) => inst.check(checks.minLength(minLength, params));
601
+ inst.nonempty = (params) => inst.check(checks.minLength(1, params));
602
+ inst.max = (maxLength, params) => inst.check(checks.maxLength(maxLength, params));
603
+ inst.length = (len, params) => inst.check(checks.length(len, params));
604
+ });
605
+ function array(element, params) {
606
+ return core._array(exports.ZodArray, element, params);
607
+ }
608
+ // .keyof
609
+ function keyof(schema) {
610
+ const shape = schema._zod.def.shape;
611
+ return literal(Object.keys(shape));
612
+ }
613
+ exports.ZodObject = core.$constructor("ZodObject", (inst, def) => {
614
+ core.$ZodObject.init(inst, def);
615
+ exports.ZodType.init(inst, def);
616
+ core_1.util.defineLazy(inst, "shape", () => {
617
+ return Object.fromEntries(Object.entries(inst._zod.def.shape));
618
+ });
619
+ inst.keyof = () => _enum(Object.keys(inst._zod.def.shape));
620
+ inst.catchall = (catchall) => inst.clone({ ...inst._zod.def, catchall });
621
+ inst.passthrough = () => inst.clone({ ...inst._zod.def, catchall: unknown() });
622
+ // inst.nonstrict = () => inst.clone({ ...inst._zod.def, catchall: api.unknown() });
623
+ inst.loose = () => inst.clone({ ...inst._zod.def, catchall: unknown() });
624
+ inst.strict = () => inst.clone({ ...inst._zod.def, catchall: never() });
625
+ inst.strip = () => inst.clone({ ...inst._zod.def, catchall: undefined });
626
+ inst.extend = (incoming) => {
627
+ return core_1.util.extend(inst, incoming);
628
+ };
629
+ inst.merge = (other) => core_1.util.merge(inst, other);
630
+ inst.pick = (mask) => core_1.util.pick(inst, mask);
631
+ inst.omit = (mask) => core_1.util.omit(inst, mask);
632
+ inst.partial = (...args) => core_1.util.partial(exports.ZodOptional, inst, args[0]);
633
+ inst.required = (...args) => core_1.util.required(exports.ZodNonOptional, inst, args[0]);
634
+ });
635
+ function object(shape, params) {
636
+ const def = {
637
+ type: "object",
638
+ get shape() {
639
+ core_1.util.assignProp(this, "shape", { ...shape });
640
+ return this.shape;
641
+ },
642
+ ...core_1.util.normalizeParams(params),
643
+ };
644
+ return new exports.ZodObject(def);
645
+ }
646
+ // strictObject
647
+ function strictObject(shape, params) {
648
+ return new exports.ZodObject({
649
+ type: "object",
650
+ get shape() {
651
+ core_1.util.assignProp(this, "shape", { ...shape });
652
+ return this.shape;
653
+ },
654
+ catchall: never(),
655
+ ...core_1.util.normalizeParams(params),
656
+ });
657
+ }
658
+ // looseObject
659
+ function looseObject(shape, params) {
660
+ return new exports.ZodObject({
661
+ type: "object",
662
+ get shape() {
663
+ core_1.util.assignProp(this, "shape", { ...shape });
664
+ return this.shape;
665
+ },
666
+ catchall: unknown(),
667
+ ...core_1.util.normalizeParams(params),
668
+ });
669
+ }
670
+ exports.ZodUnion = core.$constructor("ZodUnion", (inst, def) => {
671
+ core.$ZodUnion.init(inst, def);
672
+ exports.ZodType.init(inst, def);
673
+ inst.options = def.options;
674
+ });
675
+ function union(options, params) {
676
+ return new exports.ZodUnion({
677
+ type: "union",
678
+ options,
679
+ ...core_1.util.normalizeParams(params),
680
+ });
681
+ }
682
+ exports.ZodDiscriminatedUnion = core.$constructor("ZodDiscriminatedUnion", (inst, def) => {
683
+ exports.ZodUnion.init(inst, def);
684
+ core.$ZodDiscriminatedUnion.init(inst, def);
685
+ });
686
+ function discriminatedUnion(discriminator, options, params) {
687
+ // const [options, params] = args;
688
+ return new exports.ZodDiscriminatedUnion({
689
+ type: "union",
690
+ options,
691
+ discriminator,
692
+ ...core_1.util.normalizeParams(params),
693
+ });
694
+ }
695
+ exports.ZodIntersection = core.$constructor("ZodIntersection", (inst, def) => {
696
+ core.$ZodIntersection.init(inst, def);
697
+ exports.ZodType.init(inst, def);
698
+ });
699
+ function intersection(left, right) {
700
+ return new exports.ZodIntersection({
701
+ type: "intersection",
702
+ left,
703
+ right,
704
+ });
705
+ }
706
+ exports.ZodTuple = core.$constructor("ZodTuple", (inst, def) => {
707
+ core.$ZodTuple.init(inst, def);
708
+ exports.ZodType.init(inst, def);
709
+ inst.rest = (rest) => inst.clone({
710
+ ...inst._zod.def,
711
+ rest,
712
+ });
713
+ });
714
+ function tuple(items, _paramsOrRest, _params) {
715
+ const hasRest = _paramsOrRest instanceof core.$ZodType;
716
+ const params = hasRest ? _params : _paramsOrRest;
717
+ const rest = hasRest ? _paramsOrRest : null;
718
+ return new exports.ZodTuple({
719
+ type: "tuple",
720
+ items,
721
+ rest,
722
+ ...core_1.util.normalizeParams(params),
723
+ });
724
+ }
725
+ exports.ZodRecord = core.$constructor("ZodRecord", (inst, def) => {
726
+ core.$ZodRecord.init(inst, def);
727
+ exports.ZodType.init(inst, def);
728
+ inst.keyType = def.keyType;
729
+ inst.valueType = def.valueType;
730
+ });
731
+ function record(keyType, valueType, params) {
732
+ return new exports.ZodRecord({
733
+ type: "record",
734
+ keyType,
735
+ valueType,
736
+ ...core_1.util.normalizeParams(params),
737
+ });
738
+ }
739
+ function partialRecord(keyType, valueType, params) {
740
+ return new exports.ZodRecord({
741
+ type: "record",
742
+ keyType: union([keyType, never()]),
743
+ valueType,
744
+ ...core_1.util.normalizeParams(params),
745
+ });
746
+ }
747
+ exports.ZodMap = core.$constructor("ZodMap", (inst, def) => {
748
+ core.$ZodMap.init(inst, def);
749
+ exports.ZodType.init(inst, def);
750
+ inst.keyType = def.keyType;
751
+ inst.valueType = def.valueType;
752
+ });
753
+ function map(keyType, valueType, params) {
754
+ return new exports.ZodMap({
755
+ type: "map",
756
+ keyType,
757
+ valueType,
758
+ ...core_1.util.normalizeParams(params),
759
+ });
760
+ }
761
+ exports.ZodSet = core.$constructor("ZodSet", (inst, def) => {
762
+ core.$ZodSet.init(inst, def);
763
+ exports.ZodType.init(inst, def);
764
+ inst.min = (...args) => inst.check(core._minSize(...args));
765
+ inst.nonempty = (params) => inst.check(core._minSize(1, params));
766
+ inst.max = (...args) => inst.check(core._maxSize(...args));
767
+ inst.size = (...args) => inst.check(core._size(...args));
768
+ });
769
+ function set(valueType, params) {
770
+ return new exports.ZodSet({
771
+ type: "set",
772
+ valueType,
773
+ ...core_1.util.normalizeParams(params),
774
+ });
775
+ }
776
+ exports.ZodEnum = core.$constructor("ZodEnum", (inst, def) => {
777
+ core.$ZodEnum.init(inst, def);
778
+ exports.ZodType.init(inst, def);
779
+ inst.enum = def.entries;
780
+ inst.options = Object.values(def.entries);
781
+ const keys = new Set(Object.keys(def.entries));
782
+ inst.extract = (values, params) => {
783
+ const newEntries = {};
784
+ for (const value of values) {
785
+ if (keys.has(value)) {
786
+ newEntries[value] = def.entries[value];
787
+ }
788
+ else
789
+ throw new Error(`Key ${value} not found in enum`);
790
+ }
791
+ return new exports.ZodEnum({
792
+ ...def,
793
+ checks: [],
794
+ ...core_1.util.normalizeParams(params),
795
+ entries: newEntries,
796
+ });
797
+ };
798
+ inst.exclude = (values, params) => {
799
+ const newEntries = { ...def.entries };
800
+ for (const value of values) {
801
+ if (keys.has(value)) {
802
+ delete newEntries[value];
803
+ }
804
+ else
805
+ throw new Error(`Key ${value} not found in enum`);
806
+ }
807
+ return new exports.ZodEnum({
808
+ ...def,
809
+ checks: [],
810
+ ...core_1.util.normalizeParams(params),
811
+ entries: newEntries,
812
+ });
813
+ };
814
+ });
815
+ function _enum(values, params) {
816
+ const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;
817
+ return new exports.ZodEnum({
818
+ type: "enum",
819
+ entries,
820
+ ...core_1.util.normalizeParams(params),
821
+ });
822
+ }
823
+ /** @deprecated This API has been merged into `z.enum()`. Use `z.enum()` instead.
824
+ *
825
+ * ```ts
826
+ * enum Colors { red, green, blue }
827
+ * z.enum(Colors);
828
+ * ```
829
+ */
830
+ function nativeEnum(entries, params) {
831
+ return new exports.ZodEnum({
832
+ type: "enum",
833
+ entries,
834
+ ...core_1.util.normalizeParams(params),
835
+ });
836
+ }
837
+ exports.ZodLiteral = core.$constructor("ZodLiteral", (inst, def) => {
838
+ core.$ZodLiteral.init(inst, def);
839
+ exports.ZodType.init(inst, def);
840
+ inst.values = new Set(def.values);
841
+ });
842
+ function literal(value, params) {
843
+ return new exports.ZodLiteral({
844
+ type: "literal",
845
+ values: Array.isArray(value) ? value : [value],
846
+ ...core_1.util.normalizeParams(params),
847
+ });
848
+ }
849
+ exports.ZodFile = core.$constructor("ZodFile", (inst, def) => {
850
+ core.$ZodFile.init(inst, def);
851
+ exports.ZodType.init(inst, def);
852
+ inst.min = (size, params) => inst.check(core._minSize(size, params));
853
+ inst.max = (size, params) => inst.check(core._maxSize(size, params));
854
+ inst.mime = (types, params) => inst.check(core._mime(types, params));
855
+ });
856
+ function file(params) {
857
+ return core._file(exports.ZodFile, params);
858
+ }
859
+ exports.ZodTransform = core.$constructor("ZodTransform", (inst, def) => {
860
+ core.$ZodTransform.init(inst, def);
861
+ exports.ZodType.init(inst, def);
862
+ inst._zod.parse = (payload, _ctx) => {
863
+ payload.addIssue = (issue) => {
864
+ if (typeof issue === "string") {
865
+ payload.issues.push(core_1.util.issue(issue, payload.value, def));
866
+ }
867
+ else {
868
+ // for Zod 3 backwards compatibility
869
+ const _issue = issue;
870
+ if (_issue.fatal)
871
+ _issue.continue = false;
872
+ _issue.code ?? (_issue.code = "custom");
873
+ _issue.input ?? (_issue.input = payload.value);
874
+ _issue.inst ?? (_issue.inst = inst);
875
+ _issue.continue ?? (_issue.continue = true);
876
+ payload.issues.push(core_1.util.issue(_issue));
877
+ }
878
+ };
879
+ const output = def.transform(payload.value, payload);
880
+ if (output instanceof Promise) {
881
+ return output.then((output) => {
882
+ payload.value = output;
883
+ return payload;
884
+ });
885
+ }
886
+ payload.value = output;
887
+ return payload;
888
+ };
889
+ });
890
+ function transform(fn) {
891
+ return new exports.ZodTransform({
892
+ type: "transform",
893
+ transform: fn,
894
+ });
895
+ }
896
+ exports.ZodOptional = core.$constructor("ZodOptional", (inst, def) => {
897
+ core.$ZodOptional.init(inst, def);
898
+ exports.ZodType.init(inst, def);
899
+ inst.unwrap = () => inst._zod.def.innerType;
900
+ });
901
+ function optional(innerType) {
902
+ return new exports.ZodOptional({
903
+ type: "optional",
904
+ innerType,
905
+ });
906
+ }
907
+ exports.ZodNullable = core.$constructor("ZodNullable", (inst, def) => {
908
+ core.$ZodNullable.init(inst, def);
909
+ exports.ZodType.init(inst, def);
910
+ inst.unwrap = () => inst._zod.def.innerType;
911
+ });
912
+ function nullable(innerType) {
913
+ return new exports.ZodNullable({
914
+ type: "nullable",
915
+ innerType,
916
+ });
917
+ }
918
+ // nullish
919
+ function nullish(innerType) {
920
+ return optional(nullable(innerType));
921
+ }
922
+ exports.ZodDefault = core.$constructor("ZodDefault", (inst, def) => {
923
+ core.$ZodDefault.init(inst, def);
924
+ exports.ZodType.init(inst, def);
925
+ inst.unwrap = () => inst._zod.def.innerType;
926
+ inst.removeDefault = inst.unwrap;
927
+ });
928
+ function _default(innerType, defaultValue) {
929
+ return new exports.ZodDefault({
930
+ type: "default",
931
+ innerType,
932
+ get defaultValue() {
933
+ return typeof defaultValue === "function" ? defaultValue() : defaultValue;
934
+ },
935
+ });
936
+ }
937
+ exports.ZodPrefault = core.$constructor("ZodPrefault", (inst, def) => {
938
+ core.$ZodPrefault.init(inst, def);
939
+ exports.ZodType.init(inst, def);
940
+ inst.unwrap = () => inst._zod.def.innerType;
941
+ });
942
+ function prefault(innerType, defaultValue) {
943
+ return new exports.ZodPrefault({
944
+ type: "prefault",
945
+ innerType,
946
+ get defaultValue() {
947
+ return typeof defaultValue === "function" ? defaultValue() : defaultValue;
948
+ },
949
+ });
950
+ }
951
+ exports.ZodNonOptional = core.$constructor("ZodNonOptional", (inst, def) => {
952
+ core.$ZodNonOptional.init(inst, def);
953
+ exports.ZodType.init(inst, def);
954
+ inst.unwrap = () => inst._zod.def.innerType;
955
+ });
956
+ function nonoptional(innerType, params) {
957
+ return new exports.ZodNonOptional({
958
+ type: "nonoptional",
959
+ innerType,
960
+ ...core_1.util.normalizeParams(params),
961
+ });
962
+ }
963
+ exports.ZodSuccess = core.$constructor("ZodSuccess", (inst, def) => {
964
+ core.$ZodSuccess.init(inst, def);
965
+ exports.ZodType.init(inst, def);
966
+ inst.unwrap = () => inst._zod.def.innerType;
967
+ });
968
+ function success(innerType) {
969
+ return new exports.ZodSuccess({
970
+ type: "success",
971
+ innerType,
972
+ });
973
+ }
974
+ exports.ZodCatch = core.$constructor("ZodCatch", (inst, def) => {
975
+ core.$ZodCatch.init(inst, def);
976
+ exports.ZodType.init(inst, def);
977
+ inst.unwrap = () => inst._zod.def.innerType;
978
+ inst.removeCatch = inst.unwrap;
979
+ });
980
+ function _catch(innerType, catchValue) {
981
+ return new exports.ZodCatch({
982
+ type: "catch",
983
+ innerType,
984
+ catchValue: (typeof catchValue === "function" ? catchValue : () => catchValue),
985
+ });
986
+ }
987
+ exports.ZodNaN = core.$constructor("ZodNaN", (inst, def) => {
988
+ core.$ZodNaN.init(inst, def);
989
+ exports.ZodType.init(inst, def);
990
+ });
991
+ function nan(params) {
992
+ return core._nan(exports.ZodNaN, params);
993
+ }
994
+ exports.ZodPipe = core.$constructor("ZodPipe", (inst, def) => {
995
+ core.$ZodPipe.init(inst, def);
996
+ exports.ZodType.init(inst, def);
997
+ inst.in = def.in;
998
+ inst.out = def.out;
999
+ });
1000
+ function pipe(in_, out) {
1001
+ return new exports.ZodPipe({
1002
+ type: "pipe",
1003
+ in: in_,
1004
+ out,
1005
+ // ...util.normalizeParams(params),
1006
+ });
1007
+ }
1008
+ exports.ZodReadonly = core.$constructor("ZodReadonly", (inst, def) => {
1009
+ core.$ZodReadonly.init(inst, def);
1010
+ exports.ZodType.init(inst, def);
1011
+ });
1012
+ function readonly(innerType) {
1013
+ return new exports.ZodReadonly({
1014
+ type: "readonly",
1015
+ innerType,
1016
+ });
1017
+ }
1018
+ exports.ZodTemplateLiteral = core.$constructor("ZodTemplateLiteral", (inst, def) => {
1019
+ core.$ZodTemplateLiteral.init(inst, def);
1020
+ exports.ZodType.init(inst, def);
1021
+ });
1022
+ function templateLiteral(parts, params) {
1023
+ return new exports.ZodTemplateLiteral({
1024
+ type: "template_literal",
1025
+ parts,
1026
+ ...core_1.util.normalizeParams(params),
1027
+ });
1028
+ }
1029
+ exports.ZodLazy = core.$constructor("ZodLazy", (inst, def) => {
1030
+ core.$ZodLazy.init(inst, def);
1031
+ exports.ZodType.init(inst, def);
1032
+ inst.unwrap = () => inst._zod.def.getter();
1033
+ });
1034
+ function lazy(getter) {
1035
+ return new exports.ZodLazy({
1036
+ type: "lazy",
1037
+ getter,
1038
+ });
1039
+ }
1040
+ exports.ZodPromise = core.$constructor("ZodPromise", (inst, def) => {
1041
+ core.$ZodPromise.init(inst, def);
1042
+ exports.ZodType.init(inst, def);
1043
+ inst.unwrap = () => inst._zod.def.innerType;
1044
+ });
1045
+ function promise(innerType) {
1046
+ return new exports.ZodPromise({
1047
+ type: "promise",
1048
+ innerType,
1049
+ });
1050
+ }
1051
+ exports.ZodCustom = core.$constructor("ZodCustom", (inst, def) => {
1052
+ core.$ZodCustom.init(inst, def);
1053
+ exports.ZodType.init(inst, def);
1054
+ });
1055
+ // custom checks
1056
+ function check(fn, params) {
1057
+ const ch = new core.$ZodCheck({
1058
+ check: "custom",
1059
+ ...core_1.util.normalizeParams(params),
1060
+ });
1061
+ ch._zod.check = fn;
1062
+ return ch;
1063
+ }
1064
+ function custom(fn, _params) {
1065
+ return core._custom(exports.ZodCustom, fn ?? (() => true), _params);
1066
+ }
1067
+ function refine(fn, _params = {}) {
1068
+ return core._custom(exports.ZodCustom, fn, _params);
1069
+ }
1070
+ // superRefine
1071
+ function superRefine(fn, params) {
1072
+ const ch = check((payload) => {
1073
+ payload.addIssue = (issue) => {
1074
+ if (typeof issue === "string") {
1075
+ payload.issues.push(core_1.util.issue(issue, payload.value, ch._zod.def));
1076
+ }
1077
+ else {
1078
+ // for Zod 3 backwards compatibility
1079
+ const _issue = issue;
1080
+ if (_issue.fatal)
1081
+ _issue.continue = false;
1082
+ _issue.code ?? (_issue.code = "custom");
1083
+ _issue.input ?? (_issue.input = payload.value);
1084
+ _issue.inst ?? (_issue.inst = ch);
1085
+ _issue.continue ?? (_issue.continue = !ch._zod.def.abort);
1086
+ payload.issues.push(core_1.util.issue(_issue));
1087
+ }
1088
+ };
1089
+ return fn(payload.value, payload);
1090
+ }, params);
1091
+ return ch;
1092
+ }
1093
+ function _instanceof(cls, params = {
1094
+ error: `Input not instance of ${cls.name}`,
1095
+ }) {
1096
+ const inst = new exports.ZodCustom({
1097
+ type: "custom",
1098
+ check: "custom",
1099
+ fn: (data) => data instanceof cls,
1100
+ abort: true,
1101
+ ...core_1.util.normalizeParams(params),
1102
+ });
1103
+ inst._zod.bag.Class = cls;
1104
+ return inst;
1105
+ }
1106
+ // stringbool
1107
+ exports.stringbool =
1108
+ /*@__PURE__*/ core._stringbool.bind(null, {
1109
+ Pipe: exports.ZodPipe,
1110
+ Boolean: exports.ZodBoolean,
1111
+ Unknown: exports.ZodUnknown,
1112
+ });
1113
+ function json(params) {
1114
+ const jsonSchema = lazy(() => {
1115
+ return union([string(params), number(), boolean(), _null(), array(jsonSchema), record(string(), jsonSchema)]);
1116
+ });
1117
+ return jsonSchema;
1118
+ }
1119
+ // preprocess
1120
+ // /** @deprecated Use `z.pipe()` and `z.transform()` instead. */
1121
+ function preprocess(fn, schema) {
1122
+ return pipe(transform(fn), schema);
1123
+ }