fullstacked 0.12.1-1371 → 0.12.2-1382

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 (713) hide show
  1. package/fullstacked_modules/@types/archive/index.d.ts +33 -0
  2. package/fullstacked_modules/@types/connect/index.d.ts +28 -0
  3. package/fullstacked_modules/@types/fetch/index.d.ts +38 -0
  4. package/fullstacked_modules/@types/fs/index.d.ts +73 -0
  5. package/fullstacked_modules/@types/platform/index.d.ts +15 -0
  6. package/fullstacked_modules/{archive/archive.ts → archive.ts} +10 -3
  7. package/fullstacked_modules/{auto_update/index.ts → auto_update.ts} +4 -7
  8. package/fullstacked_modules/build/index.ts +108 -2
  9. package/fullstacked_modules/{connect/index.ts → connect.ts} +7 -7
  10. package/fullstacked_modules/{core_message/core_message.ts → core_message.ts} +7 -1
  11. package/fullstacked_modules/{fetch/index.ts → fetch.ts} +5 -6
  12. package/fullstacked_modules/{fs/fs.ts → fs.ts} +15 -2
  13. package/fullstacked_modules/{git/git.ts → git.ts} +24 -4
  14. package/fullstacked_modules/{packages/packages.ts → packages.ts} +10 -7
  15. package/index.js +2 -8
  16. package/package.json +1 -1
  17. package/fullstacked_modules/@fullstacked/ai-agent/README.md +0 -1
  18. package/fullstacked_modules/@fullstacked/ai-agent/ai-agent.js +0 -192588
  19. package/fullstacked_modules/@fullstacked/ai-agent/index.scss +0 -15
  20. package/fullstacked_modules/@fullstacked/ai-agent/index.ts +0 -111
  21. package/fullstacked_modules/@fullstacked/ai-agent/lock.json +0 -1176
  22. package/fullstacked_modules/@fullstacked/ai-agent/package.json +0 -28
  23. package/fullstacked_modules/@fullstacked/ai-agent/src/conversation.ts +0 -227
  24. package/fullstacked_modules/@fullstacked/ai-agent/src/default.scss +0 -23
  25. package/fullstacked_modules/@fullstacked/ai-agent/src/index.ts +0 -2
  26. package/fullstacked_modules/@fullstacked/ai-agent/src/input.ts +0 -36
  27. package/fullstacked_modules/@fullstacked/ai-agent/src/markdown.ts +0 -50
  28. package/fullstacked_modules/@fullstacked/ai-agent/src/providers/anthropic.ts +0 -50
  29. package/fullstacked_modules/@fullstacked/ai-agent/src/providers/deepseek.ts +0 -50
  30. package/fullstacked_modules/@fullstacked/ai-agent/src/providers/google.ts +0 -44
  31. package/fullstacked_modules/@fullstacked/ai-agent/src/providers/index.ts +0 -39
  32. package/fullstacked_modules/@fullstacked/ai-agent/src/providers/interface.ts +0 -29
  33. package/fullstacked_modules/@fullstacked/ai-agent/src/providers/mistral.ts +0 -51
  34. package/fullstacked_modules/@fullstacked/ai-agent/src/providers/ollama.ts +0 -70
  35. package/fullstacked_modules/@fullstacked/ai-agent/src/providers/openai.ts +0 -49
  36. package/fullstacked_modules/@fullstacked/ai-agent/src/providers/xai.ts +0 -47
  37. package/fullstacked_modules/ai/index.d.ts +0 -3
  38. package/fullstacked_modules/ai/index.ts +0 -14
  39. package/fullstacked_modules/ai/tools/fs.ts +0 -70
  40. package/fullstacked_modules/archive/index.d.ts +0 -3
  41. package/fullstacked_modules/archive/index.ts +0 -3
  42. package/fullstacked_modules/bridge/index.d.ts +0 -0
  43. package/fullstacked_modules/build/build.ts +0 -101
  44. package/fullstacked_modules/build/index.d.ts +0 -0
  45. package/fullstacked_modules/components/index.d.ts +0 -0
  46. package/fullstacked_modules/connect/index.d.ts +0 -3
  47. package/fullstacked_modules/core_message/index.d.ts +0 -0
  48. package/fullstacked_modules/core_message/index.ts +0 -3
  49. package/fullstacked_modules/fetch/index.d.ts +0 -3
  50. package/fullstacked_modules/fs/index.d.ts +0 -3
  51. package/fullstacked_modules/fs/index.ts +0 -3
  52. package/fullstacked_modules/git/index.d.ts +0 -0
  53. package/fullstacked_modules/git/index.ts +0 -3
  54. package/fullstacked_modules/packages/index.d.ts +0 -0
  55. package/fullstacked_modules/packages/index.ts +0 -3
  56. package/fullstacked_modules/platform/index.d.ts +0 -3
  57. package/fullstacked_modules/zod/LICENSE +0 -21
  58. package/fullstacked_modules/zod/README.md +0 -208
  59. package/fullstacked_modules/zod/index.cjs +0 -33
  60. package/fullstacked_modules/zod/index.d.cts +0 -4
  61. package/fullstacked_modules/zod/index.d.ts +0 -4
  62. package/fullstacked_modules/zod/index.js +0 -4
  63. package/fullstacked_modules/zod/locales/index.cjs +0 -17
  64. package/fullstacked_modules/zod/locales/index.d.cts +0 -1
  65. package/fullstacked_modules/zod/locales/index.d.ts +0 -1
  66. package/fullstacked_modules/zod/locales/index.js +0 -1
  67. package/fullstacked_modules/zod/locales/package.json +0 -6
  68. package/fullstacked_modules/zod/mini/index.cjs +0 -17
  69. package/fullstacked_modules/zod/mini/index.d.cts +0 -1
  70. package/fullstacked_modules/zod/mini/index.d.ts +0 -1
  71. package/fullstacked_modules/zod/mini/index.js +0 -1
  72. package/fullstacked_modules/zod/mini/package.json +0 -6
  73. package/fullstacked_modules/zod/package.json +0 -135
  74. package/fullstacked_modules/zod/src/index.ts +0 -4
  75. package/fullstacked_modules/zod/src/locales/index.ts +0 -1
  76. package/fullstacked_modules/zod/src/mini/index.ts +0 -1
  77. package/fullstacked_modules/zod/src/v3/ZodError.ts +0 -330
  78. package/fullstacked_modules/zod/src/v3/benchmarks/datetime.ts +0 -58
  79. package/fullstacked_modules/zod/src/v3/benchmarks/discriminatedUnion.ts +0 -80
  80. package/fullstacked_modules/zod/src/v3/benchmarks/index.ts +0 -59
  81. package/fullstacked_modules/zod/src/v3/benchmarks/ipv4.ts +0 -57
  82. package/fullstacked_modules/zod/src/v3/benchmarks/object.ts +0 -69
  83. package/fullstacked_modules/zod/src/v3/benchmarks/primitives.ts +0 -162
  84. package/fullstacked_modules/zod/src/v3/benchmarks/realworld.ts +0 -63
  85. package/fullstacked_modules/zod/src/v3/benchmarks/string.ts +0 -55
  86. package/fullstacked_modules/zod/src/v3/benchmarks/union.ts +0 -80
  87. package/fullstacked_modules/zod/src/v3/errors.ts +0 -13
  88. package/fullstacked_modules/zod/src/v3/external.ts +0 -6
  89. package/fullstacked_modules/zod/src/v3/helpers/enumUtil.ts +0 -17
  90. package/fullstacked_modules/zod/src/v3/helpers/errorUtil.ts +0 -8
  91. package/fullstacked_modules/zod/src/v3/helpers/parseUtil.ts +0 -176
  92. package/fullstacked_modules/zod/src/v3/helpers/partialUtil.ts +0 -34
  93. package/fullstacked_modules/zod/src/v3/helpers/typeAliases.ts +0 -2
  94. package/fullstacked_modules/zod/src/v3/helpers/util.ts +0 -224
  95. package/fullstacked_modules/zod/src/v3/index.ts +0 -4
  96. package/fullstacked_modules/zod/src/v3/locales/en.ts +0 -124
  97. package/fullstacked_modules/zod/src/v3/standard-schema.ts +0 -113
  98. package/fullstacked_modules/zod/src/v3/tests/Mocker.ts +0 -54
  99. package/fullstacked_modules/zod/src/v3/tests/all-errors.test.ts +0 -157
  100. package/fullstacked_modules/zod/src/v3/tests/anyunknown.test.ts +0 -28
  101. package/fullstacked_modules/zod/src/v3/tests/array.test.ts +0 -71
  102. package/fullstacked_modules/zod/src/v3/tests/async-parsing.test.ts +0 -388
  103. package/fullstacked_modules/zod/src/v3/tests/async-refinements.test.ts +0 -46
  104. package/fullstacked_modules/zod/src/v3/tests/base.test.ts +0 -29
  105. package/fullstacked_modules/zod/src/v3/tests/bigint.test.ts +0 -55
  106. package/fullstacked_modules/zod/src/v3/tests/branded.test.ts +0 -53
  107. package/fullstacked_modules/zod/src/v3/tests/catch.test.ts +0 -220
  108. package/fullstacked_modules/zod/src/v3/tests/coerce.test.ts +0 -133
  109. package/fullstacked_modules/zod/src/v3/tests/complex.test.ts +0 -56
  110. package/fullstacked_modules/zod/src/v3/tests/custom.test.ts +0 -31
  111. package/fullstacked_modules/zod/src/v3/tests/date.test.ts +0 -32
  112. package/fullstacked_modules/zod/src/v3/tests/deepmasking.test.ts +0 -186
  113. package/fullstacked_modules/zod/src/v3/tests/default.test.ts +0 -112
  114. package/fullstacked_modules/zod/src/v3/tests/description.test.ts +0 -33
  115. package/fullstacked_modules/zod/src/v3/tests/discriminated-unions.test.ts +0 -315
  116. package/fullstacked_modules/zod/src/v3/tests/enum.test.ts +0 -80
  117. package/fullstacked_modules/zod/src/v3/tests/error.test.ts +0 -551
  118. package/fullstacked_modules/zod/src/v3/tests/firstparty.test.ts +0 -87
  119. package/fullstacked_modules/zod/src/v3/tests/firstpartyschematypes.test.ts +0 -21
  120. package/fullstacked_modules/zod/src/v3/tests/function.test.ts +0 -257
  121. package/fullstacked_modules/zod/src/v3/tests/generics.test.ts +0 -48
  122. package/fullstacked_modules/zod/src/v3/tests/instanceof.test.ts +0 -37
  123. package/fullstacked_modules/zod/src/v3/tests/intersection.test.ts +0 -110
  124. package/fullstacked_modules/zod/src/v3/tests/language-server.source.ts +0 -76
  125. package/fullstacked_modules/zod/src/v3/tests/language-server.test.ts +0 -207
  126. package/fullstacked_modules/zod/src/v3/tests/literal.test.ts +0 -36
  127. package/fullstacked_modules/zod/src/v3/tests/map.test.ts +0 -110
  128. package/fullstacked_modules/zod/src/v3/tests/masking.test.ts +0 -4
  129. package/fullstacked_modules/zod/src/v3/tests/mocker.test.ts +0 -19
  130. package/fullstacked_modules/zod/src/v3/tests/nan.test.ts +0 -21
  131. package/fullstacked_modules/zod/src/v3/tests/nativeEnum.test.ts +0 -87
  132. package/fullstacked_modules/zod/src/v3/tests/nullable.test.ts +0 -42
  133. package/fullstacked_modules/zod/src/v3/tests/number.test.ts +0 -176
  134. package/fullstacked_modules/zod/src/v3/tests/object-augmentation.test.ts +0 -29
  135. package/fullstacked_modules/zod/src/v3/tests/object-in-es5-env.test.ts +0 -29
  136. package/fullstacked_modules/zod/src/v3/tests/object.test.ts +0 -434
  137. package/fullstacked_modules/zod/src/v3/tests/optional.test.ts +0 -42
  138. package/fullstacked_modules/zod/src/v3/tests/parseUtil.test.ts +0 -23
  139. package/fullstacked_modules/zod/src/v3/tests/parser.test.ts +0 -41
  140. package/fullstacked_modules/zod/src/v3/tests/partials.test.ts +0 -243
  141. package/fullstacked_modules/zod/src/v3/tests/pickomit.test.ts +0 -111
  142. package/fullstacked_modules/zod/src/v3/tests/pipeline.test.ts +0 -29
  143. package/fullstacked_modules/zod/src/v3/tests/preprocess.test.ts +0 -186
  144. package/fullstacked_modules/zod/src/v3/tests/primitive.test.ts +0 -440
  145. package/fullstacked_modules/zod/src/v3/tests/promise.test.ts +0 -90
  146. package/fullstacked_modules/zod/src/v3/tests/readonly.test.ts +0 -194
  147. package/fullstacked_modules/zod/src/v3/tests/record.test.ts +0 -171
  148. package/fullstacked_modules/zod/src/v3/tests/recursive.test.ts +0 -197
  149. package/fullstacked_modules/zod/src/v3/tests/refine.test.ts +0 -313
  150. package/fullstacked_modules/zod/src/v3/tests/safeparse.test.ts +0 -27
  151. package/fullstacked_modules/zod/src/v3/tests/set.test.ts +0 -142
  152. package/fullstacked_modules/zod/src/v3/tests/standard-schema.test.ts +0 -83
  153. package/fullstacked_modules/zod/src/v3/tests/string.test.ts +0 -916
  154. package/fullstacked_modules/zod/src/v3/tests/transformer.test.ts +0 -233
  155. package/fullstacked_modules/zod/src/v3/tests/tuple.test.ts +0 -90
  156. package/fullstacked_modules/zod/src/v3/tests/unions.test.ts +0 -57
  157. package/fullstacked_modules/zod/src/v3/tests/validations.test.ts +0 -133
  158. package/fullstacked_modules/zod/src/v3/tests/void.test.ts +0 -15
  159. package/fullstacked_modules/zod/src/v3/types.ts +0 -5138
  160. package/fullstacked_modules/zod/src/v4/classic/checks.ts +0 -31
  161. package/fullstacked_modules/zod/src/v4/classic/coerce.ts +0 -27
  162. package/fullstacked_modules/zod/src/v4/classic/compat.ts +0 -70
  163. package/fullstacked_modules/zod/src/v4/classic/errors.ts +0 -82
  164. package/fullstacked_modules/zod/src/v4/classic/external.ts +0 -50
  165. package/fullstacked_modules/zod/src/v4/classic/index.ts +0 -5
  166. package/fullstacked_modules/zod/src/v4/classic/iso.ts +0 -90
  167. package/fullstacked_modules/zod/src/v4/classic/parse.ts +0 -82
  168. package/fullstacked_modules/zod/src/v4/classic/schemas.ts +0 -2197
  169. package/fullstacked_modules/zod/src/v4/classic/tests/anyunknown.test.ts +0 -26
  170. package/fullstacked_modules/zod/src/v4/classic/tests/array.test.ts +0 -264
  171. package/fullstacked_modules/zod/src/v4/classic/tests/assignability.test.ts +0 -210
  172. package/fullstacked_modules/zod/src/v4/classic/tests/async-parsing.test.ts +0 -381
  173. package/fullstacked_modules/zod/src/v4/classic/tests/async-refinements.test.ts +0 -68
  174. package/fullstacked_modules/zod/src/v4/classic/tests/base.test.ts +0 -7
  175. package/fullstacked_modules/zod/src/v4/classic/tests/bigint.test.ts +0 -54
  176. package/fullstacked_modules/zod/src/v4/classic/tests/brand.test.ts +0 -63
  177. package/fullstacked_modules/zod/src/v4/classic/tests/catch.test.ts +0 -276
  178. package/fullstacked_modules/zod/src/v4/classic/tests/coalesce.test.ts +0 -20
  179. package/fullstacked_modules/zod/src/v4/classic/tests/codec-examples.test.ts +0 -573
  180. package/fullstacked_modules/zod/src/v4/classic/tests/codec.test.ts +0 -562
  181. package/fullstacked_modules/zod/src/v4/classic/tests/coerce.test.ts +0 -160
  182. package/fullstacked_modules/zod/src/v4/classic/tests/continuability.test.ts +0 -352
  183. package/fullstacked_modules/zod/src/v4/classic/tests/custom.test.ts +0 -40
  184. package/fullstacked_modules/zod/src/v4/classic/tests/date.test.ts +0 -31
  185. package/fullstacked_modules/zod/src/v4/classic/tests/datetime.test.ts +0 -302
  186. package/fullstacked_modules/zod/src/v4/classic/tests/default.test.ts +0 -365
  187. package/fullstacked_modules/zod/src/v4/classic/tests/description.test.ts +0 -32
  188. package/fullstacked_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +0 -661
  189. package/fullstacked_modules/zod/src/v4/classic/tests/enum.test.ts +0 -285
  190. package/fullstacked_modules/zod/src/v4/classic/tests/error-utils.test.ts +0 -595
  191. package/fullstacked_modules/zod/src/v4/classic/tests/error.test.ts +0 -711
  192. package/fullstacked_modules/zod/src/v4/classic/tests/file.test.ts +0 -96
  193. package/fullstacked_modules/zod/src/v4/classic/tests/firstparty.test.ts +0 -179
  194. package/fullstacked_modules/zod/src/v4/classic/tests/function.test.ts +0 -308
  195. package/fullstacked_modules/zod/src/v4/classic/tests/generics.test.ts +0 -72
  196. package/fullstacked_modules/zod/src/v4/classic/tests/hash.test.ts +0 -68
  197. package/fullstacked_modules/zod/src/v4/classic/tests/index.test.ts +0 -844
  198. package/fullstacked_modules/zod/src/v4/classic/tests/instanceof.test.ts +0 -34
  199. package/fullstacked_modules/zod/src/v4/classic/tests/intersection.test.ts +0 -171
  200. package/fullstacked_modules/zod/src/v4/classic/tests/json.test.ts +0 -108
  201. package/fullstacked_modules/zod/src/v4/classic/tests/lazy.test.ts +0 -227
  202. package/fullstacked_modules/zod/src/v4/classic/tests/literal.test.ts +0 -117
  203. package/fullstacked_modules/zod/src/v4/classic/tests/map.test.ts +0 -196
  204. package/fullstacked_modules/zod/src/v4/classic/tests/nan.test.ts +0 -21
  205. package/fullstacked_modules/zod/src/v4/classic/tests/nested-refine.test.ts +0 -168
  206. package/fullstacked_modules/zod/src/v4/classic/tests/nonoptional.test.ts +0 -101
  207. package/fullstacked_modules/zod/src/v4/classic/tests/nullable.test.ts +0 -22
  208. package/fullstacked_modules/zod/src/v4/classic/tests/number.test.ts +0 -270
  209. package/fullstacked_modules/zod/src/v4/classic/tests/object.test.ts +0 -609
  210. package/fullstacked_modules/zod/src/v4/classic/tests/optional.test.ts +0 -136
  211. package/fullstacked_modules/zod/src/v4/classic/tests/partial.test.ts +0 -340
  212. package/fullstacked_modules/zod/src/v4/classic/tests/pickomit.test.ts +0 -127
  213. package/fullstacked_modules/zod/src/v4/classic/tests/pipe.test.ts +0 -101
  214. package/fullstacked_modules/zod/src/v4/classic/tests/prefault.test.ts +0 -74
  215. package/fullstacked_modules/zod/src/v4/classic/tests/preprocess.test.ts +0 -282
  216. package/fullstacked_modules/zod/src/v4/classic/tests/primitive.test.ts +0 -175
  217. package/fullstacked_modules/zod/src/v4/classic/tests/promise.test.ts +0 -81
  218. package/fullstacked_modules/zod/src/v4/classic/tests/prototypes.test.ts +0 -23
  219. package/fullstacked_modules/zod/src/v4/classic/tests/readonly.test.ts +0 -252
  220. package/fullstacked_modules/zod/src/v4/classic/tests/record.test.ts +0 -356
  221. package/fullstacked_modules/zod/src/v4/classic/tests/recursive-types.test.ts +0 -582
  222. package/fullstacked_modules/zod/src/v4/classic/tests/refine.test.ts +0 -605
  223. package/fullstacked_modules/zod/src/v4/classic/tests/registries.test.ts +0 -204
  224. package/fullstacked_modules/zod/src/v4/classic/tests/set.test.ts +0 -181
  225. package/fullstacked_modules/zod/src/v4/classic/tests/standard-schema.test.ts +0 -57
  226. package/fullstacked_modules/zod/src/v4/classic/tests/string-formats.test.ts +0 -125
  227. package/fullstacked_modules/zod/src/v4/classic/tests/string.test.ts +0 -1080
  228. package/fullstacked_modules/zod/src/v4/classic/tests/stringbool.test.ts +0 -106
  229. package/fullstacked_modules/zod/src/v4/classic/tests/template-literal.test.ts +0 -763
  230. package/fullstacked_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +0 -2622
  231. package/fullstacked_modules/zod/src/v4/classic/tests/transform.test.ts +0 -361
  232. package/fullstacked_modules/zod/src/v4/classic/tests/tuple.test.ts +0 -163
  233. package/fullstacked_modules/zod/src/v4/classic/tests/union.test.ts +0 -181
  234. package/fullstacked_modules/zod/src/v4/classic/tests/validations.test.ts +0 -283
  235. package/fullstacked_modules/zod/src/v4/classic/tests/void.test.ts +0 -12
  236. package/fullstacked_modules/zod/src/v4/core/api.ts +0 -1621
  237. package/fullstacked_modules/zod/src/v4/core/checks.ts +0 -1287
  238. package/fullstacked_modules/zod/src/v4/core/config.ts +0 -15
  239. package/fullstacked_modules/zod/src/v4/core/core.ts +0 -115
  240. package/fullstacked_modules/zod/src/v4/core/doc.ts +0 -44
  241. package/fullstacked_modules/zod/src/v4/core/errors.ts +0 -413
  242. package/fullstacked_modules/zod/src/v4/core/index.ts +0 -14
  243. package/fullstacked_modules/zod/src/v4/core/json-schema.ts +0 -147
  244. package/fullstacked_modules/zod/src/v4/core/parse.ts +0 -195
  245. package/fullstacked_modules/zod/src/v4/core/regexes.ts +0 -177
  246. package/fullstacked_modules/zod/src/v4/core/registries.ts +0 -97
  247. package/fullstacked_modules/zod/src/v4/core/schemas.ts +0 -4317
  248. package/fullstacked_modules/zod/src/v4/core/standard-schema.ts +0 -64
  249. package/fullstacked_modules/zod/src/v4/core/tests/extend.test.ts +0 -18
  250. package/fullstacked_modules/zod/src/v4/core/tests/index.test.ts +0 -46
  251. package/fullstacked_modules/zod/src/v4/core/tests/locales/be.test.ts +0 -124
  252. package/fullstacked_modules/zod/src/v4/core/tests/locales/en.test.ts +0 -22
  253. package/fullstacked_modules/zod/src/v4/core/tests/locales/es.test.ts +0 -181
  254. package/fullstacked_modules/zod/src/v4/core/tests/locales/ru.test.ts +0 -128
  255. package/fullstacked_modules/zod/src/v4/core/tests/locales/tr.test.ts +0 -69
  256. package/fullstacked_modules/zod/src/v4/core/to-json-schema.ts +0 -1044
  257. package/fullstacked_modules/zod/src/v4/core/util.ts +0 -910
  258. package/fullstacked_modules/zod/src/v4/core/versions.ts +0 -5
  259. package/fullstacked_modules/zod/src/v4/core/zsf.ts +0 -323
  260. package/fullstacked_modules/zod/src/v4/index.ts +0 -4
  261. package/fullstacked_modules/zod/src/v4/locales/ar.ts +0 -125
  262. package/fullstacked_modules/zod/src/v4/locales/az.ts +0 -121
  263. package/fullstacked_modules/zod/src/v4/locales/be.ts +0 -184
  264. package/fullstacked_modules/zod/src/v4/locales/bg.ts +0 -136
  265. package/fullstacked_modules/zod/src/v4/locales/ca.ts +0 -127
  266. package/fullstacked_modules/zod/src/v4/locales/cs.ts +0 -142
  267. package/fullstacked_modules/zod/src/v4/locales/da.ts +0 -141
  268. package/fullstacked_modules/zod/src/v4/locales/de.ts +0 -124
  269. package/fullstacked_modules/zod/src/v4/locales/en.ts +0 -127
  270. package/fullstacked_modules/zod/src/v4/locales/eo.ts +0 -125
  271. package/fullstacked_modules/zod/src/v4/locales/es.ts +0 -159
  272. package/fullstacked_modules/zod/src/v4/locales/fa.ts +0 -134
  273. package/fullstacked_modules/zod/src/v4/locales/fi.ts +0 -131
  274. package/fullstacked_modules/zod/src/v4/locales/fr-CA.ts +0 -126
  275. package/fullstacked_modules/zod/src/v4/locales/fr.ts +0 -124
  276. package/fullstacked_modules/zod/src/v4/locales/he.ts +0 -125
  277. package/fullstacked_modules/zod/src/v4/locales/hu.ts +0 -126
  278. package/fullstacked_modules/zod/src/v4/locales/id.ts +0 -125
  279. package/fullstacked_modules/zod/src/v4/locales/index.ts +0 -47
  280. package/fullstacked_modules/zod/src/v4/locales/is.ts +0 -127
  281. package/fullstacked_modules/zod/src/v4/locales/it.ts +0 -125
  282. package/fullstacked_modules/zod/src/v4/locales/ja.ts +0 -122
  283. package/fullstacked_modules/zod/src/v4/locales/ka.ts +0 -138
  284. package/fullstacked_modules/zod/src/v4/locales/kh.ts +0 -7
  285. package/fullstacked_modules/zod/src/v4/locales/km.ts +0 -126
  286. package/fullstacked_modules/zod/src/v4/locales/ko.ts +0 -131
  287. package/fullstacked_modules/zod/src/v4/locales/lt.ts +0 -265
  288. package/fullstacked_modules/zod/src/v4/locales/mk.ts +0 -127
  289. package/fullstacked_modules/zod/src/v4/locales/ms.ts +0 -124
  290. package/fullstacked_modules/zod/src/v4/locales/nl.ts +0 -126
  291. package/fullstacked_modules/zod/src/v4/locales/no.ts +0 -124
  292. package/fullstacked_modules/zod/src/v4/locales/ota.ts +0 -125
  293. package/fullstacked_modules/zod/src/v4/locales/pl.ts +0 -126
  294. package/fullstacked_modules/zod/src/v4/locales/ps.ts +0 -133
  295. package/fullstacked_modules/zod/src/v4/locales/pt.ts +0 -123
  296. package/fullstacked_modules/zod/src/v4/locales/ru.ts +0 -184
  297. package/fullstacked_modules/zod/src/v4/locales/sl.ts +0 -126
  298. package/fullstacked_modules/zod/src/v4/locales/sv.ts +0 -127
  299. package/fullstacked_modules/zod/src/v4/locales/ta.ts +0 -125
  300. package/fullstacked_modules/zod/src/v4/locales/th.ts +0 -126
  301. package/fullstacked_modules/zod/src/v4/locales/tr.ts +0 -121
  302. package/fullstacked_modules/zod/src/v4/locales/ua.ts +0 -7
  303. package/fullstacked_modules/zod/src/v4/locales/uk.ts +0 -126
  304. package/fullstacked_modules/zod/src/v4/locales/ur.ts +0 -126
  305. package/fullstacked_modules/zod/src/v4/locales/vi.ts +0 -125
  306. package/fullstacked_modules/zod/src/v4/locales/yo.ts +0 -131
  307. package/fullstacked_modules/zod/src/v4/locales/zh-CN.ts +0 -123
  308. package/fullstacked_modules/zod/src/v4/locales/zh-TW.ts +0 -125
  309. package/fullstacked_modules/zod/src/v4/mini/checks.ts +0 -32
  310. package/fullstacked_modules/zod/src/v4/mini/coerce.ts +0 -22
  311. package/fullstacked_modules/zod/src/v4/mini/external.ts +0 -40
  312. package/fullstacked_modules/zod/src/v4/mini/index.ts +0 -3
  313. package/fullstacked_modules/zod/src/v4/mini/iso.ts +0 -62
  314. package/fullstacked_modules/zod/src/v4/mini/parse.ts +0 -14
  315. package/fullstacked_modules/zod/src/v4/mini/schemas.ts +0 -1725
  316. package/fullstacked_modules/zod/src/v4/mini/tests/assignability.test.ts +0 -129
  317. package/fullstacked_modules/zod/src/v4/mini/tests/brand.test.ts +0 -51
  318. package/fullstacked_modules/zod/src/v4/mini/tests/checks.test.ts +0 -144
  319. package/fullstacked_modules/zod/src/v4/mini/tests/codec.test.ts +0 -529
  320. package/fullstacked_modules/zod/src/v4/mini/tests/computed.test.ts +0 -36
  321. package/fullstacked_modules/zod/src/v4/mini/tests/error.test.ts +0 -22
  322. package/fullstacked_modules/zod/src/v4/mini/tests/functions.test.ts +0 -43
  323. package/fullstacked_modules/zod/src/v4/mini/tests/index.test.ts +0 -899
  324. package/fullstacked_modules/zod/src/v4/mini/tests/number.test.ts +0 -95
  325. package/fullstacked_modules/zod/src/v4/mini/tests/object.test.ts +0 -200
  326. package/fullstacked_modules/zod/src/v4/mini/tests/prototypes.test.ts +0 -43
  327. package/fullstacked_modules/zod/src/v4/mini/tests/recursive-types.test.ts +0 -275
  328. package/fullstacked_modules/zod/src/v4/mini/tests/string.test.ts +0 -315
  329. package/fullstacked_modules/zod/src/v4-mini/index.ts +0 -1
  330. package/fullstacked_modules/zod/v3/ZodError.cjs +0 -138
  331. package/fullstacked_modules/zod/v3/ZodError.d.cts +0 -164
  332. package/fullstacked_modules/zod/v3/ZodError.d.ts +0 -164
  333. package/fullstacked_modules/zod/v3/ZodError.js +0 -133
  334. package/fullstacked_modules/zod/v3/errors.cjs +0 -17
  335. package/fullstacked_modules/zod/v3/errors.d.cts +0 -5
  336. package/fullstacked_modules/zod/v3/errors.d.ts +0 -5
  337. package/fullstacked_modules/zod/v3/errors.js +0 -9
  338. package/fullstacked_modules/zod/v3/external.cjs +0 -22
  339. package/fullstacked_modules/zod/v3/external.d.cts +0 -6
  340. package/fullstacked_modules/zod/v3/external.d.ts +0 -6
  341. package/fullstacked_modules/zod/v3/external.js +0 -6
  342. package/fullstacked_modules/zod/v3/helpers/enumUtil.cjs +0 -2
  343. package/fullstacked_modules/zod/v3/helpers/enumUtil.d.cts +0 -8
  344. package/fullstacked_modules/zod/v3/helpers/enumUtil.d.ts +0 -8
  345. package/fullstacked_modules/zod/v3/helpers/enumUtil.js +0 -1
  346. package/fullstacked_modules/zod/v3/helpers/errorUtil.cjs +0 -9
  347. package/fullstacked_modules/zod/v3/helpers/errorUtil.d.cts +0 -9
  348. package/fullstacked_modules/zod/v3/helpers/errorUtil.d.ts +0 -9
  349. package/fullstacked_modules/zod/v3/helpers/errorUtil.js +0 -6
  350. package/fullstacked_modules/zod/v3/helpers/parseUtil.cjs +0 -124
  351. package/fullstacked_modules/zod/v3/helpers/parseUtil.d.cts +0 -78
  352. package/fullstacked_modules/zod/v3/helpers/parseUtil.d.ts +0 -78
  353. package/fullstacked_modules/zod/v3/helpers/parseUtil.js +0 -109
  354. package/fullstacked_modules/zod/v3/helpers/partialUtil.cjs +0 -2
  355. package/fullstacked_modules/zod/v3/helpers/partialUtil.d.cts +0 -8
  356. package/fullstacked_modules/zod/v3/helpers/partialUtil.d.ts +0 -8
  357. package/fullstacked_modules/zod/v3/helpers/partialUtil.js +0 -1
  358. package/fullstacked_modules/zod/v3/helpers/typeAliases.cjs +0 -2
  359. package/fullstacked_modules/zod/v3/helpers/typeAliases.d.cts +0 -2
  360. package/fullstacked_modules/zod/v3/helpers/typeAliases.d.ts +0 -2
  361. package/fullstacked_modules/zod/v3/helpers/typeAliases.js +0 -1
  362. package/fullstacked_modules/zod/v3/helpers/util.cjs +0 -137
  363. package/fullstacked_modules/zod/v3/helpers/util.d.cts +0 -85
  364. package/fullstacked_modules/zod/v3/helpers/util.d.ts +0 -85
  365. package/fullstacked_modules/zod/v3/helpers/util.js +0 -133
  366. package/fullstacked_modules/zod/v3/index.cjs +0 -33
  367. package/fullstacked_modules/zod/v3/index.d.cts +0 -4
  368. package/fullstacked_modules/zod/v3/index.d.ts +0 -4
  369. package/fullstacked_modules/zod/v3/index.js +0 -4
  370. package/fullstacked_modules/zod/v3/locales/en.cjs +0 -112
  371. package/fullstacked_modules/zod/v3/locales/en.d.cts +0 -3
  372. package/fullstacked_modules/zod/v3/locales/en.d.ts +0 -3
  373. package/fullstacked_modules/zod/v3/locales/en.js +0 -109
  374. package/fullstacked_modules/zod/v3/package.json +0 -6
  375. package/fullstacked_modules/zod/v3/standard-schema.cjs +0 -2
  376. package/fullstacked_modules/zod/v3/standard-schema.d.cts +0 -102
  377. package/fullstacked_modules/zod/v3/standard-schema.d.ts +0 -102
  378. package/fullstacked_modules/zod/v3/standard-schema.js +0 -1
  379. package/fullstacked_modules/zod/v3/types.cjs +0 -3777
  380. package/fullstacked_modules/zod/v3/types.d.cts +0 -1034
  381. package/fullstacked_modules/zod/v3/types.d.ts +0 -1034
  382. package/fullstacked_modules/zod/v3/types.js +0 -3695
  383. package/fullstacked_modules/zod/v4/classic/checks.cjs +0 -32
  384. package/fullstacked_modules/zod/v4/classic/checks.d.cts +0 -1
  385. package/fullstacked_modules/zod/v4/classic/checks.d.ts +0 -1
  386. package/fullstacked_modules/zod/v4/classic/checks.js +0 -1
  387. package/fullstacked_modules/zod/v4/classic/coerce.cjs +0 -47
  388. package/fullstacked_modules/zod/v4/classic/coerce.d.cts +0 -17
  389. package/fullstacked_modules/zod/v4/classic/coerce.d.ts +0 -17
  390. package/fullstacked_modules/zod/v4/classic/coerce.js +0 -17
  391. package/fullstacked_modules/zod/v4/classic/compat.cjs +0 -61
  392. package/fullstacked_modules/zod/v4/classic/compat.d.cts +0 -50
  393. package/fullstacked_modules/zod/v4/classic/compat.d.ts +0 -50
  394. package/fullstacked_modules/zod/v4/classic/compat.js +0 -31
  395. package/fullstacked_modules/zod/v4/classic/errors.cjs +0 -74
  396. package/fullstacked_modules/zod/v4/classic/errors.d.cts +0 -30
  397. package/fullstacked_modules/zod/v4/classic/errors.d.ts +0 -30
  398. package/fullstacked_modules/zod/v4/classic/errors.js +0 -48
  399. package/fullstacked_modules/zod/v4/classic/external.cjs +0 -70
  400. package/fullstacked_modules/zod/v4/classic/external.d.cts +0 -13
  401. package/fullstacked_modules/zod/v4/classic/external.d.ts +0 -13
  402. package/fullstacked_modules/zod/v4/classic/external.js +0 -18
  403. package/fullstacked_modules/zod/v4/classic/index.cjs +0 -33
  404. package/fullstacked_modules/zod/v4/classic/index.d.cts +0 -4
  405. package/fullstacked_modules/zod/v4/classic/index.d.ts +0 -4
  406. package/fullstacked_modules/zod/v4/classic/index.js +0 -4
  407. package/fullstacked_modules/zod/v4/classic/iso.cjs +0 -60
  408. package/fullstacked_modules/zod/v4/classic/iso.d.cts +0 -22
  409. package/fullstacked_modules/zod/v4/classic/iso.d.ts +0 -22
  410. package/fullstacked_modules/zod/v4/classic/iso.js +0 -30
  411. package/fullstacked_modules/zod/v4/classic/package.json +0 -6
  412. package/fullstacked_modules/zod/v4/classic/parse.cjs +0 -41
  413. package/fullstacked_modules/zod/v4/classic/parse.d.cts +0 -31
  414. package/fullstacked_modules/zod/v4/classic/parse.d.ts +0 -31
  415. package/fullstacked_modules/zod/v4/classic/parse.js +0 -15
  416. package/fullstacked_modules/zod/v4/classic/schemas.cjs +0 -1151
  417. package/fullstacked_modules/zod/v4/classic/schemas.d.cts +0 -673
  418. package/fullstacked_modules/zod/v4/classic/schemas.d.ts +0 -673
  419. package/fullstacked_modules/zod/v4/classic/schemas.js +0 -1040
  420. package/fullstacked_modules/zod/v4/core/api.cjs +0 -1060
  421. package/fullstacked_modules/zod/v4/core/api.d.cts +0 -295
  422. package/fullstacked_modules/zod/v4/core/api.d.ts +0 -295
  423. package/fullstacked_modules/zod/v4/core/api.js +0 -925
  424. package/fullstacked_modules/zod/v4/core/checks.cjs +0 -595
  425. package/fullstacked_modules/zod/v4/core/checks.d.cts +0 -278
  426. package/fullstacked_modules/zod/v4/core/checks.d.ts +0 -278
  427. package/fullstacked_modules/zod/v4/core/checks.js +0 -569
  428. package/fullstacked_modules/zod/v4/core/core.cjs +0 -74
  429. package/fullstacked_modules/zod/v4/core/core.d.cts +0 -52
  430. package/fullstacked_modules/zod/v4/core/core.d.ts +0 -52
  431. package/fullstacked_modules/zod/v4/core/core.js +0 -67
  432. package/fullstacked_modules/zod/v4/core/doc.cjs +0 -39
  433. package/fullstacked_modules/zod/v4/core/doc.d.cts +0 -14
  434. package/fullstacked_modules/zod/v4/core/doc.d.ts +0 -14
  435. package/fullstacked_modules/zod/v4/core/doc.js +0 -35
  436. package/fullstacked_modules/zod/v4/core/errors.cjs +0 -213
  437. package/fullstacked_modules/zod/v4/core/errors.d.cts +0 -210
  438. package/fullstacked_modules/zod/v4/core/errors.d.ts +0 -210
  439. package/fullstacked_modules/zod/v4/core/errors.js +0 -182
  440. package/fullstacked_modules/zod/v4/core/index.cjs +0 -43
  441. package/fullstacked_modules/zod/v4/core/index.d.cts +0 -14
  442. package/fullstacked_modules/zod/v4/core/index.d.ts +0 -14
  443. package/fullstacked_modules/zod/v4/core/index.js +0 -14
  444. package/fullstacked_modules/zod/v4/core/json-schema.cjs +0 -2
  445. package/fullstacked_modules/zod/v4/core/json-schema.d.cts +0 -88
  446. package/fullstacked_modules/zod/v4/core/json-schema.d.ts +0 -88
  447. package/fullstacked_modules/zod/v4/core/json-schema.js +0 -1
  448. package/fullstacked_modules/zod/v4/core/package.json +0 -6
  449. package/fullstacked_modules/zod/v4/core/parse.cjs +0 -131
  450. package/fullstacked_modules/zod/v4/core/parse.d.cts +0 -49
  451. package/fullstacked_modules/zod/v4/core/parse.d.ts +0 -49
  452. package/fullstacked_modules/zod/v4/core/parse.js +0 -93
  453. package/fullstacked_modules/zod/v4/core/regexes.cjs +0 -136
  454. package/fullstacked_modules/zod/v4/core/regexes.d.cts +0 -78
  455. package/fullstacked_modules/zod/v4/core/regexes.d.ts +0 -78
  456. package/fullstacked_modules/zod/v4/core/regexes.js +0 -127
  457. package/fullstacked_modules/zod/v4/core/registries.cjs +0 -57
  458. package/fullstacked_modules/zod/v4/core/registries.d.cts +0 -35
  459. package/fullstacked_modules/zod/v4/core/registries.d.ts +0 -35
  460. package/fullstacked_modules/zod/v4/core/registries.js +0 -52
  461. package/fullstacked_modules/zod/v4/core/schemas.cjs +0 -1986
  462. package/fullstacked_modules/zod/v4/core/schemas.d.cts +0 -1113
  463. package/fullstacked_modules/zod/v4/core/schemas.d.ts +0 -1113
  464. package/fullstacked_modules/zod/v4/core/schemas.js +0 -1955
  465. package/fullstacked_modules/zod/v4/core/standard-schema.cjs +0 -2
  466. package/fullstacked_modules/zod/v4/core/standard-schema.d.cts +0 -55
  467. package/fullstacked_modules/zod/v4/core/standard-schema.d.ts +0 -55
  468. package/fullstacked_modules/zod/v4/core/standard-schema.js +0 -1
  469. package/fullstacked_modules/zod/v4/core/to-json-schema.cjs +0 -920
  470. package/fullstacked_modules/zod/v4/core/to-json-schema.d.cts +0 -90
  471. package/fullstacked_modules/zod/v4/core/to-json-schema.d.ts +0 -90
  472. package/fullstacked_modules/zod/v4/core/to-json-schema.js +0 -915
  473. package/fullstacked_modules/zod/v4/core/util.cjs +0 -658
  474. package/fullstacked_modules/zod/v4/core/util.d.cts +0 -197
  475. package/fullstacked_modules/zod/v4/core/util.d.ts +0 -197
  476. package/fullstacked_modules/zod/v4/core/util.js +0 -601
  477. package/fullstacked_modules/zod/v4/core/versions.cjs +0 -8
  478. package/fullstacked_modules/zod/v4/core/versions.d.cts +0 -5
  479. package/fullstacked_modules/zod/v4/core/versions.d.ts +0 -5
  480. package/fullstacked_modules/zod/v4/core/versions.js +0 -5
  481. package/fullstacked_modules/zod/v4/index.cjs +0 -22
  482. package/fullstacked_modules/zod/v4/index.d.cts +0 -3
  483. package/fullstacked_modules/zod/v4/index.d.ts +0 -3
  484. package/fullstacked_modules/zod/v4/index.js +0 -3
  485. package/fullstacked_modules/zod/v4/locales/ar.cjs +0 -143
  486. package/fullstacked_modules/zod/v4/locales/ar.d.cts +0 -5
  487. package/fullstacked_modules/zod/v4/locales/ar.d.ts +0 -4
  488. package/fullstacked_modules/zod/v4/locales/ar.js +0 -116
  489. package/fullstacked_modules/zod/v4/locales/az.cjs +0 -142
  490. package/fullstacked_modules/zod/v4/locales/az.d.cts +0 -5
  491. package/fullstacked_modules/zod/v4/locales/az.d.ts +0 -4
  492. package/fullstacked_modules/zod/v4/locales/az.js +0 -115
  493. package/fullstacked_modules/zod/v4/locales/be.cjs +0 -191
  494. package/fullstacked_modules/zod/v4/locales/be.d.cts +0 -5
  495. package/fullstacked_modules/zod/v4/locales/be.d.ts +0 -4
  496. package/fullstacked_modules/zod/v4/locales/be.js +0 -164
  497. package/fullstacked_modules/zod/v4/locales/bg.cjs +0 -156
  498. package/fullstacked_modules/zod/v4/locales/bg.d.cts +0 -5
  499. package/fullstacked_modules/zod/v4/locales/bg.d.ts +0 -5
  500. package/fullstacked_modules/zod/v4/locales/bg.js +0 -128
  501. package/fullstacked_modules/zod/v4/locales/ca.cjs +0 -145
  502. package/fullstacked_modules/zod/v4/locales/ca.d.cts +0 -5
  503. package/fullstacked_modules/zod/v4/locales/ca.d.ts +0 -4
  504. package/fullstacked_modules/zod/v4/locales/ca.js +0 -118
  505. package/fullstacked_modules/zod/v4/locales/cs.cjs +0 -162
  506. package/fullstacked_modules/zod/v4/locales/cs.d.cts +0 -5
  507. package/fullstacked_modules/zod/v4/locales/cs.d.ts +0 -4
  508. package/fullstacked_modules/zod/v4/locales/cs.js +0 -135
  509. package/fullstacked_modules/zod/v4/locales/da.cjs +0 -158
  510. package/fullstacked_modules/zod/v4/locales/da.d.cts +0 -5
  511. package/fullstacked_modules/zod/v4/locales/da.d.ts +0 -4
  512. package/fullstacked_modules/zod/v4/locales/da.js +0 -131
  513. package/fullstacked_modules/zod/v4/locales/de.cjs +0 -143
  514. package/fullstacked_modules/zod/v4/locales/de.d.cts +0 -5
  515. package/fullstacked_modules/zod/v4/locales/de.d.ts +0 -4
  516. package/fullstacked_modules/zod/v4/locales/de.js +0 -116
  517. package/fullstacked_modules/zod/v4/locales/en.cjs +0 -145
  518. package/fullstacked_modules/zod/v4/locales/en.d.cts +0 -5
  519. package/fullstacked_modules/zod/v4/locales/en.d.ts +0 -5
  520. package/fullstacked_modules/zod/v4/locales/en.js +0 -117
  521. package/fullstacked_modules/zod/v4/locales/eo.cjs +0 -144
  522. package/fullstacked_modules/zod/v4/locales/eo.d.cts +0 -5
  523. package/fullstacked_modules/zod/v4/locales/eo.d.ts +0 -5
  524. package/fullstacked_modules/zod/v4/locales/eo.js +0 -116
  525. package/fullstacked_modules/zod/v4/locales/es.cjs +0 -176
  526. package/fullstacked_modules/zod/v4/locales/es.d.cts +0 -5
  527. package/fullstacked_modules/zod/v4/locales/es.d.ts +0 -4
  528. package/fullstacked_modules/zod/v4/locales/es.js +0 -149
  529. package/fullstacked_modules/zod/v4/locales/fa.cjs +0 -149
  530. package/fullstacked_modules/zod/v4/locales/fa.d.cts +0 -5
  531. package/fullstacked_modules/zod/v4/locales/fa.d.ts +0 -4
  532. package/fullstacked_modules/zod/v4/locales/fa.js +0 -122
  533. package/fullstacked_modules/zod/v4/locales/fi.cjs +0 -149
  534. package/fullstacked_modules/zod/v4/locales/fi.d.cts +0 -5
  535. package/fullstacked_modules/zod/v4/locales/fi.d.ts +0 -4
  536. package/fullstacked_modules/zod/v4/locales/fi.js +0 -122
  537. package/fullstacked_modules/zod/v4/locales/fr-CA.cjs +0 -144
  538. package/fullstacked_modules/zod/v4/locales/fr-CA.d.cts +0 -5
  539. package/fullstacked_modules/zod/v4/locales/fr-CA.d.ts +0 -4
  540. package/fullstacked_modules/zod/v4/locales/fr-CA.js +0 -117
  541. package/fullstacked_modules/zod/v4/locales/fr.cjs +0 -143
  542. package/fullstacked_modules/zod/v4/locales/fr.d.cts +0 -5
  543. package/fullstacked_modules/zod/v4/locales/fr.d.ts +0 -4
  544. package/fullstacked_modules/zod/v4/locales/fr.js +0 -116
  545. package/fullstacked_modules/zod/v4/locales/he.cjs +0 -144
  546. package/fullstacked_modules/zod/v4/locales/he.d.cts +0 -5
  547. package/fullstacked_modules/zod/v4/locales/he.d.ts +0 -4
  548. package/fullstacked_modules/zod/v4/locales/he.js +0 -117
  549. package/fullstacked_modules/zod/v4/locales/hu.cjs +0 -144
  550. package/fullstacked_modules/zod/v4/locales/hu.d.cts +0 -5
  551. package/fullstacked_modules/zod/v4/locales/hu.d.ts +0 -4
  552. package/fullstacked_modules/zod/v4/locales/hu.js +0 -117
  553. package/fullstacked_modules/zod/v4/locales/id.cjs +0 -143
  554. package/fullstacked_modules/zod/v4/locales/id.d.cts +0 -5
  555. package/fullstacked_modules/zod/v4/locales/id.d.ts +0 -4
  556. package/fullstacked_modules/zod/v4/locales/id.js +0 -116
  557. package/fullstacked_modules/zod/v4/locales/index.cjs +0 -100
  558. package/fullstacked_modules/zod/v4/locales/index.d.cts +0 -47
  559. package/fullstacked_modules/zod/v4/locales/index.d.ts +0 -47
  560. package/fullstacked_modules/zod/v4/locales/index.js +0 -47
  561. package/fullstacked_modules/zod/v4/locales/is.cjs +0 -145
  562. package/fullstacked_modules/zod/v4/locales/is.d.cts +0 -5
  563. package/fullstacked_modules/zod/v4/locales/is.d.ts +0 -5
  564. package/fullstacked_modules/zod/v4/locales/is.js +0 -117
  565. package/fullstacked_modules/zod/v4/locales/it.cjs +0 -144
  566. package/fullstacked_modules/zod/v4/locales/it.d.cts +0 -5
  567. package/fullstacked_modules/zod/v4/locales/it.d.ts +0 -4
  568. package/fullstacked_modules/zod/v4/locales/it.js +0 -117
  569. package/fullstacked_modules/zod/v4/locales/ja.cjs +0 -142
  570. package/fullstacked_modules/zod/v4/locales/ja.d.cts +0 -5
  571. package/fullstacked_modules/zod/v4/locales/ja.d.ts +0 -4
  572. package/fullstacked_modules/zod/v4/locales/ja.js +0 -115
  573. package/fullstacked_modules/zod/v4/locales/ka.cjs +0 -153
  574. package/fullstacked_modules/zod/v4/locales/ka.d.cts +0 -5
  575. package/fullstacked_modules/zod/v4/locales/ka.d.ts +0 -5
  576. package/fullstacked_modules/zod/v4/locales/ka.js +0 -125
  577. package/fullstacked_modules/zod/v4/locales/kh.cjs +0 -12
  578. package/fullstacked_modules/zod/v4/locales/kh.d.cts +0 -5
  579. package/fullstacked_modules/zod/v4/locales/kh.d.ts +0 -5
  580. package/fullstacked_modules/zod/v4/locales/kh.js +0 -5
  581. package/fullstacked_modules/zod/v4/locales/km.cjs +0 -144
  582. package/fullstacked_modules/zod/v4/locales/km.d.cts +0 -5
  583. package/fullstacked_modules/zod/v4/locales/km.d.ts +0 -4
  584. package/fullstacked_modules/zod/v4/locales/km.js +0 -117
  585. package/fullstacked_modules/zod/v4/locales/ko.cjs +0 -148
  586. package/fullstacked_modules/zod/v4/locales/ko.d.cts +0 -5
  587. package/fullstacked_modules/zod/v4/locales/ko.d.ts +0 -4
  588. package/fullstacked_modules/zod/v4/locales/ko.js +0 -121
  589. package/fullstacked_modules/zod/v4/locales/lt.cjs +0 -258
  590. package/fullstacked_modules/zod/v4/locales/lt.d.cts +0 -5
  591. package/fullstacked_modules/zod/v4/locales/lt.d.ts +0 -5
  592. package/fullstacked_modules/zod/v4/locales/lt.js +0 -230
  593. package/fullstacked_modules/zod/v4/locales/mk.cjs +0 -145
  594. package/fullstacked_modules/zod/v4/locales/mk.d.cts +0 -5
  595. package/fullstacked_modules/zod/v4/locales/mk.d.ts +0 -4
  596. package/fullstacked_modules/zod/v4/locales/mk.js +0 -118
  597. package/fullstacked_modules/zod/v4/locales/ms.cjs +0 -143
  598. package/fullstacked_modules/zod/v4/locales/ms.d.cts +0 -5
  599. package/fullstacked_modules/zod/v4/locales/ms.d.ts +0 -4
  600. package/fullstacked_modules/zod/v4/locales/ms.js +0 -116
  601. package/fullstacked_modules/zod/v4/locales/nl.cjs +0 -144
  602. package/fullstacked_modules/zod/v4/locales/nl.d.cts +0 -5
  603. package/fullstacked_modules/zod/v4/locales/nl.d.ts +0 -4
  604. package/fullstacked_modules/zod/v4/locales/nl.js +0 -117
  605. package/fullstacked_modules/zod/v4/locales/no.cjs +0 -143
  606. package/fullstacked_modules/zod/v4/locales/no.d.cts +0 -5
  607. package/fullstacked_modules/zod/v4/locales/no.d.ts +0 -4
  608. package/fullstacked_modules/zod/v4/locales/no.js +0 -116
  609. package/fullstacked_modules/zod/v4/locales/ota.cjs +0 -144
  610. package/fullstacked_modules/zod/v4/locales/ota.d.cts +0 -5
  611. package/fullstacked_modules/zod/v4/locales/ota.d.ts +0 -4
  612. package/fullstacked_modules/zod/v4/locales/ota.js +0 -117
  613. package/fullstacked_modules/zod/v4/locales/package.json +0 -6
  614. package/fullstacked_modules/zod/v4/locales/pl.cjs +0 -144
  615. package/fullstacked_modules/zod/v4/locales/pl.d.cts +0 -5
  616. package/fullstacked_modules/zod/v4/locales/pl.d.ts +0 -4
  617. package/fullstacked_modules/zod/v4/locales/pl.js +0 -117
  618. package/fullstacked_modules/zod/v4/locales/ps.cjs +0 -149
  619. package/fullstacked_modules/zod/v4/locales/ps.d.cts +0 -5
  620. package/fullstacked_modules/zod/v4/locales/ps.d.ts +0 -4
  621. package/fullstacked_modules/zod/v4/locales/ps.js +0 -122
  622. package/fullstacked_modules/zod/v4/locales/pt.cjs +0 -143
  623. package/fullstacked_modules/zod/v4/locales/pt.d.cts +0 -5
  624. package/fullstacked_modules/zod/v4/locales/pt.d.ts +0 -4
  625. package/fullstacked_modules/zod/v4/locales/pt.js +0 -116
  626. package/fullstacked_modules/zod/v4/locales/ru.cjs +0 -191
  627. package/fullstacked_modules/zod/v4/locales/ru.d.cts +0 -5
  628. package/fullstacked_modules/zod/v4/locales/ru.d.ts +0 -4
  629. package/fullstacked_modules/zod/v4/locales/ru.js +0 -164
  630. package/fullstacked_modules/zod/v4/locales/sl.cjs +0 -144
  631. package/fullstacked_modules/zod/v4/locales/sl.d.cts +0 -5
  632. package/fullstacked_modules/zod/v4/locales/sl.d.ts +0 -4
  633. package/fullstacked_modules/zod/v4/locales/sl.js +0 -117
  634. package/fullstacked_modules/zod/v4/locales/sv.cjs +0 -145
  635. package/fullstacked_modules/zod/v4/locales/sv.d.cts +0 -5
  636. package/fullstacked_modules/zod/v4/locales/sv.d.ts +0 -4
  637. package/fullstacked_modules/zod/v4/locales/sv.js +0 -118
  638. package/fullstacked_modules/zod/v4/locales/ta.cjs +0 -144
  639. package/fullstacked_modules/zod/v4/locales/ta.d.cts +0 -5
  640. package/fullstacked_modules/zod/v4/locales/ta.d.ts +0 -4
  641. package/fullstacked_modules/zod/v4/locales/ta.js +0 -117
  642. package/fullstacked_modules/zod/v4/locales/th.cjs +0 -144
  643. package/fullstacked_modules/zod/v4/locales/th.d.cts +0 -5
  644. package/fullstacked_modules/zod/v4/locales/th.d.ts +0 -4
  645. package/fullstacked_modules/zod/v4/locales/th.js +0 -117
  646. package/fullstacked_modules/zod/v4/locales/tr.cjs +0 -143
  647. package/fullstacked_modules/zod/v4/locales/tr.d.cts +0 -5
  648. package/fullstacked_modules/zod/v4/locales/tr.d.ts +0 -5
  649. package/fullstacked_modules/zod/v4/locales/tr.js +0 -115
  650. package/fullstacked_modules/zod/v4/locales/ua.cjs +0 -12
  651. package/fullstacked_modules/zod/v4/locales/ua.d.cts +0 -5
  652. package/fullstacked_modules/zod/v4/locales/ua.d.ts +0 -5
  653. package/fullstacked_modules/zod/v4/locales/ua.js +0 -5
  654. package/fullstacked_modules/zod/v4/locales/uk.cjs +0 -144
  655. package/fullstacked_modules/zod/v4/locales/uk.d.cts +0 -5
  656. package/fullstacked_modules/zod/v4/locales/uk.d.ts +0 -4
  657. package/fullstacked_modules/zod/v4/locales/uk.js +0 -117
  658. package/fullstacked_modules/zod/v4/locales/ur.cjs +0 -144
  659. package/fullstacked_modules/zod/v4/locales/ur.d.cts +0 -5
  660. package/fullstacked_modules/zod/v4/locales/ur.d.ts +0 -4
  661. package/fullstacked_modules/zod/v4/locales/ur.js +0 -117
  662. package/fullstacked_modules/zod/v4/locales/vi.cjs +0 -143
  663. package/fullstacked_modules/zod/v4/locales/vi.d.cts +0 -5
  664. package/fullstacked_modules/zod/v4/locales/vi.d.ts +0 -4
  665. package/fullstacked_modules/zod/v4/locales/vi.js +0 -116
  666. package/fullstacked_modules/zod/v4/locales/yo.cjs +0 -142
  667. package/fullstacked_modules/zod/v4/locales/yo.d.cts +0 -5
  668. package/fullstacked_modules/zod/v4/locales/yo.d.ts +0 -4
  669. package/fullstacked_modules/zod/v4/locales/yo.js +0 -115
  670. package/fullstacked_modules/zod/v4/locales/zh-CN.cjs +0 -143
  671. package/fullstacked_modules/zod/v4/locales/zh-CN.d.cts +0 -5
  672. package/fullstacked_modules/zod/v4/locales/zh-CN.d.ts +0 -4
  673. package/fullstacked_modules/zod/v4/locales/zh-CN.js +0 -116
  674. package/fullstacked_modules/zod/v4/locales/zh-TW.cjs +0 -144
  675. package/fullstacked_modules/zod/v4/locales/zh-TW.d.cts +0 -5
  676. package/fullstacked_modules/zod/v4/locales/zh-TW.d.ts +0 -4
  677. package/fullstacked_modules/zod/v4/locales/zh-TW.js +0 -117
  678. package/fullstacked_modules/zod/v4/mini/checks.cjs +0 -34
  679. package/fullstacked_modules/zod/v4/mini/checks.d.cts +0 -1
  680. package/fullstacked_modules/zod/v4/mini/checks.d.ts +0 -1
  681. package/fullstacked_modules/zod/v4/mini/checks.js +0 -1
  682. package/fullstacked_modules/zod/v4/mini/coerce.cjs +0 -47
  683. package/fullstacked_modules/zod/v4/mini/coerce.d.cts +0 -7
  684. package/fullstacked_modules/zod/v4/mini/coerce.d.ts +0 -7
  685. package/fullstacked_modules/zod/v4/mini/coerce.js +0 -17
  686. package/fullstacked_modules/zod/v4/mini/external.cjs +0 -62
  687. package/fullstacked_modules/zod/v4/mini/external.d.cts +0 -11
  688. package/fullstacked_modules/zod/v4/mini/external.d.ts +0 -11
  689. package/fullstacked_modules/zod/v4/mini/external.js +0 -13
  690. package/fullstacked_modules/zod/v4/mini/index.cjs +0 -32
  691. package/fullstacked_modules/zod/v4/mini/index.d.cts +0 -3
  692. package/fullstacked_modules/zod/v4/mini/index.d.ts +0 -3
  693. package/fullstacked_modules/zod/v4/mini/index.js +0 -3
  694. package/fullstacked_modules/zod/v4/mini/iso.cjs +0 -60
  695. package/fullstacked_modules/zod/v4/mini/iso.d.cts +0 -22
  696. package/fullstacked_modules/zod/v4/mini/iso.d.ts +0 -22
  697. package/fullstacked_modules/zod/v4/mini/iso.js +0 -30
  698. package/fullstacked_modules/zod/v4/mini/package.json +0 -6
  699. package/fullstacked_modules/zod/v4/mini/parse.cjs +0 -16
  700. package/fullstacked_modules/zod/v4/mini/parse.d.cts +0 -1
  701. package/fullstacked_modules/zod/v4/mini/parse.d.ts +0 -1
  702. package/fullstacked_modules/zod/v4/mini/parse.js +0 -1
  703. package/fullstacked_modules/zod/v4/mini/schemas.cjs +0 -892
  704. package/fullstacked_modules/zod/v4/mini/schemas.d.cts +0 -407
  705. package/fullstacked_modules/zod/v4/mini/schemas.d.ts +0 -407
  706. package/fullstacked_modules/zod/v4/mini/schemas.js +0 -775
  707. package/fullstacked_modules/zod/v4/package.json +0 -6
  708. package/fullstacked_modules/zod/v4-mini/index.cjs +0 -17
  709. package/fullstacked_modules/zod/v4-mini/index.d.cts +0 -1
  710. package/fullstacked_modules/zod/v4-mini/index.d.ts +0 -1
  711. package/fullstacked_modules/zod/v4-mini/index.js +0 -1
  712. package/fullstacked_modules/zod/v4-mini/package.json +0 -6
  713. /package/fullstacked_modules/{platform/index.ts → platform.ts} +0 -0
@@ -1,2197 +0,0 @@
1
- import * as core from "../core/index.js";
2
- import { util } from "../core/index.js";
3
-
4
- import * as checks from "./checks.js";
5
- import * as iso from "./iso.js";
6
- import * as parse from "./parse.js";
7
-
8
- ///////////////////////////////////////////
9
- ///////////////////////////////////////////
10
- //////////// ////////////
11
- //////////// ZodType ////////////
12
- //////////// ////////////
13
- ///////////////////////////////////////////
14
- ///////////////////////////////////////////
15
-
16
- export interface ZodType<
17
- out Output = unknown,
18
- out Input = unknown,
19
- out Internals extends core.$ZodTypeInternals<Output, Input> = core.$ZodTypeInternals<Output, Input>,
20
- > extends core.$ZodType<Output, Input, Internals> {
21
- def: Internals["def"];
22
- type: Internals["def"]["type"];
23
-
24
- /** @deprecated Use `.def` instead. */
25
- _def: Internals["def"];
26
- /** @deprecated Use `z.output<typeof schema>` instead. */
27
- _output: Internals["output"];
28
- /** @deprecated Use `z.input<typeof schema>` instead. */
29
- _input: Internals["input"];
30
-
31
- // base methods
32
- check(...checks: (core.CheckFn<core.output<this>> | core.$ZodCheck<core.output<this>>)[]): this;
33
- clone(def?: Internals["def"], params?: { parent: boolean }): this;
34
- register<R extends core.$ZodRegistry>(
35
- registry: R,
36
- ...meta: this extends R["_schema"]
37
- ? undefined extends R["_meta"]
38
- ? [core.$replace<R["_meta"], this>?]
39
- : [core.$replace<R["_meta"], this>]
40
- : ["Incompatible schema"]
41
- ): this;
42
-
43
- brand<T extends PropertyKey = PropertyKey>(value?: T): PropertyKey extends T ? this : core.$ZodBranded<this, T>;
44
-
45
- // parsing
46
- parse(data: unknown, params?: core.ParseContext<core.$ZodIssue>): core.output<this>;
47
- safeParse(data: unknown, params?: core.ParseContext<core.$ZodIssue>): parse.ZodSafeParseResult<core.output<this>>;
48
- parseAsync(data: unknown, params?: core.ParseContext<core.$ZodIssue>): Promise<core.output<this>>;
49
- safeParseAsync(
50
- data: unknown,
51
- params?: core.ParseContext<core.$ZodIssue>
52
- ): Promise<parse.ZodSafeParseResult<core.output<this>>>;
53
- spa: (
54
- data: unknown,
55
- params?: core.ParseContext<core.$ZodIssue>
56
- ) => Promise<parse.ZodSafeParseResult<core.output<this>>>;
57
-
58
- // encoding/decoding
59
- encode(data: core.output<this>, params?: core.ParseContext<core.$ZodIssue>): core.input<this>;
60
- decode(data: core.input<this>, params?: core.ParseContext<core.$ZodIssue>): core.output<this>;
61
- encodeAsync(data: core.output<this>, params?: core.ParseContext<core.$ZodIssue>): Promise<core.input<this>>;
62
- decodeAsync(data: core.input<this>, params?: core.ParseContext<core.$ZodIssue>): Promise<core.output<this>>;
63
- safeEncode(
64
- data: core.output<this>,
65
- params?: core.ParseContext<core.$ZodIssue>
66
- ): parse.ZodSafeParseResult<core.input<this>>;
67
- safeDecode(
68
- data: core.input<this>,
69
- params?: core.ParseContext<core.$ZodIssue>
70
- ): parse.ZodSafeParseResult<core.output<this>>;
71
- safeEncodeAsync(
72
- data: core.output<this>,
73
- params?: core.ParseContext<core.$ZodIssue>
74
- ): Promise<parse.ZodSafeParseResult<core.input<this>>>;
75
- safeDecodeAsync(
76
- data: core.input<this>,
77
- params?: core.ParseContext<core.$ZodIssue>
78
- ): Promise<parse.ZodSafeParseResult<core.output<this>>>;
79
-
80
- // refinements
81
- refine(check: (arg: core.output<this>) => unknown | Promise<unknown>, params?: string | core.$ZodCustomParams): this;
82
- superRefine(
83
- refinement: (arg: core.output<this>, ctx: core.$RefinementCtx<core.output<this>>) => void | Promise<void>
84
- ): this;
85
- overwrite(fn: (x: core.output<this>) => core.output<this>): this;
86
-
87
- // wrappers
88
- optional(): ZodOptional<this>;
89
- nonoptional(params?: string | core.$ZodNonOptionalParams): ZodNonOptional<this>;
90
- nullable(): ZodNullable<this>;
91
- nullish(): ZodOptional<ZodNullable<this>>;
92
- default(def: util.NoUndefined<core.output<this>>): ZodDefault<this>;
93
- default(def: () => util.NoUndefined<core.output<this>>): ZodDefault<this>;
94
- prefault(def: () => core.input<this>): ZodPrefault<this>;
95
- prefault(def: core.input<this>): ZodPrefault<this>;
96
- array(): ZodArray<this>;
97
- or<T extends core.SomeType>(option: T): ZodUnion<[this, T]>;
98
- and<T extends core.SomeType>(incoming: T): ZodIntersection<this, T>;
99
- transform<NewOut>(
100
- transform: (arg: core.output<this>, ctx: core.$RefinementCtx<core.output<this>>) => NewOut | Promise<NewOut>
101
- ): ZodPipe<this, ZodTransform<Awaited<NewOut>, core.output<this>>>;
102
- catch(def: core.output<this>): ZodCatch<this>;
103
- catch(def: (ctx: core.$ZodCatchCtx) => core.output<this>): ZodCatch<this>;
104
- pipe<T extends core.$ZodType<any, core.output<this>>>(
105
- target: T | core.$ZodType<any, core.output<this>>
106
- ): ZodPipe<this, T>;
107
- readonly(): ZodReadonly<this>;
108
-
109
- /** Returns a new instance that has been registered in `z.globalRegistry` with the specified description */
110
- describe(description: string): this;
111
- description?: string;
112
- /** Returns the metadata associated with this instance in `z.globalRegistry` */
113
- meta(): core.$replace<core.GlobalMeta, this> | undefined;
114
- /** Returns a new instance that has been registered in `z.globalRegistry` with the specified metadata */
115
- meta(data: core.$replace<core.GlobalMeta, this>): this;
116
-
117
- // helpers
118
- /** @deprecated Try safe-parsing `undefined` (this is what `isOptional` does internally):
119
- *
120
- * ```ts
121
- * const schema = z.string().optional();
122
- * const isOptional = schema.safeParse(undefined).success; // true
123
- * ```
124
- */
125
- isOptional(): boolean;
126
- /**
127
- * @deprecated Try safe-parsing `null` (this is what `isNullable` does internally):
128
- *
129
- * ```ts
130
- * const schema = z.string().nullable();
131
- * const isNullable = schema.safeParse(null).success; // true
132
- * ```
133
- */
134
- isNullable(): boolean;
135
- }
136
-
137
- export interface _ZodType<out Internals extends core.$ZodTypeInternals = core.$ZodTypeInternals>
138
- extends ZodType<any, any, Internals> {}
139
-
140
- export const ZodType: core.$constructor<ZodType> = /*@__PURE__*/ core.$constructor("ZodType", (inst, def) => {
141
- core.$ZodType.init(inst, def);
142
- inst.def = def;
143
- inst.type = def.type;
144
- Object.defineProperty(inst, "_def", { value: def });
145
-
146
- // base methods
147
- inst.check = (...checks) => {
148
- return inst.clone(
149
- util.mergeDefs(def, {
150
- checks: [
151
- ...(def.checks ?? []),
152
- ...checks.map((ch) =>
153
- typeof ch === "function" ? { _zod: { check: ch, def: { check: "custom" }, onattach: [] } } : ch
154
- ),
155
- ],
156
- })
157
- );
158
- };
159
- inst.clone = (def, params) => core.clone(inst, def, params);
160
- inst.brand = () => inst as any;
161
- inst.register = ((reg: any, meta: any) => {
162
- reg.add(inst, meta);
163
- return inst;
164
- }) as any;
165
-
166
- // parsing
167
- inst.parse = (data, params) => parse.parse(inst, data, params, { callee: inst.parse });
168
- inst.safeParse = (data, params) => parse.safeParse(inst, data, params);
169
- inst.parseAsync = async (data, params) => parse.parseAsync(inst, data, params, { callee: inst.parseAsync });
170
- inst.safeParseAsync = async (data, params) => parse.safeParseAsync(inst, data, params);
171
- inst.spa = inst.safeParseAsync;
172
-
173
- // encoding/decoding
174
- inst.encode = (data, params) => parse.encode(inst, data, params);
175
- inst.decode = (data, params) => parse.decode(inst, data, params);
176
- inst.encodeAsync = async (data, params) => parse.encodeAsync(inst, data, params);
177
- inst.decodeAsync = async (data, params) => parse.decodeAsync(inst, data, params);
178
- inst.safeEncode = (data, params) => parse.safeEncode(inst, data, params);
179
- inst.safeDecode = (data, params) => parse.safeDecode(inst, data, params);
180
- inst.safeEncodeAsync = async (data, params) => parse.safeEncodeAsync(inst, data, params);
181
- inst.safeDecodeAsync = async (data, params) => parse.safeDecodeAsync(inst, data, params);
182
-
183
- // refinements
184
- inst.refine = (check, params) => inst.check(refine(check, params));
185
- inst.superRefine = (refinement) => inst.check(superRefine(refinement));
186
- inst.overwrite = (fn) => inst.check(checks.overwrite(fn));
187
-
188
- // wrappers
189
- inst.optional = () => optional(inst);
190
- inst.nullable = () => nullable(inst);
191
- inst.nullish = () => optional(nullable(inst));
192
- inst.nonoptional = (params) => nonoptional(inst, params);
193
- inst.array = () => array(inst);
194
- inst.or = (arg) => union([inst, arg]);
195
- inst.and = (arg) => intersection(inst, arg);
196
- inst.transform = (tx) => pipe(inst, transform(tx as any)) as never;
197
- inst.default = (def) => _default(inst, def);
198
- inst.prefault = (def) => prefault(inst, def);
199
- // inst.coalesce = (def, params) => coalesce(inst, def, params);
200
- inst.catch = (params) => _catch(inst, params);
201
- inst.pipe = (target) => pipe(inst, target);
202
- inst.readonly = () => readonly(inst);
203
-
204
- // meta
205
- inst.describe = (description) => {
206
- const cl = inst.clone();
207
- core.globalRegistry.add(cl, { description });
208
- return cl;
209
- };
210
- Object.defineProperty(inst, "description", {
211
- get() {
212
- return core.globalRegistry.get(inst)?.description;
213
- },
214
- configurable: true,
215
- });
216
- inst.meta = (...args: any) => {
217
- if (args.length === 0) {
218
- return core.globalRegistry.get(inst);
219
- }
220
- const cl = inst.clone();
221
- core.globalRegistry.add(cl, args[0]);
222
- return cl as any;
223
- };
224
-
225
- // helpers
226
- inst.isOptional = () => inst.safeParse(undefined).success;
227
- inst.isNullable = () => inst.safeParse(null).success;
228
- return inst;
229
- });
230
-
231
- // ZodString
232
- export interface _ZodString<T extends core.$ZodStringInternals<unknown> = core.$ZodStringInternals<unknown>>
233
- extends _ZodType<T> {
234
- format: string | null;
235
- minLength: number | null;
236
- maxLength: number | null;
237
-
238
- // miscellaneous checks
239
- regex(regex: RegExp, params?: string | core.$ZodCheckRegexParams): this;
240
- includes(value: string, params?: core.$ZodCheckIncludesParams): this;
241
- startsWith(value: string, params?: string | core.$ZodCheckStartsWithParams): this;
242
- endsWith(value: string, params?: string | core.$ZodCheckEndsWithParams): this;
243
- min(minLength: number, params?: string | core.$ZodCheckMinLengthParams): this;
244
- max(maxLength: number, params?: string | core.$ZodCheckMaxLengthParams): this;
245
- length(len: number, params?: string | core.$ZodCheckLengthEqualsParams): this;
246
- nonempty(params?: string | core.$ZodCheckMinLengthParams): this;
247
- lowercase(params?: string | core.$ZodCheckLowerCaseParams): this;
248
- uppercase(params?: string | core.$ZodCheckUpperCaseParams): this;
249
-
250
- // transforms
251
- trim(): this;
252
- normalize(form?: "NFC" | "NFD" | "NFKC" | "NFKD" | (string & {})): this;
253
- toLowerCase(): this;
254
- toUpperCase(): this;
255
- }
256
-
257
- /** @internal */
258
- export const _ZodString: core.$constructor<_ZodString> = /*@__PURE__*/ core.$constructor("_ZodString", (inst, def) => {
259
- core.$ZodString.init(inst, def);
260
- ZodType.init(inst, def);
261
-
262
- const bag = inst._zod.bag;
263
- inst.format = bag.format ?? null;
264
- inst.minLength = bag.minimum ?? null;
265
- inst.maxLength = bag.maximum ?? null;
266
-
267
- // validations
268
- inst.regex = (...args) => inst.check(checks.regex(...args));
269
- inst.includes = (...args) => inst.check(checks.includes(...args));
270
- inst.startsWith = (...args) => inst.check(checks.startsWith(...args));
271
- inst.endsWith = (...args) => inst.check(checks.endsWith(...args));
272
- inst.min = (...args) => inst.check(checks.minLength(...args));
273
- inst.max = (...args) => inst.check(checks.maxLength(...args));
274
- inst.length = (...args) => inst.check(checks.length(...args));
275
- inst.nonempty = (...args) => inst.check(checks.minLength(1, ...args));
276
- inst.lowercase = (params) => inst.check(checks.lowercase(params));
277
- inst.uppercase = (params) => inst.check(checks.uppercase(params));
278
-
279
- // transforms
280
- inst.trim = () => inst.check(checks.trim());
281
- inst.normalize = (...args) => inst.check(checks.normalize(...args));
282
- inst.toLowerCase = () => inst.check(checks.toLowerCase());
283
- inst.toUpperCase = () => inst.check(checks.toUpperCase());
284
- });
285
-
286
- export interface ZodString extends _ZodString<core.$ZodStringInternals<string>> {
287
- // string format checks
288
-
289
- /** @deprecated Use `z.email()` instead. */
290
- email(params?: string | core.$ZodCheckEmailParams): this;
291
- /** @deprecated Use `z.url()` instead. */
292
- url(params?: string | core.$ZodCheckURLParams): this;
293
- /** @deprecated Use `z.jwt()` instead. */
294
- jwt(params?: string | core.$ZodCheckJWTParams): this;
295
- /** @deprecated Use `z.emoji()` instead. */
296
- emoji(params?: string | core.$ZodCheckEmojiParams): this;
297
- /** @deprecated Use `z.guid()` instead. */
298
- guid(params?: string | core.$ZodCheckGUIDParams): this;
299
- /** @deprecated Use `z.uuid()` instead. */
300
- uuid(params?: string | core.$ZodCheckUUIDParams): this;
301
- /** @deprecated Use `z.uuid()` instead. */
302
- uuidv4(params?: string | core.$ZodCheckUUIDParams): this;
303
- /** @deprecated Use `z.uuid()` instead. */
304
- uuidv6(params?: string | core.$ZodCheckUUIDParams): this;
305
- /** @deprecated Use `z.uuid()` instead. */
306
- uuidv7(params?: string | core.$ZodCheckUUIDParams): this;
307
- /** @deprecated Use `z.nanoid()` instead. */
308
- nanoid(params?: string | core.$ZodCheckNanoIDParams): this;
309
- /** @deprecated Use `z.guid()` instead. */
310
- guid(params?: string | core.$ZodCheckGUIDParams): this;
311
- /** @deprecated Use `z.cuid()` instead. */
312
- cuid(params?: string | core.$ZodCheckCUIDParams): this;
313
- /** @deprecated Use `z.cuid2()` instead. */
314
- cuid2(params?: string | core.$ZodCheckCUID2Params): this;
315
- /** @deprecated Use `z.ulid()` instead. */
316
- ulid(params?: string | core.$ZodCheckULIDParams): this;
317
- /** @deprecated Use `z.base64()` instead. */
318
- base64(params?: string | core.$ZodCheckBase64Params): this;
319
- /** @deprecated Use `z.base64url()` instead. */
320
- base64url(params?: string | core.$ZodCheckBase64URLParams): this;
321
- // /** @deprecated Use `z.jsonString()` instead. */
322
- // jsonString(params?: string | core.$ZodCheckJSONStringParams): this;
323
- /** @deprecated Use `z.xid()` instead. */
324
- xid(params?: string | core.$ZodCheckXIDParams): this;
325
- /** @deprecated Use `z.ksuid()` instead. */
326
- ksuid(params?: string | core.$ZodCheckKSUIDParams): this;
327
- // /** @deprecated Use `z.ipv4()` or `z.ipv6()` instead. */
328
- // ip(params?: string | (core.$ZodCheckIPv4Params & { version?: "v4" | "v6" })): ZodUnion<[this, this]>;
329
- /** @deprecated Use `z.ipv4()` instead. */
330
- ipv4(params?: string | core.$ZodCheckIPv4Params): this;
331
- /** @deprecated Use `z.ipv6()` instead. */
332
- ipv6(params?: string | core.$ZodCheckIPv6Params): this;
333
- /** @deprecated Use `z.cidrv4()` instead. */
334
- cidrv4(params?: string | core.$ZodCheckCIDRv4Params): this;
335
- /** @deprecated Use `z.cidrv6()` instead. */
336
- cidrv6(params?: string | core.$ZodCheckCIDRv6Params): this;
337
- /** @deprecated Use `z.e164()` instead. */
338
- e164(params?: string | core.$ZodCheckE164Params): this;
339
-
340
- // ISO 8601 checks
341
- /** @deprecated Use `z.iso.datetime()` instead. */
342
- datetime(params?: string | core.$ZodCheckISODateTimeParams): this;
343
- /** @deprecated Use `z.iso.date()` instead. */
344
- date(params?: string | core.$ZodCheckISODateParams): this;
345
- /** @deprecated Use `z.iso.time()` instead. */
346
- time(
347
- params?:
348
- | string
349
- // | {
350
- // message?: string | undefined;
351
- // precision?: number | null;
352
- // }
353
- | core.$ZodCheckISOTimeParams
354
- ): this;
355
- /** @deprecated Use `z.iso.duration()` instead. */
356
- duration(params?: string | core.$ZodCheckISODurationParams): this;
357
- }
358
-
359
- export const ZodString: core.$constructor<ZodString> = /*@__PURE__*/ core.$constructor("ZodString", (inst, def) => {
360
- core.$ZodString.init(inst, def);
361
- _ZodString.init(inst, def);
362
-
363
- inst.email = (params) => inst.check(core._email(ZodEmail, params));
364
- inst.url = (params) => inst.check(core._url(ZodURL, params));
365
- inst.jwt = (params) => inst.check(core._jwt(ZodJWT, params));
366
- inst.emoji = (params) => inst.check(core._emoji(ZodEmoji, params));
367
- inst.guid = (params) => inst.check(core._guid(ZodGUID, params));
368
- inst.uuid = (params) => inst.check(core._uuid(ZodUUID, params));
369
- inst.uuidv4 = (params) => inst.check(core._uuidv4(ZodUUID, params));
370
- inst.uuidv6 = (params) => inst.check(core._uuidv6(ZodUUID, params));
371
- inst.uuidv7 = (params) => inst.check(core._uuidv7(ZodUUID, params));
372
- inst.nanoid = (params) => inst.check(core._nanoid(ZodNanoID, params));
373
- inst.guid = (params) => inst.check(core._guid(ZodGUID, params));
374
- inst.cuid = (params) => inst.check(core._cuid(ZodCUID, params));
375
- inst.cuid2 = (params) => inst.check(core._cuid2(ZodCUID2, params));
376
- inst.ulid = (params) => inst.check(core._ulid(ZodULID, params));
377
- inst.base64 = (params) => inst.check(core._base64(ZodBase64, params));
378
- inst.base64url = (params) => inst.check(core._base64url(ZodBase64URL, params));
379
- inst.xid = (params) => inst.check(core._xid(ZodXID, params));
380
- inst.ksuid = (params) => inst.check(core._ksuid(ZodKSUID, params));
381
- inst.ipv4 = (params) => inst.check(core._ipv4(ZodIPv4, params));
382
- inst.ipv6 = (params) => inst.check(core._ipv6(ZodIPv6, params));
383
- inst.cidrv4 = (params) => inst.check(core._cidrv4(ZodCIDRv4, params));
384
- inst.cidrv6 = (params) => inst.check(core._cidrv6(ZodCIDRv6, params));
385
- inst.e164 = (params) => inst.check(core._e164(ZodE164, params));
386
-
387
- // iso
388
- inst.datetime = (params) => inst.check(iso.datetime(params as any));
389
- inst.date = (params) => inst.check(iso.date(params as any));
390
- inst.time = (params) => inst.check(iso.time(params as any));
391
- inst.duration = (params) => inst.check(iso.duration(params as any));
392
- });
393
-
394
- export function string(params?: string | core.$ZodStringParams): ZodString;
395
- export function string<T extends string>(params?: string | core.$ZodStringParams): core.$ZodType<T, T>;
396
- export function string(params?: string | core.$ZodStringParams): ZodString {
397
- return core._string(ZodString, params) as any;
398
- }
399
-
400
- // ZodStringFormat
401
- export interface ZodStringFormat<Format extends string = string>
402
- extends _ZodString<core.$ZodStringFormatInternals<Format>> {}
403
- export const ZodStringFormat: core.$constructor<ZodStringFormat> = /*@__PURE__*/ core.$constructor(
404
- "ZodStringFormat",
405
- (inst, def) => {
406
- core.$ZodStringFormat.init(inst, def);
407
- _ZodString.init(inst, def);
408
- }
409
- );
410
-
411
- // ZodEmail
412
- export interface ZodEmail extends ZodStringFormat<"email"> {
413
- _zod: core.$ZodEmailInternals;
414
- }
415
- export const ZodEmail: core.$constructor<ZodEmail> = /*@__PURE__*/ core.$constructor("ZodEmail", (inst, def) => {
416
- // ZodStringFormat.init(inst, def);
417
- core.$ZodEmail.init(inst, def);
418
- ZodStringFormat.init(inst, def);
419
- });
420
-
421
- export function email(params?: string | core.$ZodEmailParams): ZodEmail {
422
- return core._email(ZodEmail, params);
423
- }
424
-
425
- // ZodGUID
426
- export interface ZodGUID extends ZodStringFormat<"guid"> {
427
- _zod: core.$ZodGUIDInternals;
428
- }
429
- export const ZodGUID: core.$constructor<ZodGUID> = /*@__PURE__*/ core.$constructor("ZodGUID", (inst, def) => {
430
- // ZodStringFormat.init(inst, def);
431
- core.$ZodGUID.init(inst, def);
432
- ZodStringFormat.init(inst, def);
433
- });
434
-
435
- export function guid(params?: string | core.$ZodGUIDParams): ZodGUID {
436
- return core._guid(ZodGUID, params);
437
- }
438
-
439
- // ZodUUID
440
- export interface ZodUUID extends ZodStringFormat<"uuid"> {
441
- _zod: core.$ZodUUIDInternals;
442
- }
443
- export const ZodUUID: core.$constructor<ZodUUID> = /*@__PURE__*/ core.$constructor("ZodUUID", (inst, def) => {
444
- // ZodStringFormat.init(inst, def);
445
- core.$ZodUUID.init(inst, def);
446
- ZodStringFormat.init(inst, def);
447
- });
448
-
449
- export function uuid(params?: string | core.$ZodUUIDParams): ZodUUID {
450
- return core._uuid(ZodUUID, params);
451
- }
452
-
453
- export function uuidv4(params?: string | core.$ZodUUIDv4Params): ZodUUID {
454
- return core._uuidv4(ZodUUID, params);
455
- }
456
-
457
- // ZodUUIDv6
458
-
459
- export function uuidv6(params?: string | core.$ZodUUIDv6Params): ZodUUID {
460
- return core._uuidv6(ZodUUID, params);
461
- }
462
-
463
- // ZodUUIDv7
464
-
465
- export function uuidv7(params?: string | core.$ZodUUIDv7Params): ZodUUID {
466
- return core._uuidv7(ZodUUID, params);
467
- }
468
-
469
- // ZodURL
470
- export interface ZodURL extends ZodStringFormat<"url"> {
471
- _zod: core.$ZodURLInternals;
472
- }
473
- export const ZodURL: core.$constructor<ZodURL> = /*@__PURE__*/ core.$constructor("ZodURL", (inst, def) => {
474
- // ZodStringFormat.init(inst, def);
475
- core.$ZodURL.init(inst, def);
476
- ZodStringFormat.init(inst, def);
477
- });
478
-
479
- export function url(params?: string | core.$ZodURLParams): ZodURL {
480
- return core._url(ZodURL, params);
481
- }
482
-
483
- export function httpUrl(params?: string | Omit<core.$ZodURLParams, "protocol" | "hostname">): ZodURL {
484
- return core._url(ZodURL, {
485
- protocol: /^https?$/,
486
- hostname: core.regexes.domain,
487
- ...util.normalizeParams(params),
488
- });
489
- }
490
-
491
- // ZodEmoji
492
- export interface ZodEmoji extends ZodStringFormat<"emoji"> {
493
- _zod: core.$ZodEmojiInternals;
494
- }
495
- export const ZodEmoji: core.$constructor<ZodEmoji> = /*@__PURE__*/ core.$constructor("ZodEmoji", (inst, def) => {
496
- // ZodStringFormat.init(inst, def);
497
- core.$ZodEmoji.init(inst, def);
498
- ZodStringFormat.init(inst, def);
499
- });
500
-
501
- export function emoji(params?: string | core.$ZodEmojiParams): ZodEmoji {
502
- return core._emoji(ZodEmoji, params);
503
- }
504
-
505
- // ZodNanoID
506
- export interface ZodNanoID extends ZodStringFormat<"nanoid"> {
507
- _zod: core.$ZodNanoIDInternals;
508
- }
509
- export const ZodNanoID: core.$constructor<ZodNanoID> = /*@__PURE__*/ core.$constructor("ZodNanoID", (inst, def) => {
510
- // ZodStringFormat.init(inst, def);
511
- core.$ZodNanoID.init(inst, def);
512
- ZodStringFormat.init(inst, def);
513
- });
514
-
515
- export function nanoid(params?: string | core.$ZodNanoIDParams): ZodNanoID {
516
- return core._nanoid(ZodNanoID, params);
517
- }
518
-
519
- // ZodCUID
520
- export interface ZodCUID extends ZodStringFormat<"cuid"> {
521
- _zod: core.$ZodCUIDInternals;
522
- }
523
- export const ZodCUID: core.$constructor<ZodCUID> = /*@__PURE__*/ core.$constructor("ZodCUID", (inst, def) => {
524
- // ZodStringFormat.init(inst, def);
525
- core.$ZodCUID.init(inst, def);
526
- ZodStringFormat.init(inst, def);
527
- });
528
-
529
- export function cuid(params?: string | core.$ZodCUIDParams): ZodCUID {
530
- return core._cuid(ZodCUID, params);
531
- }
532
-
533
- // ZodCUID2
534
- export interface ZodCUID2 extends ZodStringFormat<"cuid2"> {
535
- _zod: core.$ZodCUID2Internals;
536
- }
537
- export const ZodCUID2: core.$constructor<ZodCUID2> = /*@__PURE__*/ core.$constructor("ZodCUID2", (inst, def) => {
538
- // ZodStringFormat.init(inst, def);
539
- core.$ZodCUID2.init(inst, def);
540
- ZodStringFormat.init(inst, def);
541
- });
542
-
543
- export function cuid2(params?: string | core.$ZodCUID2Params): ZodCUID2 {
544
- return core._cuid2(ZodCUID2, params);
545
- }
546
-
547
- // ZodULID
548
- export interface ZodULID extends ZodStringFormat<"ulid"> {
549
- _zod: core.$ZodULIDInternals;
550
- }
551
- export const ZodULID: core.$constructor<ZodULID> = /*@__PURE__*/ core.$constructor("ZodULID", (inst, def) => {
552
- // ZodStringFormat.init(inst, def);
553
- core.$ZodULID.init(inst, def);
554
- ZodStringFormat.init(inst, def);
555
- });
556
-
557
- export function ulid(params?: string | core.$ZodULIDParams): ZodULID {
558
- return core._ulid(ZodULID, params);
559
- }
560
-
561
- // ZodXID
562
- export interface ZodXID extends ZodStringFormat<"xid"> {
563
- _zod: core.$ZodXIDInternals;
564
- }
565
- export const ZodXID: core.$constructor<ZodXID> = /*@__PURE__*/ core.$constructor("ZodXID", (inst, def) => {
566
- // ZodStringFormat.init(inst, def);
567
- core.$ZodXID.init(inst, def);
568
- ZodStringFormat.init(inst, def);
569
- });
570
-
571
- export function xid(params?: string | core.$ZodXIDParams): ZodXID {
572
- return core._xid(ZodXID, params);
573
- }
574
-
575
- // ZodKSUID
576
- export interface ZodKSUID extends ZodStringFormat<"ksuid"> {
577
- _zod: core.$ZodKSUIDInternals;
578
- }
579
- export const ZodKSUID: core.$constructor<ZodKSUID> = /*@__PURE__*/ core.$constructor("ZodKSUID", (inst, def) => {
580
- // ZodStringFormat.init(inst, def);
581
- core.$ZodKSUID.init(inst, def);
582
- ZodStringFormat.init(inst, def);
583
- });
584
-
585
- export function ksuid(params?: string | core.$ZodKSUIDParams): ZodKSUID {
586
- return core._ksuid(ZodKSUID, params);
587
- }
588
-
589
- // ZodIP
590
- // export interface ZodIP extends ZodStringFormat<"ip"> {
591
- // _zod: core.$ZodIPInternals;
592
- // }
593
- // export const ZodIP: core.$constructor<ZodIP> = /*@__PURE__*/ core.$constructor("ZodIP", (inst, def) => {
594
- // // ZodStringFormat.init(inst, def);
595
- // core.$ZodIP.init(inst, def);
596
- // ZodStringFormat.init(inst, def);
597
- // });
598
-
599
- // export function ip(params?: string | core.$ZodIPParams): ZodIP {
600
- // return core._ip(ZodIP, params);
601
- // }
602
-
603
- // ZodIPv4
604
- export interface ZodIPv4 extends ZodStringFormat<"ipv4"> {
605
- _zod: core.$ZodIPv4Internals;
606
- }
607
- export const ZodIPv4: core.$constructor<ZodIPv4> = /*@__PURE__*/ core.$constructor("ZodIPv4", (inst, def) => {
608
- // ZodStringFormat.init(inst, def);
609
- core.$ZodIPv4.init(inst, def);
610
- ZodStringFormat.init(inst, def);
611
- });
612
-
613
- export function ipv4(params?: string | core.$ZodIPv4Params): ZodIPv4 {
614
- return core._ipv4(ZodIPv4, params);
615
- }
616
-
617
- // ZodIPv6
618
- export interface ZodIPv6 extends ZodStringFormat<"ipv6"> {
619
- _zod: core.$ZodIPv6Internals;
620
- }
621
- export const ZodIPv6: core.$constructor<ZodIPv6> = /*@__PURE__*/ core.$constructor("ZodIPv6", (inst, def) => {
622
- // ZodStringFormat.init(inst, def);
623
- core.$ZodIPv6.init(inst, def);
624
- ZodStringFormat.init(inst, def);
625
- });
626
- export function ipv6(params?: string | core.$ZodIPv6Params): ZodIPv6 {
627
- return core._ipv6(ZodIPv6, params);
628
- }
629
-
630
- // ZodCIDRv4
631
- export interface ZodCIDRv4 extends ZodStringFormat<"cidrv4"> {
632
- _zod: core.$ZodCIDRv4Internals;
633
- }
634
- export const ZodCIDRv4: core.$constructor<ZodCIDRv4> = /*@__PURE__*/ core.$constructor("ZodCIDRv4", (inst, def) => {
635
- core.$ZodCIDRv4.init(inst, def);
636
- ZodStringFormat.init(inst, def);
637
- });
638
-
639
- export function cidrv4(params?: string | core.$ZodCIDRv4Params): ZodCIDRv4 {
640
- return core._cidrv4(ZodCIDRv4, params);
641
- }
642
-
643
- // ZodCIDRv6
644
- export interface ZodCIDRv6 extends ZodStringFormat<"cidrv6"> {
645
- _zod: core.$ZodCIDRv6Internals;
646
- }
647
- export const ZodCIDRv6: core.$constructor<ZodCIDRv6> = /*@__PURE__*/ core.$constructor("ZodCIDRv6", (inst, def) => {
648
- core.$ZodCIDRv6.init(inst, def);
649
- ZodStringFormat.init(inst, def);
650
- });
651
-
652
- export function cidrv6(params?: string | core.$ZodCIDRv6Params): ZodCIDRv6 {
653
- return core._cidrv6(ZodCIDRv6, params);
654
- }
655
-
656
- // ZodBase64
657
- export interface ZodBase64 extends ZodStringFormat<"base64"> {
658
- _zod: core.$ZodBase64Internals;
659
- }
660
- export const ZodBase64: core.$constructor<ZodBase64> = /*@__PURE__*/ core.$constructor("ZodBase64", (inst, def) => {
661
- // ZodStringFormat.init(inst, def);
662
- core.$ZodBase64.init(inst, def);
663
- ZodStringFormat.init(inst, def);
664
- });
665
- export function base64(params?: string | core.$ZodBase64Params): ZodBase64 {
666
- return core._base64(ZodBase64, params);
667
- }
668
-
669
- // ZodBase64URL
670
- export interface ZodBase64URL extends ZodStringFormat<"base64url"> {
671
- _zod: core.$ZodBase64URLInternals;
672
- }
673
- export const ZodBase64URL: core.$constructor<ZodBase64URL> = /*@__PURE__*/ core.$constructor(
674
- "ZodBase64URL",
675
- (inst, def) => {
676
- // ZodStringFormat.init(inst, def);
677
- core.$ZodBase64URL.init(inst, def);
678
- ZodStringFormat.init(inst, def);
679
- }
680
- );
681
- export function base64url(params?: string | core.$ZodBase64URLParams): ZodBase64URL {
682
- return core._base64url(ZodBase64URL, params);
683
- }
684
-
685
- // ZodE164
686
- export interface ZodE164 extends ZodStringFormat<"e164"> {
687
- _zod: core.$ZodE164Internals;
688
- }
689
- export const ZodE164: core.$constructor<ZodE164> = /*@__PURE__*/ core.$constructor("ZodE164", (inst, def) => {
690
- // ZodStringFormat.init(inst, def);
691
- core.$ZodE164.init(inst, def);
692
- ZodStringFormat.init(inst, def);
693
- });
694
-
695
- export function e164(params?: string | core.$ZodE164Params): ZodE164 {
696
- return core._e164(ZodE164, params);
697
- }
698
-
699
- // ZodJWT
700
- export interface ZodJWT extends ZodStringFormat<"jwt"> {
701
- _zod: core.$ZodJWTInternals;
702
- }
703
- export const ZodJWT: core.$constructor<ZodJWT> = /*@__PURE__*/ core.$constructor("ZodJWT", (inst, def) => {
704
- // ZodStringFormat.init(inst, def);
705
- core.$ZodJWT.init(inst, def);
706
- ZodStringFormat.init(inst, def);
707
- });
708
-
709
- export function jwt(params?: string | core.$ZodJWTParams): ZodJWT {
710
- return core._jwt(ZodJWT, params);
711
- }
712
-
713
- // ZodCustomStringFormat
714
- export interface ZodCustomStringFormat<Format extends string = string>
715
- extends ZodStringFormat<Format>,
716
- core.$ZodCustomStringFormat<Format> {
717
- _zod: core.$ZodCustomStringFormatInternals<Format>;
718
- }
719
- export const ZodCustomStringFormat: core.$constructor<ZodCustomStringFormat> = /*@__PURE__*/ core.$constructor(
720
- "ZodCustomStringFormat",
721
- (inst, def) => {
722
- // ZodStringFormat.init(inst, def);
723
- core.$ZodCustomStringFormat.init(inst, def);
724
- ZodStringFormat.init(inst, def);
725
- }
726
- );
727
- export function stringFormat<Format extends string>(
728
- format: Format,
729
- fnOrRegex: ((arg: string) => util.MaybeAsync<unknown>) | RegExp,
730
- _params: string | core.$ZodStringFormatParams = {}
731
- ): ZodCustomStringFormat<Format> {
732
- return core._stringFormat(ZodCustomStringFormat, format, fnOrRegex, _params) as any;
733
- }
734
-
735
- export function hostname(_params?: string | core.$ZodStringFormatParams): ZodCustomStringFormat<"hostname"> {
736
- return core._stringFormat(ZodCustomStringFormat, "hostname", core.regexes.hostname, _params) as any;
737
- }
738
-
739
- export function hex(_params?: string | core.$ZodStringFormatParams): ZodCustomStringFormat<"hex"> {
740
- return core._stringFormat(ZodCustomStringFormat, "hex", core.regexes.hex, _params) as any;
741
- }
742
-
743
- export function hash<Alg extends util.HashAlgorithm, Enc extends util.HashEncoding = "hex">(
744
- alg: Alg,
745
- params?: {
746
- enc?: Enc;
747
- } & core.$ZodStringFormatParams
748
- ): ZodCustomStringFormat<`${Alg}_${Enc}`> {
749
- const enc = params?.enc ?? "hex";
750
- const format = `${alg}_${enc}` as const;
751
- const regex = core.regexes[format as keyof typeof core.regexes] as RegExp;
752
- if (!regex) throw new Error(`Unrecognized hash format: ${format}`);
753
- return core._stringFormat(ZodCustomStringFormat, format, regex, params) as any;
754
- }
755
-
756
- // ZodNumber
757
- export interface _ZodNumber<Internals extends core.$ZodNumberInternals = core.$ZodNumberInternals>
758
- extends _ZodType<Internals> {
759
- gt(value: number, params?: string | core.$ZodCheckGreaterThanParams): this;
760
- /** Identical to .min() */
761
- gte(value: number, params?: string | core.$ZodCheckGreaterThanParams): this;
762
- min(value: number, params?: string | core.$ZodCheckGreaterThanParams): this;
763
- lt(value: number, params?: string | core.$ZodCheckLessThanParams): this;
764
- /** Identical to .max() */
765
- lte(value: number, params?: string | core.$ZodCheckLessThanParams): this;
766
- max(value: number, params?: string | core.$ZodCheckLessThanParams): this;
767
- /** Consider `z.int()` instead. This API is considered *legacy*; it will never be removed but a better alternative exists. */
768
- int(params?: string | core.$ZodCheckNumberFormatParams): this;
769
- /** @deprecated This is now identical to `.int()`. Only numbers in the safe integer range are accepted. */
770
- safe(params?: string | core.$ZodCheckNumberFormatParams): this;
771
- positive(params?: string | core.$ZodCheckGreaterThanParams): this;
772
- nonnegative(params?: string | core.$ZodCheckGreaterThanParams): this;
773
- negative(params?: string | core.$ZodCheckLessThanParams): this;
774
- nonpositive(params?: string | core.$ZodCheckLessThanParams): this;
775
- multipleOf(value: number, params?: string | core.$ZodCheckMultipleOfParams): this;
776
- /** @deprecated Use `.multipleOf()` instead. */
777
- step(value: number, params?: string | core.$ZodCheckMultipleOfParams): this;
778
-
779
- /** @deprecated In v4 and later, z.number() does not allow infinite values by default. This is a no-op. */
780
- finite(params?: unknown): this;
781
-
782
- minValue: number | null;
783
- maxValue: number | null;
784
- /** @deprecated Check the `format` property instead. */
785
- isInt: boolean;
786
- /** @deprecated Number schemas no longer accept infinite values, so this always returns `true`. */
787
- isFinite: boolean;
788
- format: string | null;
789
- }
790
-
791
- export interface ZodNumber extends _ZodNumber<core.$ZodNumberInternals<number>> {}
792
-
793
- export const ZodNumber: core.$constructor<ZodNumber> = /*@__PURE__*/ core.$constructor("ZodNumber", (inst, def) => {
794
- core.$ZodNumber.init(inst, def);
795
- ZodType.init(inst, def);
796
-
797
- inst.gt = (value, params) => inst.check(checks.gt(value, params));
798
- inst.gte = (value, params) => inst.check(checks.gte(value, params));
799
- inst.min = (value, params) => inst.check(checks.gte(value, params));
800
- inst.lt = (value, params) => inst.check(checks.lt(value, params));
801
- inst.lte = (value, params) => inst.check(checks.lte(value, params));
802
- inst.max = (value, params) => inst.check(checks.lte(value, params));
803
- inst.int = (params) => inst.check(int(params));
804
- inst.safe = (params) => inst.check(int(params));
805
- inst.positive = (params) => inst.check(checks.gt(0, params));
806
- inst.nonnegative = (params) => inst.check(checks.gte(0, params));
807
- inst.negative = (params) => inst.check(checks.lt(0, params));
808
- inst.nonpositive = (params) => inst.check(checks.lte(0, params));
809
- inst.multipleOf = (value, params) => inst.check(checks.multipleOf(value, params));
810
- inst.step = (value, params) => inst.check(checks.multipleOf(value, params));
811
-
812
- // inst.finite = (params) => inst.check(core.finite(params));
813
- inst.finite = () => inst;
814
-
815
- const bag = inst._zod.bag;
816
- inst.minValue =
817
- Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null;
818
- inst.maxValue =
819
- Math.min(bag.maximum ?? Number.POSITIVE_INFINITY, bag.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null;
820
- inst.isInt = (bag.format ?? "").includes("int") || Number.isSafeInteger(bag.multipleOf ?? 0.5);
821
- inst.isFinite = true;
822
- inst.format = bag.format ?? null;
823
- });
824
-
825
- export function number(params?: string | core.$ZodNumberParams): ZodNumber {
826
- return core._number(ZodNumber, params) as any;
827
- }
828
-
829
- // ZodNumberFormat
830
- export interface ZodNumberFormat extends ZodNumber {
831
- _zod: core.$ZodNumberFormatInternals;
832
- }
833
- export const ZodNumberFormat: core.$constructor<ZodNumberFormat> = /*@__PURE__*/ core.$constructor(
834
- "ZodNumberFormat",
835
- (inst, def) => {
836
- core.$ZodNumberFormat.init(inst, def);
837
- ZodNumber.init(inst, def);
838
- }
839
- );
840
-
841
- // int
842
- export interface ZodInt extends ZodNumberFormat {}
843
- export function int(params?: string | core.$ZodCheckNumberFormatParams): ZodInt {
844
- return core._int(ZodNumberFormat, params);
845
- }
846
-
847
- // float32
848
- export interface ZodFloat32 extends ZodNumberFormat {}
849
- export function float32(params?: string | core.$ZodCheckNumberFormatParams): ZodFloat32 {
850
- return core._float32(ZodNumberFormat, params);
851
- }
852
-
853
- // float64
854
- export interface ZodFloat64 extends ZodNumberFormat {}
855
- export function float64(params?: string | core.$ZodCheckNumberFormatParams): ZodFloat64 {
856
- return core._float64(ZodNumberFormat, params);
857
- }
858
-
859
- // int32
860
- export interface ZodInt32 extends ZodNumberFormat {}
861
- export function int32(params?: string | core.$ZodCheckNumberFormatParams): ZodInt32 {
862
- return core._int32(ZodNumberFormat, params);
863
- }
864
-
865
- // uint32
866
- export interface ZodUInt32 extends ZodNumberFormat {}
867
- export function uint32(params?: string | core.$ZodCheckNumberFormatParams): ZodUInt32 {
868
- return core._uint32(ZodNumberFormat, params);
869
- }
870
-
871
- // boolean
872
- export interface _ZodBoolean<T extends core.$ZodBooleanInternals = core.$ZodBooleanInternals> extends _ZodType<T> {}
873
- export interface ZodBoolean extends _ZodBoolean<core.$ZodBooleanInternals<boolean>> {}
874
- export const ZodBoolean: core.$constructor<ZodBoolean> = /*@__PURE__*/ core.$constructor("ZodBoolean", (inst, def) => {
875
- core.$ZodBoolean.init(inst, def);
876
- ZodType.init(inst, def);
877
- });
878
-
879
- export function boolean(params?: string | core.$ZodBooleanParams): ZodBoolean {
880
- return core._boolean(ZodBoolean, params) as any;
881
- }
882
-
883
- // bigint
884
- export interface _ZodBigInt<T extends core.$ZodBigIntInternals = core.$ZodBigIntInternals> extends _ZodType<T> {
885
- gte(value: bigint, params?: string | core.$ZodCheckGreaterThanParams): this;
886
- /** Alias of `.gte()` */
887
- min(value: bigint, params?: string | core.$ZodCheckGreaterThanParams): this;
888
- gt(value: bigint, params?: string | core.$ZodCheckGreaterThanParams): this;
889
- /** Alias of `.lte()` */
890
- lte(value: bigint, params?: string | core.$ZodCheckLessThanParams): this;
891
- max(value: bigint, params?: string | core.$ZodCheckLessThanParams): this;
892
- lt(value: bigint, params?: string | core.$ZodCheckLessThanParams): this;
893
- positive(params?: string | core.$ZodCheckGreaterThanParams): this;
894
- negative(params?: string | core.$ZodCheckLessThanParams): this;
895
- nonpositive(params?: string | core.$ZodCheckLessThanParams): this;
896
- nonnegative(params?: string | core.$ZodCheckGreaterThanParams): this;
897
- multipleOf(value: bigint, params?: string | core.$ZodCheckMultipleOfParams): this;
898
-
899
- minValue: bigint | null;
900
- maxValue: bigint | null;
901
- format: string | null;
902
- }
903
-
904
- export interface ZodBigInt extends _ZodBigInt<core.$ZodBigIntInternals<bigint>> {}
905
- export const ZodBigInt: core.$constructor<ZodBigInt> = /*@__PURE__*/ core.$constructor("ZodBigInt", (inst, def) => {
906
- core.$ZodBigInt.init(inst, def);
907
- ZodType.init(inst, def);
908
-
909
- inst.gte = (value, params) => inst.check(checks.gte(value, params));
910
- inst.min = (value, params) => inst.check(checks.gte(value, params));
911
- inst.gt = (value, params) => inst.check(checks.gt(value, params));
912
- inst.gte = (value, params) => inst.check(checks.gte(value, params));
913
- inst.min = (value, params) => inst.check(checks.gte(value, params));
914
- inst.lt = (value, params) => inst.check(checks.lt(value, params));
915
- inst.lte = (value, params) => inst.check(checks.lte(value, params));
916
- inst.max = (value, params) => inst.check(checks.lte(value, params));
917
- inst.positive = (params) => inst.check(checks.gt(BigInt(0), params));
918
- inst.negative = (params) => inst.check(checks.lt(BigInt(0), params));
919
- inst.nonpositive = (params) => inst.check(checks.lte(BigInt(0), params));
920
- inst.nonnegative = (params) => inst.check(checks.gte(BigInt(0), params));
921
- inst.multipleOf = (value, params) => inst.check(checks.multipleOf(value, params));
922
-
923
- const bag = inst._zod.bag;
924
- inst.minValue = bag.minimum ?? null;
925
- inst.maxValue = bag.maximum ?? null;
926
- inst.format = bag.format ?? null;
927
- });
928
-
929
- export function bigint(params?: string | core.$ZodBigIntParams): ZodBigInt {
930
- return core._bigint(ZodBigInt, params) as any;
931
- }
932
- // bigint formats
933
-
934
- // ZodBigIntFormat
935
- export interface ZodBigIntFormat extends ZodBigInt {
936
- _zod: core.$ZodBigIntFormatInternals;
937
- }
938
- export const ZodBigIntFormat: core.$constructor<ZodBigIntFormat> = /*@__PURE__*/ core.$constructor(
939
- "ZodBigIntFormat",
940
- (inst, def) => {
941
- core.$ZodBigIntFormat.init(inst, def);
942
- ZodBigInt.init(inst, def);
943
- }
944
- );
945
-
946
- // int64
947
- export function int64(params?: string | core.$ZodBigIntFormatParams): ZodBigIntFormat {
948
- return core._int64(ZodBigIntFormat, params);
949
- }
950
-
951
- // uint64
952
- export function uint64(params?: string | core.$ZodBigIntFormatParams): ZodBigIntFormat {
953
- return core._uint64(ZodBigIntFormat, params);
954
- }
955
-
956
- // symbol
957
- export interface ZodSymbol extends _ZodType<core.$ZodSymbolInternals> {}
958
- export const ZodSymbol: core.$constructor<ZodSymbol> = /*@__PURE__*/ core.$constructor("ZodSymbol", (inst, def) => {
959
- core.$ZodSymbol.init(inst, def);
960
- ZodType.init(inst, def);
961
- });
962
-
963
- export function symbol(params?: string | core.$ZodSymbolParams): ZodSymbol {
964
- return core._symbol(ZodSymbol, params);
965
- }
966
-
967
- // ZodUndefined
968
- export interface ZodUndefined extends _ZodType<core.$ZodUndefinedInternals> {}
969
- export const ZodUndefined: core.$constructor<ZodUndefined> = /*@__PURE__*/ core.$constructor(
970
- "ZodUndefined",
971
- (inst, def) => {
972
- core.$ZodUndefined.init(inst, def);
973
- ZodType.init(inst, def);
974
- }
975
- );
976
-
977
- function _undefined(params?: string | core.$ZodUndefinedParams): ZodUndefined {
978
- return core._undefined(ZodUndefined, params);
979
- }
980
- export { _undefined as undefined };
981
-
982
- // ZodNull
983
- export interface ZodNull extends _ZodType<core.$ZodNullInternals> {}
984
- export const ZodNull: core.$constructor<ZodNull> = /*@__PURE__*/ core.$constructor("ZodNull", (inst, def) => {
985
- core.$ZodNull.init(inst, def);
986
- ZodType.init(inst, def);
987
- });
988
-
989
- function _null(params?: string | core.$ZodNullParams): ZodNull {
990
- return core._null(ZodNull, params);
991
- }
992
- export { _null as null };
993
-
994
- // ZodAny
995
- export interface ZodAny extends _ZodType<core.$ZodAnyInternals> {}
996
- export const ZodAny: core.$constructor<ZodAny> = /*@__PURE__*/ core.$constructor("ZodAny", (inst, def) => {
997
- core.$ZodAny.init(inst, def);
998
- ZodType.init(inst, def);
999
- });
1000
-
1001
- export function any(): ZodAny {
1002
- return core._any(ZodAny);
1003
- }
1004
-
1005
- // ZodUnknown
1006
- export interface ZodUnknown extends _ZodType<core.$ZodUnknownInternals> {}
1007
- export const ZodUnknown: core.$constructor<ZodUnknown> = /*@__PURE__*/ core.$constructor("ZodUnknown", (inst, def) => {
1008
- core.$ZodUnknown.init(inst, def);
1009
- ZodType.init(inst, def);
1010
- });
1011
-
1012
- export function unknown(): ZodUnknown {
1013
- return core._unknown(ZodUnknown);
1014
- }
1015
-
1016
- // ZodNever
1017
- export interface ZodNever extends _ZodType<core.$ZodNeverInternals> {}
1018
- export const ZodNever: core.$constructor<ZodNever> = /*@__PURE__*/ core.$constructor("ZodNever", (inst, def) => {
1019
- core.$ZodNever.init(inst, def);
1020
- ZodType.init(inst, def);
1021
- });
1022
-
1023
- export function never(params?: string | core.$ZodNeverParams): ZodNever {
1024
- return core._never(ZodNever, params);
1025
- }
1026
-
1027
- // ZodVoid
1028
- export interface ZodVoid extends _ZodType<core.$ZodVoidInternals> {}
1029
- export const ZodVoid: core.$constructor<ZodVoid> = /*@__PURE__*/ core.$constructor("ZodVoid", (inst, def) => {
1030
- core.$ZodVoid.init(inst, def);
1031
- ZodType.init(inst, def);
1032
- });
1033
-
1034
- function _void(params?: string | core.$ZodVoidParams): ZodVoid {
1035
- return core._void(ZodVoid, params);
1036
- }
1037
- export { _void as void };
1038
-
1039
- // ZodDate
1040
- export interface _ZodDate<T extends core.$ZodDateInternals = core.$ZodDateInternals> extends _ZodType<T> {
1041
- min(value: number | Date, params?: string | core.$ZodCheckGreaterThanParams): this;
1042
- max(value: number | Date, params?: string | core.$ZodCheckLessThanParams): this;
1043
-
1044
- /** @deprecated Not recommended. */
1045
- minDate: Date | null;
1046
- /** @deprecated Not recommended. */
1047
- maxDate: Date | null;
1048
- }
1049
-
1050
- export interface ZodDate extends _ZodDate<core.$ZodDateInternals<Date>> {}
1051
- export const ZodDate: core.$constructor<ZodDate> = /*@__PURE__*/ core.$constructor("ZodDate", (inst, def) => {
1052
- core.$ZodDate.init(inst, def);
1053
- ZodType.init(inst, def);
1054
-
1055
- inst.min = (value, params) => inst.check(checks.gte(value, params));
1056
- inst.max = (value, params) => inst.check(checks.lte(value, params));
1057
-
1058
- const c = inst._zod.bag;
1059
- inst.minDate = c.minimum ? new Date(c.minimum) : null;
1060
- inst.maxDate = c.maximum ? new Date(c.maximum) : null;
1061
- });
1062
-
1063
- export function date(params?: string | core.$ZodDateParams): ZodDate {
1064
- return core._date(ZodDate, params);
1065
- }
1066
-
1067
- // ZodArray
1068
- export interface ZodArray<T extends core.SomeType = core.$ZodType>
1069
- extends _ZodType<core.$ZodArrayInternals<T>>,
1070
- core.$ZodArray<T> {
1071
- element: T;
1072
- min(minLength: number, params?: string | core.$ZodCheckMinLengthParams): this;
1073
- nonempty(params?: string | core.$ZodCheckMinLengthParams): this;
1074
- max(maxLength: number, params?: string | core.$ZodCheckMaxLengthParams): this;
1075
- length(len: number, params?: string | core.$ZodCheckLengthEqualsParams): this;
1076
-
1077
- unwrap(): T;
1078
- }
1079
- export const ZodArray: core.$constructor<ZodArray> = /*@__PURE__*/ core.$constructor("ZodArray", (inst, def) => {
1080
- core.$ZodArray.init(inst, def);
1081
- ZodType.init(inst, def);
1082
-
1083
- inst.element = def.element as any;
1084
- inst.min = (minLength, params) => inst.check(checks.minLength(minLength, params));
1085
- inst.nonempty = (params) => inst.check(checks.minLength(1, params));
1086
- inst.max = (maxLength, params) => inst.check(checks.maxLength(maxLength, params));
1087
- inst.length = (len, params) => inst.check(checks.length(len, params));
1088
-
1089
- inst.unwrap = () => inst.element;
1090
- });
1091
-
1092
- export function array<T extends core.SomeType>(element: T, params?: string | core.$ZodArrayParams): ZodArray<T> {
1093
- return core._array(ZodArray, element as any, params) as any;
1094
- }
1095
-
1096
- // .keyof
1097
- export function keyof<T extends ZodObject>(schema: T): ZodEnum<util.KeysEnum<T["_zod"]["output"]>> {
1098
- const shape = schema._zod.def.shape;
1099
- return _enum(Object.keys(shape)) as any;
1100
- }
1101
-
1102
- // ZodObject
1103
-
1104
- export type SafeExtendShape<Base extends core.$ZodShape, Ext extends core.$ZodLooseShape> = {
1105
- [K in keyof Ext]: K extends keyof Base
1106
- ? core.output<Ext[K]> extends core.output<Base[K]>
1107
- ? core.input<Ext[K]> extends core.input<Base[K]>
1108
- ? Ext[K]
1109
- : never
1110
- : never
1111
- : Ext[K];
1112
- };
1113
-
1114
- export interface ZodObject<
1115
- /** @ts-ignore Cast variance */
1116
- out Shape extends core.$ZodShape = core.$ZodLooseShape,
1117
- out Config extends core.$ZodObjectConfig = core.$strip,
1118
- > extends _ZodType<core.$ZodObjectInternals<Shape, Config>>,
1119
- core.$ZodObject<Shape, Config> {
1120
- shape: Shape;
1121
-
1122
- keyof(): ZodEnum<util.ToEnum<keyof Shape & string>>;
1123
- /** Define a schema to validate all unrecognized keys. This overrides the existing strict/loose behavior. */
1124
- catchall<T extends core.SomeType>(schema: T): ZodObject<Shape, core.$catchall<T>>;
1125
-
1126
- /** @deprecated Use `z.looseObject()` or `.loose()` instead. */
1127
- passthrough(): ZodObject<Shape, core.$loose>;
1128
- /** Consider `z.looseObject(A.shape)` instead */
1129
- loose(): ZodObject<Shape, core.$loose>;
1130
-
1131
- /** Consider `z.strictObject(A.shape)` instead */
1132
- strict(): ZodObject<Shape, core.$strict>;
1133
-
1134
- /** This is the default behavior. This method call is likely unnecessary. */
1135
- strip(): ZodObject<Shape, core.$strip>;
1136
-
1137
- extend<U extends core.$ZodLooseShape>(shape: U): ZodObject<util.Extend<Shape, U>, Config>;
1138
-
1139
- safeExtend<U extends core.$ZodLooseShape>(
1140
- shape: SafeExtendShape<Shape, U> & Partial<Record<keyof Shape, core.SomeType>>
1141
- ): ZodObject<util.Extend<Shape, U>, Config>;
1142
-
1143
- /**
1144
- * @deprecated Use [`A.extend(B.shape)`](https://zod.dev/api?id=extend) instead.
1145
- */
1146
- merge<U extends ZodObject>(other: U): ZodObject<util.Extend<Shape, U["shape"]>, U["_zod"]["config"]>;
1147
-
1148
- pick<M extends util.Mask<keyof Shape>>(
1149
- mask: M
1150
- ): ZodObject<util.Flatten<Pick<Shape, Extract<keyof Shape, keyof M>>>, Config>;
1151
-
1152
- omit<M extends util.Mask<keyof Shape>>(
1153
- mask: M
1154
- ): ZodObject<util.Flatten<Omit<Shape, Extract<keyof Shape, keyof M>>>, Config>;
1155
-
1156
- partial(): ZodObject<
1157
- {
1158
- [k in keyof Shape]: ZodOptional<Shape[k]>;
1159
- },
1160
- Config
1161
- >;
1162
- partial<M extends util.Mask<keyof Shape>>(
1163
- mask: M
1164
- ): ZodObject<
1165
- {
1166
- [k in keyof Shape]: k extends keyof M
1167
- ? // Shape[k] extends OptionalInSchema
1168
- // ? Shape[k]
1169
- // :
1170
- ZodOptional<Shape[k]>
1171
- : Shape[k];
1172
- },
1173
- Config
1174
- >;
1175
-
1176
- // required
1177
- required(): ZodObject<
1178
- {
1179
- [k in keyof Shape]: ZodNonOptional<Shape[k]>;
1180
- },
1181
- Config
1182
- >;
1183
- required<M extends util.Mask<keyof Shape>>(
1184
- mask: M
1185
- ): ZodObject<
1186
- {
1187
- [k in keyof Shape]: k extends keyof M ? ZodNonOptional<Shape[k]> : Shape[k];
1188
- },
1189
- Config
1190
- >;
1191
- }
1192
-
1193
- export const ZodObject: core.$constructor<ZodObject> = /*@__PURE__*/ core.$constructor("ZodObject", (inst, def) => {
1194
- core.$ZodObjectJIT.init(inst, def);
1195
- ZodType.init(inst, def);
1196
-
1197
- util.defineLazy(inst, "shape", () => {
1198
- return def.shape;
1199
- });
1200
-
1201
- inst.keyof = () => _enum(Object.keys(inst._zod.def.shape)) as any;
1202
- inst.catchall = (catchall) => inst.clone({ ...inst._zod.def, catchall: catchall as any as core.$ZodType }) as any;
1203
- inst.passthrough = () => inst.clone({ ...inst._zod.def, catchall: unknown() });
1204
- inst.loose = () => inst.clone({ ...inst._zod.def, catchall: unknown() });
1205
- inst.strict = () => inst.clone({ ...inst._zod.def, catchall: never() });
1206
- inst.strip = () => inst.clone({ ...inst._zod.def, catchall: undefined });
1207
-
1208
- inst.extend = (incoming: any) => {
1209
- return util.extend(inst, incoming);
1210
- };
1211
- inst.safeExtend = (incoming: any) => {
1212
- return util.safeExtend(inst, incoming);
1213
- };
1214
- inst.merge = (other) => util.merge(inst, other);
1215
- inst.pick = (mask) => util.pick(inst, mask);
1216
- inst.omit = (mask) => util.omit(inst, mask);
1217
- inst.partial = (...args: any[]) => util.partial(ZodOptional, inst, args[0] as object);
1218
- inst.required = (...args: any[]) => util.required(ZodNonOptional, inst, args[0] as object);
1219
- });
1220
-
1221
- export function object<T extends core.$ZodLooseShape = Partial<Record<never, core.SomeType>>>(
1222
- shape?: T,
1223
- params?: string | core.$ZodObjectParams
1224
- ): ZodObject<util.Writeable<T>, core.$strip> {
1225
- const def: core.$ZodObjectDef = {
1226
- type: "object",
1227
- shape: shape ?? {},
1228
- ...util.normalizeParams(params),
1229
- };
1230
- return new ZodObject(def) as any;
1231
- }
1232
-
1233
- // strictObject
1234
-
1235
- export function strictObject<T extends core.$ZodLooseShape>(
1236
- shape: T,
1237
- params?: string | core.$ZodObjectParams
1238
- ): ZodObject<T, core.$strict> {
1239
- return new ZodObject({
1240
- type: "object",
1241
- shape,
1242
- catchall: never(),
1243
- ...util.normalizeParams(params),
1244
- }) as any;
1245
- }
1246
-
1247
- // looseObject
1248
-
1249
- export function looseObject<T extends core.$ZodLooseShape>(
1250
- shape: T,
1251
- params?: string | core.$ZodObjectParams
1252
- ): ZodObject<T, core.$loose> {
1253
- return new ZodObject({
1254
- type: "object",
1255
- shape,
1256
- catchall: unknown(),
1257
- ...util.normalizeParams(params),
1258
- }) as any;
1259
- }
1260
-
1261
- // ZodUnion
1262
- export interface ZodUnion<T extends readonly core.SomeType[] = readonly core.$ZodType[]>
1263
- extends _ZodType<core.$ZodUnionInternals<T>>,
1264
- core.$ZodUnion<T> {
1265
- options: T;
1266
- }
1267
- export const ZodUnion: core.$constructor<ZodUnion> = /*@__PURE__*/ core.$constructor("ZodUnion", (inst, def) => {
1268
- core.$ZodUnion.init(inst, def);
1269
- ZodType.init(inst, def);
1270
- inst.options = def.options;
1271
- });
1272
-
1273
- export function union<const T extends readonly core.SomeType[]>(
1274
- options: T,
1275
- params?: string | core.$ZodUnionParams
1276
- ): ZodUnion<T> {
1277
- return new ZodUnion({
1278
- type: "union",
1279
- options: options as any as core.$ZodType[],
1280
- ...util.normalizeParams(params),
1281
- }) as any;
1282
- }
1283
-
1284
- // ZodDiscriminatedUnion
1285
- export interface ZodDiscriminatedUnion<
1286
- Options extends readonly core.SomeType[] = readonly core.$ZodType[],
1287
- Disc extends string = string,
1288
- > extends ZodUnion<Options>,
1289
- core.$ZodDiscriminatedUnion<Options, Disc> {
1290
- _zod: core.$ZodDiscriminatedUnionInternals<Options, Disc>;
1291
- def: core.$ZodDiscriminatedUnionDef<Options, Disc>;
1292
- }
1293
- export const ZodDiscriminatedUnion: core.$constructor<ZodDiscriminatedUnion> = /*@__PURE__*/ core.$constructor(
1294
- "ZodDiscriminatedUnion",
1295
- (inst, def) => {
1296
- ZodUnion.init(inst, def);
1297
- core.$ZodDiscriminatedUnion.init(inst, def);
1298
- }
1299
- );
1300
-
1301
- export function discriminatedUnion<
1302
- Types extends readonly [core.$ZodTypeDiscriminable, ...core.$ZodTypeDiscriminable[]],
1303
- Disc extends string,
1304
- >(
1305
- discriminator: Disc,
1306
- options: Types,
1307
- params?: string | core.$ZodDiscriminatedUnionParams
1308
- ): ZodDiscriminatedUnion<Types, Disc> {
1309
- // const [options, params] = args;
1310
- return new ZodDiscriminatedUnion({
1311
- type: "union",
1312
- options,
1313
- discriminator,
1314
- ...util.normalizeParams(params),
1315
- }) as any;
1316
- }
1317
-
1318
- // ZodIntersection
1319
- export interface ZodIntersection<A extends core.SomeType = core.$ZodType, B extends core.SomeType = core.$ZodType>
1320
- extends _ZodType<core.$ZodIntersectionInternals<A, B>>,
1321
- core.$ZodIntersection<A, B> {}
1322
- export const ZodIntersection: core.$constructor<ZodIntersection> = /*@__PURE__*/ core.$constructor(
1323
- "ZodIntersection",
1324
- (inst, def) => {
1325
- core.$ZodIntersection.init(inst, def);
1326
- ZodType.init(inst, def);
1327
- }
1328
- );
1329
-
1330
- export function intersection<T extends core.SomeType, U extends core.SomeType>(
1331
- left: T,
1332
- right: U
1333
- ): ZodIntersection<T, U> {
1334
- return new ZodIntersection({
1335
- type: "intersection",
1336
- left: left as any as core.$ZodType,
1337
- right: right as any as core.$ZodType,
1338
- }) as any;
1339
- }
1340
-
1341
- // ZodTuple
1342
- export interface ZodTuple<
1343
- T extends util.TupleItems = readonly core.$ZodType[],
1344
- Rest extends core.SomeType | null = core.$ZodType | null,
1345
- > extends _ZodType<core.$ZodTupleInternals<T, Rest>>,
1346
- core.$ZodTuple<T, Rest> {
1347
- rest<Rest extends core.SomeType = core.$ZodType>(rest: Rest): ZodTuple<T, Rest>;
1348
- }
1349
- export const ZodTuple: core.$constructor<ZodTuple> = /*@__PURE__*/ core.$constructor("ZodTuple", (inst, def) => {
1350
- core.$ZodTuple.init(inst, def);
1351
- ZodType.init(inst, def);
1352
- inst.rest = (rest) =>
1353
- inst.clone({
1354
- ...inst._zod.def,
1355
- rest: rest as any as core.$ZodType,
1356
- }) as any;
1357
- });
1358
-
1359
- export function tuple<T extends readonly [core.SomeType, ...core.SomeType[]]>(
1360
- items: T,
1361
- params?: string | core.$ZodTupleParams
1362
- ): ZodTuple<T, null>;
1363
- export function tuple<T extends readonly [core.SomeType, ...core.SomeType[]], Rest extends core.SomeType>(
1364
- items: T,
1365
- rest: Rest,
1366
- params?: string | core.$ZodTupleParams
1367
- ): ZodTuple<T, Rest>;
1368
- export function tuple(items: [], params?: string | core.$ZodTupleParams): ZodTuple<[], null>;
1369
- export function tuple(
1370
- items: core.SomeType[],
1371
- _paramsOrRest?: string | core.$ZodTupleParams | core.SomeType,
1372
- _params?: string | core.$ZodTupleParams
1373
- ) {
1374
- const hasRest = _paramsOrRest instanceof core.$ZodType;
1375
- const params = hasRest ? _params : _paramsOrRest;
1376
- const rest = hasRest ? _paramsOrRest : null;
1377
- return new ZodTuple({
1378
- type: "tuple",
1379
- items: items as any as core.$ZodType[],
1380
- rest,
1381
- ...util.normalizeParams(params),
1382
- });
1383
- }
1384
-
1385
- // ZodRecord
1386
- export interface ZodRecord<
1387
- Key extends core.$ZodRecordKey = core.$ZodRecordKey,
1388
- Value extends core.SomeType = core.$ZodType,
1389
- > extends _ZodType<core.$ZodRecordInternals<Key, Value>>,
1390
- core.$ZodRecord<Key, Value> {
1391
- keyType: Key;
1392
- valueType: Value;
1393
- }
1394
- export const ZodRecord: core.$constructor<ZodRecord> = /*@__PURE__*/ core.$constructor("ZodRecord", (inst, def) => {
1395
- core.$ZodRecord.init(inst, def);
1396
- ZodType.init(inst, def);
1397
-
1398
- inst.keyType = def.keyType;
1399
- inst.valueType = def.valueType;
1400
- });
1401
-
1402
- export function record<Key extends core.$ZodRecordKey, Value extends core.SomeType>(
1403
- keyType: Key,
1404
- valueType: Value,
1405
- params?: string | core.$ZodRecordParams
1406
- ): ZodRecord<Key, Value> {
1407
- return new ZodRecord({
1408
- type: "record",
1409
- keyType,
1410
- valueType: valueType as any as core.$ZodType,
1411
- ...util.normalizeParams(params),
1412
- }) as any;
1413
- }
1414
- // type alksjf = core.output<core.$ZodRecordKey>;
1415
- export function partialRecord<Key extends core.$ZodRecordKey, Value extends core.SomeType>(
1416
- keyType: Key,
1417
- valueType: Value,
1418
- params?: string | core.$ZodRecordParams
1419
- ): ZodRecord<Key & core.$partial, Value> {
1420
- const k = core.clone(keyType);
1421
- k._zod.values = undefined;
1422
- return new ZodRecord({
1423
- type: "record",
1424
- keyType: k,
1425
- valueType: valueType as any,
1426
- ...util.normalizeParams(params),
1427
- }) as any;
1428
- }
1429
-
1430
- // ZodMap
1431
- export interface ZodMap<Key extends core.SomeType = core.$ZodType, Value extends core.SomeType = core.$ZodType>
1432
- extends _ZodType<core.$ZodMapInternals<Key, Value>>,
1433
- core.$ZodMap<Key, Value> {
1434
- keyType: Key;
1435
- valueType: Value;
1436
- }
1437
- export const ZodMap: core.$constructor<ZodMap> = /*@__PURE__*/ core.$constructor("ZodMap", (inst, def) => {
1438
- core.$ZodMap.init(inst, def);
1439
- ZodType.init(inst, def);
1440
- inst.keyType = def.keyType;
1441
- inst.valueType = def.valueType;
1442
- });
1443
-
1444
- export function map<Key extends core.SomeType, Value extends core.SomeType>(
1445
- keyType: Key,
1446
- valueType: Value,
1447
- params?: string | core.$ZodMapParams
1448
- ): ZodMap<Key, Value> {
1449
- return new ZodMap({
1450
- type: "map",
1451
- keyType: keyType as any as core.$ZodType,
1452
- valueType: valueType as any as core.$ZodType,
1453
- ...util.normalizeParams(params),
1454
- }) as any;
1455
- }
1456
-
1457
- // ZodSet
1458
- export interface ZodSet<T extends core.SomeType = core.$ZodType>
1459
- extends _ZodType<core.$ZodSetInternals<T>>,
1460
- core.$ZodSet<T> {
1461
- min(minSize: number, params?: string | core.$ZodCheckMinSizeParams): this;
1462
- nonempty(params?: string | core.$ZodCheckMinSizeParams): this;
1463
- max(maxSize: number, params?: string | core.$ZodCheckMaxSizeParams): this;
1464
- size(size: number, params?: string | core.$ZodCheckSizeEqualsParams): this;
1465
- }
1466
- export const ZodSet: core.$constructor<ZodSet> = /*@__PURE__*/ core.$constructor("ZodSet", (inst, def) => {
1467
- core.$ZodSet.init(inst, def);
1468
- ZodType.init(inst, def);
1469
-
1470
- inst.min = (...args) => inst.check(core._minSize(...args));
1471
- inst.nonempty = (params) => inst.check(core._minSize(1, params));
1472
- inst.max = (...args) => inst.check(core._maxSize(...args));
1473
- inst.size = (...args) => inst.check(core._size(...args));
1474
- });
1475
-
1476
- export function set<Value extends core.SomeType>(
1477
- valueType: Value,
1478
- params?: string | core.$ZodSetParams
1479
- ): ZodSet<Value> {
1480
- return new ZodSet({
1481
- type: "set",
1482
- valueType: valueType as any as core.$ZodType,
1483
- ...util.normalizeParams(params),
1484
- }) as any;
1485
- }
1486
-
1487
- // ZodEnum
1488
- export interface ZodEnum<
1489
- /** @ts-ignore Cast variance */
1490
- out T extends util.EnumLike = util.EnumLike,
1491
- > extends _ZodType<core.$ZodEnumInternals<T>>,
1492
- core.$ZodEnum<T> {
1493
- enum: T;
1494
- options: Array<T[keyof T]>;
1495
-
1496
- extract<const U extends readonly (keyof T)[]>(
1497
- values: U,
1498
- params?: string | core.$ZodEnumParams
1499
- ): ZodEnum<util.Flatten<Pick<T, U[number]>>>;
1500
- exclude<const U extends readonly (keyof T)[]>(
1501
- values: U,
1502
- params?: string | core.$ZodEnumParams
1503
- ): ZodEnum<util.Flatten<Omit<T, U[number]>>>;
1504
- }
1505
- export const ZodEnum: core.$constructor<ZodEnum> = /*@__PURE__*/ core.$constructor("ZodEnum", (inst, def) => {
1506
- core.$ZodEnum.init(inst, def);
1507
- ZodType.init(inst, def);
1508
-
1509
- inst.enum = def.entries;
1510
- inst.options = Object.values(def.entries);
1511
-
1512
- const keys = new Set(Object.keys(def.entries));
1513
-
1514
- inst.extract = (values, params) => {
1515
- const newEntries: Record<string, any> = {};
1516
- for (const value of values) {
1517
- if (keys.has(value)) {
1518
- newEntries[value] = def.entries[value];
1519
- } else throw new Error(`Key ${value} not found in enum`);
1520
- }
1521
- return new ZodEnum({
1522
- ...def,
1523
- checks: [],
1524
- ...util.normalizeParams(params),
1525
- entries: newEntries,
1526
- }) as any;
1527
- };
1528
-
1529
- inst.exclude = (values, params) => {
1530
- const newEntries: Record<string, any> = { ...def.entries };
1531
- for (const value of values) {
1532
- if (keys.has(value)) {
1533
- delete newEntries[value];
1534
- } else throw new Error(`Key ${value} not found in enum`);
1535
- }
1536
- return new ZodEnum({
1537
- ...def,
1538
- checks: [],
1539
- ...util.normalizeParams(params),
1540
- entries: newEntries,
1541
- }) as any;
1542
- };
1543
- });
1544
-
1545
- function _enum<const T extends readonly string[]>(
1546
- values: T,
1547
- params?: string | core.$ZodEnumParams
1548
- ): ZodEnum<util.ToEnum<T[number]>>;
1549
- function _enum<const T extends util.EnumLike>(entries: T, params?: string | core.$ZodEnumParams): ZodEnum<T>;
1550
- function _enum(values: any, params?: string | core.$ZodEnumParams) {
1551
- const entries: any = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;
1552
-
1553
- return new ZodEnum({
1554
- type: "enum",
1555
- entries,
1556
- ...util.normalizeParams(params),
1557
- }) as any;
1558
- }
1559
- export { _enum as enum };
1560
-
1561
- /** @deprecated This API has been merged into `z.enum()`. Use `z.enum()` instead.
1562
- *
1563
- * ```ts
1564
- * enum Colors { red, green, blue }
1565
- * z.enum(Colors);
1566
- * ```
1567
- */
1568
- export function nativeEnum<T extends util.EnumLike>(entries: T, params?: string | core.$ZodEnumParams): ZodEnum<T> {
1569
- return new ZodEnum({
1570
- type: "enum",
1571
- entries,
1572
- ...util.normalizeParams(params),
1573
- }) as any as ZodEnum<T>;
1574
- }
1575
-
1576
- // ZodLiteral
1577
- export interface ZodLiteral<T extends util.Literal = util.Literal>
1578
- extends _ZodType<core.$ZodLiteralInternals<T>>,
1579
- core.$ZodLiteral<T> {
1580
- values: Set<T>;
1581
- /** @legacy Use `.values` instead. Accessing this property will throw an error if the literal accepts multiple values. */
1582
- value: T;
1583
- }
1584
- export const ZodLiteral: core.$constructor<ZodLiteral> = /*@__PURE__*/ core.$constructor("ZodLiteral", (inst, def) => {
1585
- core.$ZodLiteral.init(inst, def);
1586
- ZodType.init(inst, def);
1587
- inst.values = new Set(def.values);
1588
- Object.defineProperty(inst, "value", {
1589
- get() {
1590
- if (def.values.length > 1) {
1591
- throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");
1592
- }
1593
- return def.values[0];
1594
- },
1595
- });
1596
- });
1597
-
1598
- export function literal<const T extends ReadonlyArray<util.Literal>>(
1599
- value: T,
1600
- params?: string | core.$ZodLiteralParams
1601
- ): ZodLiteral<T[number]>;
1602
- export function literal<const T extends util.Literal>(
1603
- value: T,
1604
- params?: string | core.$ZodLiteralParams
1605
- ): ZodLiteral<T>;
1606
- export function literal(value: any, params: any) {
1607
- return new ZodLiteral({
1608
- type: "literal",
1609
- values: Array.isArray(value) ? value : [value],
1610
- ...util.normalizeParams(params),
1611
- });
1612
- }
1613
-
1614
- // ZodFile
1615
- export interface ZodFile extends _ZodType<core.$ZodFileInternals>, core.$ZodFile {
1616
- min(size: number, params?: string | core.$ZodCheckMinSizeParams): this;
1617
- max(size: number, params?: string | core.$ZodCheckMaxSizeParams): this;
1618
- mime(types: util.MimeTypes | Array<util.MimeTypes>, params?: string | core.$ZodCheckMimeTypeParams): this;
1619
- }
1620
- export const ZodFile: core.$constructor<ZodFile> = /*@__PURE__*/ core.$constructor("ZodFile", (inst, def) => {
1621
- core.$ZodFile.init(inst, def);
1622
- ZodType.init(inst, def);
1623
-
1624
- inst.min = (size, params) => inst.check(core._minSize(size, params));
1625
- inst.max = (size, params) => inst.check(core._maxSize(size, params));
1626
- inst.mime = (types, params) => inst.check(core._mime(Array.isArray(types) ? types : [types], params));
1627
- });
1628
-
1629
- export function file(params?: string | core.$ZodFileParams): ZodFile {
1630
- return core._file(ZodFile, params) as any;
1631
- }
1632
-
1633
- // ZodTransform
1634
- export interface ZodTransform<O = unknown, I = unknown>
1635
- extends _ZodType<core.$ZodTransformInternals<O, I>>,
1636
- core.$ZodTransform<O, I> {}
1637
- export const ZodTransform: core.$constructor<ZodTransform> = /*@__PURE__*/ core.$constructor(
1638
- "ZodTransform",
1639
- (inst, def) => {
1640
- core.$ZodTransform.init(inst, def);
1641
- ZodType.init(inst, def);
1642
-
1643
- inst._zod.parse = (payload, _ctx) => {
1644
- if (_ctx.direction === "backward") {
1645
- throw new core.$ZodEncodeError(inst.constructor.name);
1646
- }
1647
-
1648
- (payload as core.$RefinementCtx).addIssue = (issue) => {
1649
- if (typeof issue === "string") {
1650
- payload.issues.push(util.issue(issue, payload.value, def));
1651
- } else {
1652
- // for Zod 3 backwards compatibility
1653
- const _issue = issue as any;
1654
-
1655
- if (_issue.fatal) _issue.continue = false;
1656
- _issue.code ??= "custom";
1657
- _issue.input ??= payload.value;
1658
- _issue.inst ??= inst;
1659
- // _issue.continue ??= true;
1660
- payload.issues.push(util.issue(_issue));
1661
- }
1662
- };
1663
-
1664
- const output = def.transform(payload.value, payload);
1665
- if (output instanceof Promise) {
1666
- return output.then((output) => {
1667
- payload.value = output;
1668
- return payload;
1669
- });
1670
- }
1671
- payload.value = output;
1672
- return payload;
1673
- };
1674
- }
1675
- );
1676
-
1677
- export function transform<I = unknown, O = I>(
1678
- fn: (input: I, ctx: core.ParsePayload) => O
1679
- ): ZodTransform<Awaited<O>, I> {
1680
- return new ZodTransform({
1681
- type: "transform",
1682
- transform: fn as any,
1683
- }) as any;
1684
- }
1685
-
1686
- // ZodOptional
1687
- export interface ZodOptional<T extends core.SomeType = core.$ZodType>
1688
- extends _ZodType<core.$ZodOptionalInternals<T>>,
1689
- core.$ZodOptional<T> {
1690
- unwrap(): T;
1691
- }
1692
- export const ZodOptional: core.$constructor<ZodOptional> = /*@__PURE__*/ core.$constructor(
1693
- "ZodOptional",
1694
- (inst, def) => {
1695
- core.$ZodOptional.init(inst, def);
1696
- ZodType.init(inst, def);
1697
-
1698
- inst.unwrap = () => inst._zod.def.innerType;
1699
- }
1700
- );
1701
-
1702
- export function optional<T extends core.SomeType>(innerType: T): ZodOptional<T> {
1703
- return new ZodOptional({
1704
- type: "optional",
1705
- innerType: innerType as any as core.$ZodType,
1706
- }) as any;
1707
- }
1708
-
1709
- // ZodNullable
1710
- export interface ZodNullable<T extends core.SomeType = core.$ZodType>
1711
- extends _ZodType<core.$ZodNullableInternals<T>>,
1712
- core.$ZodNullable<T> {
1713
- unwrap(): T;
1714
- }
1715
- export const ZodNullable: core.$constructor<ZodNullable> = /*@__PURE__*/ core.$constructor(
1716
- "ZodNullable",
1717
- (inst, def) => {
1718
- core.$ZodNullable.init(inst, def);
1719
- ZodType.init(inst, def);
1720
-
1721
- inst.unwrap = () => inst._zod.def.innerType;
1722
- }
1723
- );
1724
-
1725
- export function nullable<T extends core.SomeType>(innerType: T): ZodNullable<T> {
1726
- return new ZodNullable({
1727
- type: "nullable",
1728
- innerType: innerType as any as core.$ZodType,
1729
- }) as any;
1730
- }
1731
-
1732
- // nullish
1733
- export function nullish<T extends core.SomeType>(innerType: T): ZodOptional<ZodNullable<T>> {
1734
- return optional(nullable(innerType));
1735
- }
1736
-
1737
- // ZodDefault
1738
- export interface ZodDefault<T extends core.SomeType = core.$ZodType>
1739
- extends _ZodType<core.$ZodDefaultInternals<T>>,
1740
- core.$ZodDefault<T> {
1741
- unwrap(): T;
1742
- /** @deprecated Use `.unwrap()` instead. */
1743
- removeDefault(): T;
1744
- }
1745
- export const ZodDefault: core.$constructor<ZodDefault> = /*@__PURE__*/ core.$constructor("ZodDefault", (inst, def) => {
1746
- core.$ZodDefault.init(inst, def);
1747
- ZodType.init(inst, def);
1748
-
1749
- inst.unwrap = () => inst._zod.def.innerType;
1750
- inst.removeDefault = inst.unwrap;
1751
- });
1752
-
1753
- export function _default<T extends core.SomeType>(
1754
- innerType: T,
1755
- defaultValue: util.NoUndefined<core.output<T>> | (() => util.NoUndefined<core.output<T>>)
1756
- ): ZodDefault<T> {
1757
- return new ZodDefault({
1758
- type: "default",
1759
- innerType: innerType as any as core.$ZodType,
1760
- get defaultValue() {
1761
- return typeof defaultValue === "function" ? (defaultValue as Function)() : util.shallowClone(defaultValue);
1762
- },
1763
- }) as any;
1764
- }
1765
-
1766
- // ZodPrefault
1767
- export interface ZodPrefault<T extends core.SomeType = core.$ZodType>
1768
- extends _ZodType<core.$ZodPrefaultInternals<T>>,
1769
- core.$ZodPrefault<T> {
1770
- unwrap(): T;
1771
- }
1772
- export const ZodPrefault: core.$constructor<ZodPrefault> = /*@__PURE__*/ core.$constructor(
1773
- "ZodPrefault",
1774
- (inst, def) => {
1775
- core.$ZodPrefault.init(inst, def);
1776
- ZodType.init(inst, def);
1777
- inst.unwrap = () => inst._zod.def.innerType;
1778
- }
1779
- );
1780
-
1781
- export function prefault<T extends core.SomeType>(
1782
- innerType: T,
1783
- defaultValue: core.input<T> | (() => core.input<T>)
1784
- ): ZodPrefault<T> {
1785
- return new ZodPrefault({
1786
- type: "prefault",
1787
- innerType: innerType as any as core.$ZodType,
1788
- get defaultValue() {
1789
- return typeof defaultValue === "function" ? (defaultValue as Function)() : util.shallowClone(defaultValue);
1790
- },
1791
- }) as any;
1792
- }
1793
-
1794
- // ZodNonOptional
1795
- export interface ZodNonOptional<T extends core.SomeType = core.$ZodType>
1796
- extends _ZodType<core.$ZodNonOptionalInternals<T>>,
1797
- core.$ZodNonOptional<T> {
1798
- unwrap(): T;
1799
- }
1800
- export const ZodNonOptional: core.$constructor<ZodNonOptional> = /*@__PURE__*/ core.$constructor(
1801
- "ZodNonOptional",
1802
- (inst, def) => {
1803
- core.$ZodNonOptional.init(inst, def);
1804
- ZodType.init(inst, def);
1805
-
1806
- inst.unwrap = () => inst._zod.def.innerType;
1807
- }
1808
- );
1809
-
1810
- export function nonoptional<T extends core.SomeType>(
1811
- innerType: T,
1812
- params?: string | core.$ZodNonOptionalParams
1813
- ): ZodNonOptional<T> {
1814
- return new ZodNonOptional({
1815
- type: "nonoptional",
1816
- innerType: innerType as any as core.$ZodType,
1817
- ...util.normalizeParams(params),
1818
- }) as any;
1819
- }
1820
-
1821
- // ZodSuccess
1822
- export interface ZodSuccess<T extends core.SomeType = core.$ZodType>
1823
- extends _ZodType<core.$ZodSuccessInternals<T>>,
1824
- core.$ZodSuccess<T> {
1825
- unwrap(): T;
1826
- }
1827
- export const ZodSuccess: core.$constructor<ZodSuccess> = /*@__PURE__*/ core.$constructor("ZodSuccess", (inst, def) => {
1828
- core.$ZodSuccess.init(inst, def);
1829
- ZodType.init(inst, def);
1830
-
1831
- inst.unwrap = () => inst._zod.def.innerType;
1832
- });
1833
-
1834
- export function success<T extends core.SomeType>(innerType: T): ZodSuccess<T> {
1835
- return new ZodSuccess({
1836
- type: "success",
1837
- innerType: innerType as any as core.$ZodType,
1838
- }) as any;
1839
- }
1840
-
1841
- // ZodCatch
1842
- export interface ZodCatch<T extends core.SomeType = core.$ZodType>
1843
- extends _ZodType<core.$ZodCatchInternals<T>>,
1844
- core.$ZodCatch<T> {
1845
- unwrap(): T;
1846
- /** @deprecated Use `.unwrap()` instead. */
1847
- removeCatch(): T;
1848
- }
1849
- export const ZodCatch: core.$constructor<ZodCatch> = /*@__PURE__*/ core.$constructor("ZodCatch", (inst, def) => {
1850
- core.$ZodCatch.init(inst, def);
1851
- ZodType.init(inst, def);
1852
-
1853
- inst.unwrap = () => inst._zod.def.innerType;
1854
- inst.removeCatch = inst.unwrap;
1855
- });
1856
-
1857
- function _catch<T extends core.SomeType>(
1858
- innerType: T,
1859
- catchValue: core.output<T> | ((ctx: core.$ZodCatchCtx) => core.output<T>)
1860
- ): ZodCatch<T> {
1861
- return new ZodCatch({
1862
- type: "catch",
1863
- innerType: innerType as any as core.$ZodType,
1864
- catchValue: (typeof catchValue === "function" ? catchValue : () => catchValue) as (
1865
- ctx: core.$ZodCatchCtx
1866
- ) => core.output<T>,
1867
- }) as any;
1868
- }
1869
- export { _catch as catch };
1870
-
1871
- // ZodNaN
1872
- export interface ZodNaN extends _ZodType<core.$ZodNaNInternals>, core.$ZodNaN {}
1873
- export const ZodNaN: core.$constructor<ZodNaN> = /*@__PURE__*/ core.$constructor("ZodNaN", (inst, def) => {
1874
- core.$ZodNaN.init(inst, def);
1875
- ZodType.init(inst, def);
1876
- });
1877
-
1878
- export function nan(params?: string | core.$ZodNaNParams): ZodNaN {
1879
- return core._nan(ZodNaN, params);
1880
- }
1881
-
1882
- // ZodPipe
1883
- export interface ZodPipe<A extends core.SomeType = core.$ZodType, B extends core.SomeType = core.$ZodType>
1884
- extends _ZodType<core.$ZodPipeInternals<A, B>>,
1885
- core.$ZodPipe<A, B> {
1886
- in: A;
1887
- out: B;
1888
- }
1889
- export const ZodPipe: core.$constructor<ZodPipe> = /*@__PURE__*/ core.$constructor("ZodPipe", (inst, def) => {
1890
- core.$ZodPipe.init(inst, def);
1891
- ZodType.init(inst, def);
1892
-
1893
- inst.in = def.in;
1894
- inst.out = def.out;
1895
- });
1896
-
1897
- export function pipe<
1898
- const A extends core.SomeType,
1899
- B extends core.$ZodType<unknown, core.output<A>> = core.$ZodType<unknown, core.output<A>>,
1900
- >(in_: A, out: B | core.$ZodType<unknown, core.output<A>>): ZodPipe<A, B>;
1901
- export function pipe(in_: core.SomeType, out: core.SomeType) {
1902
- return new ZodPipe({
1903
- type: "pipe",
1904
- in: in_ as unknown as core.$ZodType,
1905
- out: out as unknown as core.$ZodType,
1906
- // ...util.normalizeParams(params),
1907
- });
1908
- }
1909
-
1910
- // ZodCodec
1911
- export interface ZodCodec<A extends core.SomeType = core.$ZodType, B extends core.SomeType = core.$ZodType>
1912
- extends ZodPipe<A, B>,
1913
- core.$ZodCodec<A, B> {
1914
- _zod: core.$ZodCodecInternals<A, B>;
1915
- def: core.$ZodCodecDef<A, B>;
1916
- }
1917
- export const ZodCodec: core.$constructor<ZodCodec> = /*@__PURE__*/ core.$constructor("ZodCodec", (inst, def) => {
1918
- ZodPipe.init(inst, def);
1919
- core.$ZodCodec.init(inst, def);
1920
- });
1921
-
1922
- export function codec<const A extends core.SomeType, B extends core.SomeType = core.$ZodType>(
1923
- in_: A,
1924
- out: B,
1925
- params: {
1926
- decode: (value: core.output<A>, payload: core.ParsePayload<core.output<A>>) => core.util.MaybeAsync<core.input<B>>;
1927
- encode: (value: core.input<B>, payload: core.ParsePayload<core.input<B>>) => core.util.MaybeAsync<core.output<A>>;
1928
- }
1929
- ): ZodCodec<A, B> {
1930
- return new ZodCodec({
1931
- type: "pipe",
1932
- in: in_ as any as core.$ZodType,
1933
- out: out as any as core.$ZodType,
1934
- transform: params.decode as any,
1935
- reverseTransform: params.encode as any,
1936
- }) as any;
1937
- }
1938
-
1939
- // ZodReadonly
1940
- export interface ZodReadonly<T extends core.SomeType = core.$ZodType>
1941
- extends _ZodType<core.$ZodReadonlyInternals<T>>,
1942
- core.$ZodReadonly<T> {
1943
- unwrap(): T;
1944
- }
1945
- export const ZodReadonly: core.$constructor<ZodReadonly> = /*@__PURE__*/ core.$constructor(
1946
- "ZodReadonly",
1947
- (inst, def) => {
1948
- core.$ZodReadonly.init(inst, def);
1949
- ZodType.init(inst, def);
1950
-
1951
- inst.unwrap = () => inst._zod.def.innerType;
1952
- }
1953
- );
1954
-
1955
- export function readonly<T extends core.SomeType>(innerType: T): ZodReadonly<T> {
1956
- return new ZodReadonly({
1957
- type: "readonly",
1958
- innerType: innerType as any as core.$ZodType,
1959
- }) as any;
1960
- }
1961
-
1962
- // ZodTemplateLiteral
1963
- export interface ZodTemplateLiteral<Template extends string = string>
1964
- extends _ZodType<core.$ZodTemplateLiteralInternals<Template>>,
1965
- core.$ZodTemplateLiteral<Template> {}
1966
- export const ZodTemplateLiteral: core.$constructor<ZodTemplateLiteral> = /*@__PURE__*/ core.$constructor(
1967
- "ZodTemplateLiteral",
1968
- (inst, def) => {
1969
- core.$ZodTemplateLiteral.init(inst, def);
1970
- ZodType.init(inst, def);
1971
- }
1972
- );
1973
-
1974
- export function templateLiteral<const Parts extends core.$ZodTemplateLiteralPart[]>(
1975
- parts: Parts,
1976
- params?: string | core.$ZodTemplateLiteralParams
1977
- ): ZodTemplateLiteral<core.$PartsToTemplateLiteral<Parts>> {
1978
- return new ZodTemplateLiteral({
1979
- type: "template_literal",
1980
- parts,
1981
- ...util.normalizeParams(params),
1982
- }) as any;
1983
- }
1984
-
1985
- // ZodLazy
1986
- export interface ZodLazy<T extends core.SomeType = core.$ZodType>
1987
- extends _ZodType<core.$ZodLazyInternals<T>>,
1988
- core.$ZodLazy<T> {
1989
- unwrap(): T;
1990
- }
1991
- export const ZodLazy: core.$constructor<ZodLazy> = /*@__PURE__*/ core.$constructor("ZodLazy", (inst, def) => {
1992
- core.$ZodLazy.init(inst, def);
1993
- ZodType.init(inst, def);
1994
-
1995
- inst.unwrap = () => inst._zod.def.getter();
1996
- });
1997
-
1998
- export function lazy<T extends core.SomeType>(getter: () => T): ZodLazy<T> {
1999
- return new ZodLazy({
2000
- type: "lazy",
2001
- getter: getter as any,
2002
- }) as any;
2003
- }
2004
-
2005
- // ZodPromise
2006
- export interface ZodPromise<T extends core.SomeType = core.$ZodType>
2007
- extends _ZodType<core.$ZodPromiseInternals<T>>,
2008
- core.$ZodPromise<T> {
2009
- unwrap(): T;
2010
- }
2011
- export const ZodPromise: core.$constructor<ZodPromise> = /*@__PURE__*/ core.$constructor("ZodPromise", (inst, def) => {
2012
- core.$ZodPromise.init(inst, def);
2013
- ZodType.init(inst, def);
2014
-
2015
- inst.unwrap = () => inst._zod.def.innerType;
2016
- });
2017
-
2018
- export function promise<T extends core.SomeType>(innerType: T): ZodPromise<T> {
2019
- return new ZodPromise({
2020
- type: "promise",
2021
- innerType: innerType as any as core.$ZodType,
2022
- }) as any;
2023
- }
2024
-
2025
- // ZodFunction
2026
- export interface ZodFunction<
2027
- Args extends core.$ZodFunctionIn = core.$ZodFunctionIn,
2028
- Returns extends core.$ZodFunctionOut = core.$ZodFunctionOut,
2029
- > extends _ZodType<core.$ZodFunctionInternals<Args, Returns>>,
2030
- core.$ZodFunction<Args, Returns> {
2031
- _def: core.$ZodFunctionDef<Args, Returns>;
2032
- _input: core.$InferInnerFunctionType<Args, Returns>;
2033
- _output: core.$InferOuterFunctionType<Args, Returns>;
2034
-
2035
- input<const Items extends util.TupleItems, const Rest extends core.$ZodFunctionOut = core.$ZodFunctionOut>(
2036
- args: Items,
2037
- rest?: Rest
2038
- ): ZodFunction<core.$ZodTuple<Items, Rest>, Returns>;
2039
- input<NewArgs extends core.$ZodFunctionIn>(args: NewArgs): ZodFunction<NewArgs, Returns>;
2040
- input(...args: any[]): ZodFunction<any, Returns>;
2041
-
2042
- output<NewReturns extends core.$ZodType>(output: NewReturns): ZodFunction<Args, NewReturns>;
2043
- }
2044
-
2045
- export const ZodFunction: core.$constructor<ZodFunction> = /*@__PURE__*/ core.$constructor(
2046
- "ZodFunction",
2047
- (inst, def) => {
2048
- core.$ZodFunction.init(inst, def);
2049
- ZodType.init(inst, def);
2050
- }
2051
- );
2052
-
2053
- export function _function(): ZodFunction;
2054
- export function _function<const In extends ReadonlyArray<core.$ZodType>>(params: {
2055
- input: In;
2056
- }): ZodFunction<ZodTuple<In, null>, core.$ZodFunctionOut>;
2057
- export function _function<
2058
- const In extends ReadonlyArray<core.$ZodType>,
2059
- const Out extends core.$ZodFunctionOut = core.$ZodFunctionOut,
2060
- >(params: {
2061
- input: In;
2062
- output: Out;
2063
- }): ZodFunction<ZodTuple<In, null>, Out>;
2064
- export function _function<const In extends core.$ZodFunctionIn = core.$ZodFunctionIn>(params: {
2065
- input: In;
2066
- }): ZodFunction<In, core.$ZodFunctionOut>;
2067
- export function _function<const Out extends core.$ZodFunctionOut = core.$ZodFunctionOut>(params: {
2068
- output: Out;
2069
- }): ZodFunction<core.$ZodFunctionIn, Out>;
2070
- export function _function<
2071
- In extends core.$ZodFunctionIn = core.$ZodFunctionIn,
2072
- Out extends core.$ZodType = core.$ZodType,
2073
- >(params?: {
2074
- input: In;
2075
- output: Out;
2076
- }): ZodFunction<In, Out>;
2077
- export function _function(params?: {
2078
- output?: core.$ZodType;
2079
- input?: core.$ZodFunctionArgs | Array<core.$ZodType>;
2080
- }): ZodFunction {
2081
- return new ZodFunction({
2082
- type: "function",
2083
- input: Array.isArray(params?.input) ? tuple(params?.input as any) : (params?.input ?? array(unknown())),
2084
- output: params?.output ?? unknown(),
2085
- });
2086
- }
2087
-
2088
- export { _function as function };
2089
-
2090
- // ZodCustom
2091
- export interface ZodCustom<O = unknown, I = unknown>
2092
- extends _ZodType<core.$ZodCustomInternals<O, I>>,
2093
- core.$ZodCustom<O, I> {}
2094
- export const ZodCustom: core.$constructor<ZodCustom> = /*@__PURE__*/ core.$constructor("ZodCustom", (inst, def) => {
2095
- core.$ZodCustom.init(inst, def);
2096
- ZodType.init(inst, def);
2097
- });
2098
-
2099
- // custom checks
2100
- export function check<O = unknown>(fn: core.CheckFn<O>): core.$ZodCheck<O> {
2101
- const ch = new core.$ZodCheck({
2102
- check: "custom",
2103
- // ...util.normalizeParams(params),
2104
- });
2105
-
2106
- ch._zod.check = fn;
2107
- return ch;
2108
- }
2109
-
2110
- export function custom<O>(
2111
- fn?: (data: unknown) => unknown,
2112
- _params?: string | core.$ZodCustomParams | undefined
2113
- ): ZodCustom<O, O> {
2114
- return core._custom(ZodCustom, fn ?? (() => true), _params) as any;
2115
- }
2116
-
2117
- export function refine<T>(
2118
- fn: (arg: NoInfer<T>) => util.MaybeAsync<unknown>,
2119
- _params: string | core.$ZodCustomParams = {}
2120
- ): core.$ZodCheck<T> {
2121
- return core._refine(ZodCustom, fn, _params);
2122
- }
2123
-
2124
- // superRefine
2125
- export function superRefine<T>(
2126
- fn: (arg: T, payload: core.$RefinementCtx<T>) => void | Promise<void>
2127
- ): core.$ZodCheck<T> {
2128
- return core._superRefine(fn);
2129
- }
2130
-
2131
- type ZodInstanceOfParams = core.Params<
2132
- ZodCustom,
2133
- core.$ZodIssueCustom,
2134
- "type" | "check" | "checks" | "fn" | "abort" | "error" | "params" | "path"
2135
- >;
2136
- function _instanceof<T extends typeof util.Class>(
2137
- cls: T,
2138
- params: ZodInstanceOfParams = {
2139
- error: `Input not instance of ${cls.name}`,
2140
- }
2141
- ): ZodCustom<InstanceType<T>, InstanceType<T>> {
2142
- const inst = new ZodCustom({
2143
- type: "custom",
2144
- check: "custom",
2145
- fn: (data) => data instanceof cls,
2146
- abort: true,
2147
- ...(util.normalizeParams(params) as any),
2148
- });
2149
- inst._zod.bag.Class = cls;
2150
- return inst as any;
2151
- }
2152
- export { _instanceof as instanceof };
2153
-
2154
- // stringbool
2155
- export const stringbool: (_params?: string | core.$ZodStringBoolParams) => ZodCodec<ZodString, ZodBoolean> = (
2156
- ...args
2157
- ) =>
2158
- core._stringbool(
2159
- {
2160
- Codec: ZodCodec,
2161
- Boolean: ZodBoolean,
2162
- String: ZodString,
2163
- },
2164
- ...args
2165
- ) as any;
2166
-
2167
- // json
2168
- type _ZodJSONSchema = ZodUnion<
2169
- [ZodString, ZodNumber, ZodBoolean, ZodNull, ZodArray<ZodJSONSchema>, ZodRecord<ZodString, ZodJSONSchema>]
2170
- >;
2171
- type _ZodJSONSchemaInternals = _ZodJSONSchema["_zod"];
2172
-
2173
- export interface ZodJSONSchemaInternals extends _ZodJSONSchemaInternals {
2174
- output: util.JSONType;
2175
- input: util.JSONType;
2176
- }
2177
- export interface ZodJSONSchema extends _ZodJSONSchema {
2178
- _zod: ZodJSONSchemaInternals;
2179
- }
2180
-
2181
- export function json(params?: string | core.$ZodCustomParams): ZodJSONSchema {
2182
- const jsonSchema: any = lazy(() => {
2183
- return union([string(params), number(), boolean(), _null(), array(jsonSchema), record(string(), jsonSchema)]);
2184
- });
2185
-
2186
- return jsonSchema;
2187
- }
2188
-
2189
- // preprocess
2190
-
2191
- // /** @deprecated Use `z.pipe()` and `z.transform()` instead. */
2192
- export function preprocess<A, U extends core.SomeType, B = unknown>(
2193
- fn: (arg: B, ctx: core.$RefinementCtx) => A,
2194
- schema: U
2195
- ): ZodPipe<ZodTransform<A, B>, U> {
2196
- return pipe(transform(fn as any), schema as any) as any;
2197
- }