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,852 @@
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.ZodMiniTransform = exports.ZodMiniFile = exports.ZodMiniLiteral = exports.ZodMiniEnum = exports.ZodMiniSet = exports.ZodMiniMap = exports.ZodMiniRecord = exports.ZodMiniTuple = exports.ZodMiniIntersection = exports.ZodMiniDiscriminatedUnion = exports.ZodMiniUnion = exports.ZodMiniObject = exports.ZodMiniArray = exports.ZodMiniDate = exports.ZodMiniVoid = exports.ZodMiniNever = exports.ZodMiniUnknown = exports.ZodMiniAny = exports.ZodMiniNull = exports.ZodMiniUndefined = exports.ZodMiniSymbol = exports.ZodMiniBigIntFormat = exports.ZodMiniBigInt = exports.ZodMiniBoolean = exports.ZodMiniNumberFormat = exports.ZodMiniNumber = exports.ZodMiniJWT = exports.ZodMiniE164 = exports.ZodMiniBase64URL = exports.ZodMiniBase64 = exports.ZodMiniCIDRv6 = exports.ZodMiniCIDRv4 = exports.ZodMiniIPv6 = exports.ZodMiniIPv4 = exports.ZodMiniKSUID = exports.ZodMiniXID = exports.ZodMiniULID = exports.ZodMiniCUID2 = exports.ZodMiniCUID = exports.ZodMiniNanoID = exports.ZodMiniEmoji = exports.ZodMiniURL = exports.ZodMiniUUID = exports.ZodMiniGUID = exports.ZodMiniEmail = exports.ZodMiniStringFormat = exports.ZodMiniString = exports.ZodMiniType = exports.iso = exports.coerce = void 0;
37
+ exports.stringbool = exports.ZodMiniCustom = exports.ZodMiniPromise = exports.ZodMiniLazy = exports.ZodMiniTemplateLiteral = exports.ZodMiniReadonly = exports.ZodMiniPipe = exports.ZodMiniNaN = exports.ZodMiniCatch = exports.ZodMiniSuccess = exports.ZodMiniNonOptional = exports.ZodMiniPrefault = exports.ZodMiniDefault = exports.ZodMiniNullable = exports.ZodMiniOptional = void 0;
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.extend = extend;
85
+ exports.merge = merge;
86
+ exports.pick = pick;
87
+ exports.omit = omit;
88
+ exports.partial = partial;
89
+ exports.required = required;
90
+ exports.union = union;
91
+ exports.discriminatedUnion = discriminatedUnion;
92
+ exports.intersection = intersection;
93
+ exports.tuple = tuple;
94
+ exports.record = record;
95
+ exports.partialRecord = partialRecord;
96
+ exports.map = map;
97
+ exports.set = set;
98
+ exports.enum = _enum;
99
+ exports.nativeEnum = nativeEnum;
100
+ exports.literal = literal;
101
+ exports.file = file;
102
+ exports.transform = transform;
103
+ exports.optional = optional;
104
+ exports.nullable = nullable;
105
+ exports.nullish = nullish;
106
+ exports._default = _default;
107
+ exports.prefault = prefault;
108
+ exports.nonoptional = nonoptional;
109
+ exports.success = success;
110
+ exports.catch = _catch;
111
+ exports.nan = nan;
112
+ exports.pipe = pipe;
113
+ exports.readonly = readonly;
114
+ exports.templateLiteral = templateLiteral;
115
+ exports.lazy = _lazy;
116
+ exports.promise = promise;
117
+ exports.check = check;
118
+ exports.refine = refine;
119
+ exports.custom = custom;
120
+ exports.instanceof = _instanceof;
121
+ exports.json = json;
122
+ const core = __importStar(require("zod/v4/core"));
123
+ const core_1 = require("zod/v4/core");
124
+ const parse = __importStar(require("./parse.js"));
125
+ exports.coerce = __importStar(require("./coerce.js"));
126
+ exports.iso = __importStar(require("./iso.js"));
127
+ exports.ZodMiniType = core.$constructor("ZodMiniType", (inst, def) => {
128
+ if (!inst._zod)
129
+ throw new Error("Uninitialized schema in mixin ZodMiniType.");
130
+ core.$ZodType.init(inst, def);
131
+ inst.def = def;
132
+ inst.parse = (data, params) => parse.parse(inst, data, params, { callee: inst.parse });
133
+ inst.safeParse = (data, params) => parse.safeParse(inst, data, params);
134
+ inst.parseAsync = async (data, params) => parse.parseAsync(inst, data, params, { callee: inst.parseAsync });
135
+ inst.safeParseAsync = async (data, params) => parse.safeParseAsync(inst, data, params);
136
+ inst.check = (...checks) => {
137
+ return inst.clone({
138
+ ...def,
139
+ checks: [
140
+ ...(def.checks ?? []),
141
+ ...checks.map((ch) => typeof ch === "function" ? { _zod: { check: ch, def: { check: "custom" }, onattach: [] } } : ch),
142
+ ],
143
+ }
144
+ // { parent: true }
145
+ );
146
+ };
147
+ inst.clone = (_def, params) => core.clone(inst, _def, params);
148
+ inst.brand = () => inst;
149
+ inst.register = ((reg, meta) => {
150
+ reg.add(inst, meta);
151
+ return inst;
152
+ });
153
+ });
154
+ exports.ZodMiniString = core.$constructor("ZodMiniString", (inst, def) => {
155
+ core.$ZodString.init(inst, def);
156
+ exports.ZodMiniType.init(inst, def);
157
+ });
158
+ function string(params) {
159
+ return core._string(exports.ZodMiniString, params);
160
+ }
161
+ exports.ZodMiniStringFormat = core.$constructor("ZodMiniStringFormat", (inst, def) => {
162
+ core.$ZodStringFormat.init(inst, def);
163
+ exports.ZodMiniString.init(inst, def);
164
+ });
165
+ exports.ZodMiniEmail = core.$constructor("ZodMiniEmail", (inst, def) => {
166
+ core.$ZodEmail.init(inst, def);
167
+ exports.ZodMiniStringFormat.init(inst, def);
168
+ });
169
+ function email(params) {
170
+ return core._email(exports.ZodMiniEmail, params);
171
+ }
172
+ exports.ZodMiniGUID = core.$constructor("ZodMiniGUID", (inst, def) => {
173
+ core.$ZodGUID.init(inst, def);
174
+ exports.ZodMiniStringFormat.init(inst, def);
175
+ });
176
+ function guid(params) {
177
+ return core._guid(exports.ZodMiniGUID, params);
178
+ }
179
+ exports.ZodMiniUUID = core.$constructor("ZodMiniUUID", (inst, def) => {
180
+ core.$ZodUUID.init(inst, def);
181
+ exports.ZodMiniStringFormat.init(inst, def);
182
+ });
183
+ function uuid(params) {
184
+ return core._uuid(exports.ZodMiniUUID, params);
185
+ }
186
+ function uuidv4(params) {
187
+ return core._uuidv4(exports.ZodMiniUUID, params);
188
+ }
189
+ // ZodMiniUUIDv6
190
+ function uuidv6(params) {
191
+ return core._uuidv6(exports.ZodMiniUUID, params);
192
+ }
193
+ // ZodMiniUUIDv7
194
+ function uuidv7(params) {
195
+ return core._uuidv7(exports.ZodMiniUUID, params);
196
+ }
197
+ exports.ZodMiniURL = core.$constructor("ZodMiniURL", (inst, def) => {
198
+ core.$ZodURL.init(inst, def);
199
+ exports.ZodMiniStringFormat.init(inst, def);
200
+ });
201
+ function url(params) {
202
+ return core._url(exports.ZodMiniURL, params);
203
+ }
204
+ exports.ZodMiniEmoji = core.$constructor("ZodMiniEmoji", (inst, def) => {
205
+ core.$ZodEmoji.init(inst, def);
206
+ exports.ZodMiniStringFormat.init(inst, def);
207
+ });
208
+ function emoji(params) {
209
+ return core._emoji(exports.ZodMiniEmoji, params);
210
+ }
211
+ exports.ZodMiniNanoID = core.$constructor("ZodMiniNanoID", (inst, def) => {
212
+ core.$ZodNanoID.init(inst, def);
213
+ exports.ZodMiniStringFormat.init(inst, def);
214
+ });
215
+ function nanoid(params) {
216
+ return core._nanoid(exports.ZodMiniNanoID, params);
217
+ }
218
+ exports.ZodMiniCUID = core.$constructor("ZodMiniCUID", (inst, def) => {
219
+ core.$ZodCUID.init(inst, def);
220
+ exports.ZodMiniStringFormat.init(inst, def);
221
+ });
222
+ function cuid(params) {
223
+ return core._cuid(exports.ZodMiniCUID, params);
224
+ }
225
+ exports.ZodMiniCUID2 = core.$constructor("ZodMiniCUID2", (inst, def) => {
226
+ core.$ZodCUID2.init(inst, def);
227
+ exports.ZodMiniStringFormat.init(inst, def);
228
+ });
229
+ function cuid2(params) {
230
+ return core._cuid2(exports.ZodMiniCUID2, params);
231
+ }
232
+ exports.ZodMiniULID = core.$constructor("ZodMiniULID", (inst, def) => {
233
+ core.$ZodULID.init(inst, def);
234
+ exports.ZodMiniStringFormat.init(inst, def);
235
+ });
236
+ function ulid(params) {
237
+ return core._ulid(exports.ZodMiniULID, params);
238
+ }
239
+ exports.ZodMiniXID = core.$constructor("ZodMiniXID", (inst, def) => {
240
+ core.$ZodXID.init(inst, def);
241
+ exports.ZodMiniStringFormat.init(inst, def);
242
+ });
243
+ function xid(params) {
244
+ return core._xid(exports.ZodMiniXID, params);
245
+ }
246
+ exports.ZodMiniKSUID = core.$constructor("ZodMiniKSUID", (inst, def) => {
247
+ core.$ZodKSUID.init(inst, def);
248
+ exports.ZodMiniStringFormat.init(inst, def);
249
+ });
250
+ function ksuid(params) {
251
+ return core._ksuid(exports.ZodMiniKSUID, params);
252
+ }
253
+ exports.ZodMiniIPv4 = core.$constructor("ZodMiniIPv4", (inst, def) => {
254
+ core.$ZodIPv4.init(inst, def);
255
+ exports.ZodMiniStringFormat.init(inst, def);
256
+ });
257
+ function ipv4(params) {
258
+ return core._ipv4(exports.ZodMiniIPv4, params);
259
+ }
260
+ exports.ZodMiniIPv6 = core.$constructor("ZodMiniIPv6", (inst, def) => {
261
+ core.$ZodIPv6.init(inst, def);
262
+ exports.ZodMiniStringFormat.init(inst, def);
263
+ });
264
+ function ipv6(params) {
265
+ return core._ipv6(exports.ZodMiniIPv6, params);
266
+ }
267
+ exports.ZodMiniCIDRv4 = core.$constructor("ZodMiniCIDRv4", (inst, def) => {
268
+ core.$ZodCIDRv4.init(inst, def);
269
+ exports.ZodMiniStringFormat.init(inst, def);
270
+ });
271
+ function cidrv4(params) {
272
+ return core._cidrv4(exports.ZodMiniCIDRv4, params);
273
+ }
274
+ exports.ZodMiniCIDRv6 = core.$constructor("ZodMiniCIDRv6", (inst, def) => {
275
+ core.$ZodCIDRv6.init(inst, def);
276
+ exports.ZodMiniStringFormat.init(inst, def);
277
+ });
278
+ function cidrv6(params) {
279
+ return core._cidrv6(exports.ZodMiniCIDRv6, params);
280
+ }
281
+ exports.ZodMiniBase64 = core.$constructor("ZodMiniBase64", (inst, def) => {
282
+ core.$ZodBase64.init(inst, def);
283
+ exports.ZodMiniStringFormat.init(inst, def);
284
+ });
285
+ function base64(params) {
286
+ return core._base64(exports.ZodMiniBase64, params);
287
+ }
288
+ exports.ZodMiniBase64URL = core.$constructor("ZodMiniBase64URL", (inst, def) => {
289
+ core.$ZodBase64URL.init(inst, def);
290
+ exports.ZodMiniStringFormat.init(inst, def);
291
+ });
292
+ function base64url(params) {
293
+ return core._base64url(exports.ZodMiniBase64URL, params);
294
+ }
295
+ exports.ZodMiniE164 = core.$constructor("ZodMiniE164", (inst, def) => {
296
+ core.$ZodE164.init(inst, def);
297
+ exports.ZodMiniStringFormat.init(inst, def);
298
+ });
299
+ function e164(params) {
300
+ return core._e164(exports.ZodMiniE164, params);
301
+ }
302
+ exports.ZodMiniJWT = core.$constructor("ZodMiniJWT", (inst, def) => {
303
+ core.$ZodJWT.init(inst, def);
304
+ exports.ZodMiniStringFormat.init(inst, def);
305
+ });
306
+ function jwt(params) {
307
+ return core._jwt(exports.ZodMiniJWT, params);
308
+ }
309
+ exports.ZodMiniNumber = core.$constructor("ZodMiniNumber", (inst, def) => {
310
+ core.$ZodNumber.init(inst, def);
311
+ exports.ZodMiniType.init(inst, def);
312
+ });
313
+ function number(params) {
314
+ return core._number(exports.ZodMiniNumber, params);
315
+ }
316
+ exports.ZodMiniNumberFormat = core.$constructor("ZodMiniNumberFormat", (inst, def) => {
317
+ core.$ZodNumberFormat.init(inst, def);
318
+ exports.ZodMiniNumber.init(inst, def);
319
+ });
320
+ // int
321
+ function int(params) {
322
+ return core._int(exports.ZodMiniNumberFormat, params);
323
+ }
324
+ // float32
325
+ function float32(params) {
326
+ return core._float32(exports.ZodMiniNumberFormat, params);
327
+ }
328
+ // float64
329
+ function float64(params) {
330
+ return core._float64(exports.ZodMiniNumberFormat, params);
331
+ }
332
+ // int32
333
+ function int32(params) {
334
+ return core._int32(exports.ZodMiniNumberFormat, params);
335
+ }
336
+ // uint32
337
+ function uint32(params) {
338
+ return core._uint32(exports.ZodMiniNumberFormat, params);
339
+ }
340
+ exports.ZodMiniBoolean = core.$constructor("ZodMiniBoolean", (inst, def) => {
341
+ core.$ZodBoolean.init(inst, def);
342
+ exports.ZodMiniType.init(inst, def);
343
+ });
344
+ function boolean(params) {
345
+ return core._boolean(exports.ZodMiniBoolean, params);
346
+ }
347
+ exports.ZodMiniBigInt = core.$constructor("ZodMiniBigInt", (inst, def) => {
348
+ core.$ZodBigInt.init(inst, def);
349
+ exports.ZodMiniType.init(inst, def);
350
+ });
351
+ function bigint(params) {
352
+ return core._bigint(exports.ZodMiniBigInt, params);
353
+ }
354
+ exports.ZodMiniBigIntFormat = core.$constructor("ZodMiniBigIntFormat", (inst, def) => {
355
+ core.$ZodBigIntFormat.init(inst, def);
356
+ exports.ZodMiniBigInt.init(inst, def);
357
+ });
358
+ // int64
359
+ function int64(params) {
360
+ return core._int64(exports.ZodMiniBigIntFormat, params);
361
+ }
362
+ // uint64
363
+ function uint64(params) {
364
+ return core._uint64(exports.ZodMiniBigIntFormat, params);
365
+ }
366
+ exports.ZodMiniSymbol = core.$constructor("ZodMiniSymbol", (inst, def) => {
367
+ core.$ZodSymbol.init(inst, def);
368
+ exports.ZodMiniType.init(inst, def);
369
+ });
370
+ function symbol(params) {
371
+ return core._symbol(exports.ZodMiniSymbol, params);
372
+ }
373
+ exports.ZodMiniUndefined = core.$constructor("ZodMiniUndefined", (inst, def) => {
374
+ core.$ZodUndefined.init(inst, def);
375
+ exports.ZodMiniType.init(inst, def);
376
+ });
377
+ function _undefined(params) {
378
+ return core._undefined(exports.ZodMiniUndefined, params);
379
+ }
380
+ exports.ZodMiniNull = core.$constructor("ZodMiniNull", (inst, def) => {
381
+ core.$ZodNull.init(inst, def);
382
+ exports.ZodMiniType.init(inst, def);
383
+ });
384
+ function _null(params) {
385
+ return core._null(exports.ZodMiniNull, params);
386
+ }
387
+ exports.ZodMiniAny = core.$constructor("ZodMiniAny", (inst, def) => {
388
+ core.$ZodAny.init(inst, def);
389
+ exports.ZodMiniType.init(inst, def);
390
+ });
391
+ function any() {
392
+ return core._any(exports.ZodMiniAny);
393
+ }
394
+ exports.ZodMiniUnknown = core.$constructor("ZodMiniUnknown", (inst, def) => {
395
+ core.$ZodUnknown.init(inst, def);
396
+ exports.ZodMiniType.init(inst, def);
397
+ });
398
+ function unknown() {
399
+ return core._unknown(exports.ZodMiniUnknown);
400
+ }
401
+ exports.ZodMiniNever = core.$constructor("ZodMiniNever", (inst, def) => {
402
+ core.$ZodNever.init(inst, def);
403
+ exports.ZodMiniType.init(inst, def);
404
+ });
405
+ function never(params) {
406
+ return core._never(exports.ZodMiniNever, params);
407
+ }
408
+ exports.ZodMiniVoid = core.$constructor("ZodMiniVoid", (inst, def) => {
409
+ core.$ZodVoid.init(inst, def);
410
+ exports.ZodMiniType.init(inst, def);
411
+ });
412
+ function _void(params) {
413
+ return core._void(exports.ZodMiniVoid, params);
414
+ }
415
+ exports.ZodMiniDate = core.$constructor("ZodMiniDate", (inst, def) => {
416
+ core.$ZodDate.init(inst, def);
417
+ exports.ZodMiniType.init(inst, def);
418
+ });
419
+ function date(params) {
420
+ return core._date(exports.ZodMiniDate, params);
421
+ }
422
+ exports.ZodMiniArray = core.$constructor("ZodMiniArray", (inst, def) => {
423
+ core.$ZodArray.init(inst, def);
424
+ exports.ZodMiniType.init(inst, def);
425
+ });
426
+ function array(element, params) {
427
+ return new exports.ZodMiniArray({
428
+ type: "array",
429
+ element,
430
+ // get element() {
431
+ // return element;
432
+ // },
433
+ ...core_1.util.normalizeParams(params),
434
+ });
435
+ }
436
+ // .keyof
437
+ function keyof(schema) {
438
+ const shape = schema._zod.def.shape;
439
+ return literal(Object.keys(shape));
440
+ }
441
+ exports.ZodMiniObject = core.$constructor("ZodMiniObject", (inst, def) => {
442
+ core.$ZodObject.init(inst, def);
443
+ exports.ZodMiniType.init(inst, def);
444
+ });
445
+ function object(shape, params) {
446
+ const def = {
447
+ type: "object",
448
+ get shape() {
449
+ core_1.util.assignProp(this, "shape", { ...shape });
450
+ return this.shape;
451
+ },
452
+ ...core_1.util.normalizeParams(params),
453
+ };
454
+ return new exports.ZodMiniObject(def);
455
+ }
456
+ // strictObject
457
+ function strictObject(shape, params) {
458
+ return new exports.ZodMiniObject({
459
+ type: "object",
460
+ // shape: shape as core.$ZodLooseShape,
461
+ get shape() {
462
+ core_1.util.assignProp(this, "shape", { ...shape });
463
+ return this.shape;
464
+ },
465
+ // get optional() {
466
+ // return util.optionalKeys(shape);
467
+ // },
468
+ catchall: never(),
469
+ ...core_1.util.normalizeParams(params),
470
+ });
471
+ }
472
+ // looseObject
473
+ function looseObject(shape, params) {
474
+ return new exports.ZodMiniObject({
475
+ type: "object",
476
+ // shape: shape as core.$ZodLooseShape,
477
+ get shape() {
478
+ core_1.util.assignProp(this, "shape", { ...shape });
479
+ return this.shape;
480
+ },
481
+ // get optional() {
482
+ // return util.optionalKeys(shape);
483
+ // },
484
+ catchall: unknown(),
485
+ ...core_1.util.normalizeParams(params),
486
+ });
487
+ }
488
+ // object methods
489
+ function extend(schema, shape) {
490
+ return core_1.util.extend(schema, shape);
491
+ }
492
+ function merge(schema, shape) {
493
+ return core_1.util.extend(schema, shape);
494
+ }
495
+ function pick(schema, mask) {
496
+ return core_1.util.pick(schema, mask);
497
+ }
498
+ // .omit
499
+ function omit(schema, mask) {
500
+ return core_1.util.omit(schema, mask);
501
+ }
502
+ function partial(schema, mask) {
503
+ return core_1.util.partial(exports.ZodMiniOptional, schema, mask);
504
+ }
505
+ function required(schema, mask) {
506
+ return core_1.util.required(exports.ZodMiniNonOptional, schema, mask);
507
+ }
508
+ exports.ZodMiniUnion = core.$constructor("ZodMiniUnion", (inst, def) => {
509
+ core.$ZodUnion.init(inst, def);
510
+ exports.ZodMiniType.init(inst, def);
511
+ });
512
+ function union(options, params) {
513
+ return new exports.ZodMiniUnion({
514
+ type: "union",
515
+ options,
516
+ ...core_1.util.normalizeParams(params),
517
+ });
518
+ }
519
+ exports.ZodMiniDiscriminatedUnion = core.$constructor("ZodMiniDiscriminatedUnion", (inst, def) => {
520
+ core.$ZodDiscriminatedUnion.init(inst, def);
521
+ exports.ZodMiniType.init(inst, def);
522
+ });
523
+ function discriminatedUnion(discriminator, options, params) {
524
+ return new exports.ZodMiniDiscriminatedUnion({
525
+ type: "union",
526
+ options,
527
+ discriminator,
528
+ ...core_1.util.normalizeParams(params),
529
+ });
530
+ }
531
+ exports.ZodMiniIntersection = core.$constructor("ZodMiniIntersection", (inst, def) => {
532
+ core.$ZodIntersection.init(inst, def);
533
+ exports.ZodMiniType.init(inst, def);
534
+ });
535
+ function intersection(left, right) {
536
+ return new exports.ZodMiniIntersection({
537
+ type: "intersection",
538
+ left,
539
+ right,
540
+ });
541
+ }
542
+ exports.ZodMiniTuple = core.$constructor("ZodMiniTuple", (inst, def) => {
543
+ core.$ZodTuple.init(inst, def);
544
+ exports.ZodMiniType.init(inst, def);
545
+ });
546
+ function tuple(items, _paramsOrRest, _params) {
547
+ const hasRest = _paramsOrRest instanceof core.$ZodType;
548
+ const params = hasRest ? _params : _paramsOrRest;
549
+ const rest = hasRest ? _paramsOrRest : null;
550
+ return new exports.ZodMiniTuple({
551
+ type: "tuple",
552
+ items,
553
+ rest,
554
+ ...core_1.util.normalizeParams(params),
555
+ });
556
+ }
557
+ exports.ZodMiniRecord = core.$constructor("ZodMiniRecord", (inst, def) => {
558
+ core.$ZodRecord.init(inst, def);
559
+ exports.ZodMiniType.init(inst, def);
560
+ });
561
+ function record(keyType, valueType, params) {
562
+ return new exports.ZodMiniRecord({
563
+ type: "record",
564
+ keyType,
565
+ valueType,
566
+ ...core_1.util.normalizeParams(params),
567
+ });
568
+ }
569
+ function partialRecord(keyType, valueType, params) {
570
+ return new exports.ZodMiniRecord({
571
+ type: "record",
572
+ keyType: union([keyType, never()]),
573
+ valueType,
574
+ ...core_1.util.normalizeParams(params),
575
+ });
576
+ }
577
+ exports.ZodMiniMap = core.$constructor("ZodMiniMap", (inst, def) => {
578
+ core.$ZodMap.init(inst, def);
579
+ exports.ZodMiniType.init(inst, def);
580
+ });
581
+ function map(keyType, valueType, params) {
582
+ return new exports.ZodMiniMap({
583
+ type: "map",
584
+ keyType,
585
+ valueType,
586
+ ...core_1.util.normalizeParams(params),
587
+ });
588
+ }
589
+ exports.ZodMiniSet = core.$constructor("ZodMiniSet", (inst, def) => {
590
+ core.$ZodSet.init(inst, def);
591
+ exports.ZodMiniType.init(inst, def);
592
+ });
593
+ function set(valueType, params) {
594
+ return new exports.ZodMiniSet({
595
+ type: "set",
596
+ valueType,
597
+ ...core_1.util.normalizeParams(params),
598
+ });
599
+ }
600
+ exports.ZodMiniEnum = core.$constructor("ZodMiniEnum", (inst, def) => {
601
+ core.$ZodEnum.init(inst, def);
602
+ exports.ZodMiniType.init(inst, def);
603
+ });
604
+ function _enum(values, params) {
605
+ const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;
606
+ return new exports.ZodMiniEnum({
607
+ type: "enum",
608
+ entries,
609
+ ...core_1.util.normalizeParams(params),
610
+ });
611
+ }
612
+ /** @deprecated This API has been merged into `z.enum()`. Use `z.enum()` instead.
613
+ *
614
+ * ```ts
615
+ * enum Colors { red, green, blue }
616
+ * z.enum(Colors);
617
+ * ```
618
+ */
619
+ function nativeEnum(entries, params) {
620
+ return new exports.ZodMiniEnum({
621
+ type: "enum",
622
+ entries,
623
+ ...core_1.util.normalizeParams(params),
624
+ });
625
+ }
626
+ exports.ZodMiniLiteral = core.$constructor("ZodMiniLiteral", (inst, def) => {
627
+ core.$ZodLiteral.init(inst, def);
628
+ exports.ZodMiniType.init(inst, def);
629
+ });
630
+ function literal(value, params) {
631
+ return new exports.ZodMiniLiteral({
632
+ type: "literal",
633
+ values: Array.isArray(value) ? value : [value],
634
+ ...core_1.util.normalizeParams(params),
635
+ });
636
+ }
637
+ exports.ZodMiniFile = core.$constructor("ZodMiniFile", (inst, def) => {
638
+ core.$ZodFile.init(inst, def);
639
+ exports.ZodMiniType.init(inst, def);
640
+ });
641
+ function file(params) {
642
+ return core._file(exports.ZodMiniFile, params);
643
+ }
644
+ exports.ZodMiniTransform = core.$constructor("ZodMiniTransform", (inst, def) => {
645
+ core.$ZodTransform.init(inst, def);
646
+ exports.ZodMiniType.init(inst, def);
647
+ });
648
+ function transform(fn) {
649
+ return new exports.ZodMiniTransform({
650
+ type: "transform",
651
+ transform: fn,
652
+ });
653
+ }
654
+ exports.ZodMiniOptional = core.$constructor("ZodMiniOptional", (inst, def) => {
655
+ core.$ZodOptional.init(inst, def);
656
+ exports.ZodMiniType.init(inst, def);
657
+ });
658
+ function optional(innerType) {
659
+ return new exports.ZodMiniOptional({
660
+ type: "optional",
661
+ innerType,
662
+ });
663
+ }
664
+ exports.ZodMiniNullable = core.$constructor("ZodMiniNullable", (inst, def) => {
665
+ core.$ZodNullable.init(inst, def);
666
+ exports.ZodMiniType.init(inst, def);
667
+ });
668
+ function nullable(innerType) {
669
+ return new exports.ZodMiniNullable({
670
+ type: "nullable",
671
+ innerType,
672
+ });
673
+ }
674
+ // nullish
675
+ function nullish(innerType) {
676
+ return optional(nullable(innerType));
677
+ }
678
+ exports.ZodMiniDefault = core.$constructor("ZodMiniDefault", (inst, def) => {
679
+ core.$ZodDefault.init(inst, def);
680
+ exports.ZodMiniType.init(inst, def);
681
+ });
682
+ function _default(innerType, defaultValue) {
683
+ return new exports.ZodMiniDefault({
684
+ type: "default",
685
+ innerType,
686
+ get defaultValue() {
687
+ return typeof defaultValue === "function" ? defaultValue() : defaultValue;
688
+ },
689
+ });
690
+ }
691
+ exports.ZodMiniPrefault = core.$constructor("ZodMiniPrefault", (inst, def) => {
692
+ core.$ZodPrefault.init(inst, def);
693
+ exports.ZodMiniType.init(inst, def);
694
+ });
695
+ function prefault(innerType, defaultValue) {
696
+ return new exports.ZodMiniPrefault({
697
+ type: "prefault",
698
+ innerType,
699
+ get defaultValue() {
700
+ return typeof defaultValue === "function" ? defaultValue() : defaultValue;
701
+ },
702
+ });
703
+ }
704
+ exports.ZodMiniNonOptional = core.$constructor("ZodMiniNonOptional", (inst, def) => {
705
+ core.$ZodNonOptional.init(inst, def);
706
+ exports.ZodMiniType.init(inst, def);
707
+ });
708
+ function nonoptional(innerType, params) {
709
+ return new exports.ZodMiniNonOptional({
710
+ type: "nonoptional",
711
+ innerType,
712
+ ...core_1.util.normalizeParams(params),
713
+ });
714
+ }
715
+ exports.ZodMiniSuccess = core.$constructor("ZodMiniSuccess", (inst, def) => {
716
+ core.$ZodSuccess.init(inst, def);
717
+ exports.ZodMiniType.init(inst, def);
718
+ });
719
+ function success(innerType) {
720
+ return new exports.ZodMiniSuccess({
721
+ type: "success",
722
+ innerType,
723
+ });
724
+ }
725
+ exports.ZodMiniCatch = core.$constructor("ZodMiniCatch", (inst, def) => {
726
+ core.$ZodCatch.init(inst, def);
727
+ exports.ZodMiniType.init(inst, def);
728
+ });
729
+ function _catch(innerType, catchValue) {
730
+ return new exports.ZodMiniCatch({
731
+ type: "catch",
732
+ innerType,
733
+ catchValue: (typeof catchValue === "function" ? catchValue : () => catchValue),
734
+ });
735
+ }
736
+ exports.ZodMiniNaN = core.$constructor("ZodMiniNaN", (inst, def) => {
737
+ core.$ZodNaN.init(inst, def);
738
+ exports.ZodMiniType.init(inst, def);
739
+ });
740
+ function nan(params) {
741
+ return core._nan(exports.ZodMiniNaN, params);
742
+ }
743
+ exports.ZodMiniPipe = core.$constructor("ZodMiniPipe", (inst, def) => {
744
+ core.$ZodPipe.init(inst, def);
745
+ exports.ZodMiniType.init(inst, def);
746
+ });
747
+ function pipe(in_, out) {
748
+ return new exports.ZodMiniPipe({
749
+ type: "pipe",
750
+ in: in_,
751
+ out,
752
+ });
753
+ }
754
+ exports.ZodMiniReadonly = core.$constructor("ZodMiniReadonly", (inst, def) => {
755
+ core.$ZodReadonly.init(inst, def);
756
+ exports.ZodMiniType.init(inst, def);
757
+ });
758
+ function readonly(innerType) {
759
+ return new exports.ZodMiniReadonly({
760
+ type: "readonly",
761
+ innerType,
762
+ });
763
+ }
764
+ exports.ZodMiniTemplateLiteral = core.$constructor("ZodMiniTemplateLiteral", (inst, def) => {
765
+ core.$ZodTemplateLiteral.init(inst, def);
766
+ exports.ZodMiniType.init(inst, def);
767
+ });
768
+ function templateLiteral(parts, params) {
769
+ return new exports.ZodMiniTemplateLiteral({
770
+ type: "template_literal",
771
+ parts,
772
+ ...core_1.util.normalizeParams(params),
773
+ });
774
+ }
775
+ exports.ZodMiniLazy = core.$constructor("ZodMiniLazy", (inst, def) => {
776
+ core.$ZodLazy.init(inst, def);
777
+ exports.ZodMiniType.init(inst, def);
778
+ });
779
+ // export function lazy<T extends object>(getter: () => T): T {
780
+ // return util.createTransparentProxy<T>(getter);
781
+ // }
782
+ function _lazy(getter) {
783
+ return new exports.ZodMiniLazy({
784
+ type: "lazy",
785
+ getter,
786
+ });
787
+ }
788
+ exports.ZodMiniPromise = core.$constructor("ZodMiniPromise", (inst, def) => {
789
+ core.$ZodPromise.init(inst, def);
790
+ exports.ZodMiniType.init(inst, def);
791
+ });
792
+ function promise(innerType) {
793
+ return new exports.ZodMiniPromise({
794
+ type: "promise",
795
+ innerType,
796
+ });
797
+ }
798
+ exports.ZodMiniCustom = core.$constructor("ZodMiniCustom", (inst, def) => {
799
+ core.$ZodCustom.init(inst, def);
800
+ exports.ZodMiniType.init(inst, def);
801
+ });
802
+ // custom checks
803
+ function check(fn, params) {
804
+ const ch = new core.$ZodCheck({
805
+ check: "custom",
806
+ ...core_1.util.normalizeParams(params),
807
+ });
808
+ ch._zod.check = fn;
809
+ return ch;
810
+ }
811
+ // ZodCustom
812
+ function _custom(fn, _params, Class) {
813
+ const params = core_1.util.normalizeParams(_params);
814
+ const schema = new Class({
815
+ type: "custom",
816
+ check: "custom",
817
+ fn: fn,
818
+ ...params,
819
+ });
820
+ return schema;
821
+ }
822
+ // refine
823
+ function refine(fn, _params = {}) {
824
+ return _custom(fn, _params, exports.ZodMiniCustom);
825
+ }
826
+ // custom schema
827
+ function custom(fn, _params) {
828
+ return _custom(fn ?? (() => true), _params, exports.ZodMiniCustom);
829
+ }
830
+ // instanceof
831
+ class Class {
832
+ constructor(..._args) { }
833
+ }
834
+ function _instanceof(cls, params = {
835
+ error: `Input not instance of ${cls.name}`,
836
+ }) {
837
+ const inst = custom((data) => data instanceof cls, params);
838
+ inst._zod.bag.Class = cls;
839
+ return inst;
840
+ }
841
+ // stringbool
842
+ exports.stringbool = core._stringbool.bind(null, {
843
+ Pipe: exports.ZodMiniPipe,
844
+ Boolean: exports.ZodMiniBoolean,
845
+ Unknown: exports.ZodMiniUnknown,
846
+ });
847
+ function json() {
848
+ const jsonSchema = _lazy(() => {
849
+ return union([string(), number(), boolean(), _null(), array(jsonSchema), record(string(), jsonSchema)]);
850
+ });
851
+ return jsonSchema;
852
+ }