@deriv-com/fe-mcp-servers 0.0.4 → 0.0.6

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 (772) hide show
  1. package/README.md +53 -27
  2. package/package.json +4 -4
  3. package/node_modules/@modelcontextprotocol/sdk/LICENSE +0 -21
  4. package/node_modules/@modelcontextprotocol/sdk/README.md +0 -105
  5. package/node_modules/@modelcontextprotocol/sdk/dist/cli.d.ts +0 -2
  6. package/node_modules/@modelcontextprotocol/sdk/dist/cli.d.ts.map +0 -1
  7. package/node_modules/@modelcontextprotocol/sdk/dist/cli.js +0 -129
  8. package/node_modules/@modelcontextprotocol/sdk/dist/cli.js.map +0 -1
  9. package/node_modules/@modelcontextprotocol/sdk/dist/client/index.d.ts +0 -773
  10. package/node_modules/@modelcontextprotocol/sdk/dist/client/index.d.ts.map +0 -1
  11. package/node_modules/@modelcontextprotocol/sdk/dist/client/index.js +0 -206
  12. package/node_modules/@modelcontextprotocol/sdk/dist/client/index.js.map +0 -1
  13. package/node_modules/@modelcontextprotocol/sdk/dist/client/index.test.d.ts +0 -2
  14. package/node_modules/@modelcontextprotocol/sdk/dist/client/index.test.d.ts.map +0 -1
  15. package/node_modules/@modelcontextprotocol/sdk/dist/client/index.test.js +0 -393
  16. package/node_modules/@modelcontextprotocol/sdk/dist/client/index.test.js.map +0 -1
  17. package/node_modules/@modelcontextprotocol/sdk/dist/client/sse.d.ts +0 -22
  18. package/node_modules/@modelcontextprotocol/sdk/dist/client/sse.d.ts.map +0 -1
  19. package/node_modules/@modelcontextprotocol/sdk/dist/client/sse.js +0 -91
  20. package/node_modules/@modelcontextprotocol/sdk/dist/client/sse.js.map +0 -1
  21. package/node_modules/@modelcontextprotocol/sdk/dist/client/stdio.d.ts +0 -56
  22. package/node_modules/@modelcontextprotocol/sdk/dist/client/stdio.d.ts.map +0 -1
  23. package/node_modules/@modelcontextprotocol/sdk/dist/client/stdio.js +0 -147
  24. package/node_modules/@modelcontextprotocol/sdk/dist/client/stdio.js.map +0 -1
  25. package/node_modules/@modelcontextprotocol/sdk/dist/client/stdio.test.d.ts +0 -2
  26. package/node_modules/@modelcontextprotocol/sdk/dist/client/stdio.test.d.ts.map +0 -1
  27. package/node_modules/@modelcontextprotocol/sdk/dist/client/stdio.test.js +0 -51
  28. package/node_modules/@modelcontextprotocol/sdk/dist/client/stdio.test.js.map +0 -1
  29. package/node_modules/@modelcontextprotocol/sdk/dist/client/websocket.d.ts +0 -17
  30. package/node_modules/@modelcontextprotocol/sdk/dist/client/websocket.d.ts.map +0 -1
  31. package/node_modules/@modelcontextprotocol/sdk/dist/client/websocket.js +0 -61
  32. package/node_modules/@modelcontextprotocol/sdk/dist/client/websocket.js.map +0 -1
  33. package/node_modules/@modelcontextprotocol/sdk/dist/inMemory.d.ts +0 -20
  34. package/node_modules/@modelcontextprotocol/sdk/dist/inMemory.d.ts.map +0 -1
  35. package/node_modules/@modelcontextprotocol/sdk/dist/inMemory.js +0 -47
  36. package/node_modules/@modelcontextprotocol/sdk/dist/inMemory.js.map +0 -1
  37. package/node_modules/@modelcontextprotocol/sdk/dist/inMemory.test.d.ts +0 -2
  38. package/node_modules/@modelcontextprotocol/sdk/dist/inMemory.test.d.ts.map +0 -1
  39. package/node_modules/@modelcontextprotocol/sdk/dist/inMemory.test.js +0 -74
  40. package/node_modules/@modelcontextprotocol/sdk/dist/inMemory.test.js.map +0 -1
  41. package/node_modules/@modelcontextprotocol/sdk/dist/server/index.d.ts +0 -112
  42. package/node_modules/@modelcontextprotocol/sdk/dist/server/index.d.ts.map +0 -1
  43. package/node_modules/@modelcontextprotocol/sdk/dist/server/index.js +0 -182
  44. package/node_modules/@modelcontextprotocol/sdk/dist/server/index.js.map +0 -1
  45. package/node_modules/@modelcontextprotocol/sdk/dist/server/index.test.d.ts +0 -2
  46. package/node_modules/@modelcontextprotocol/sdk/dist/server/index.test.d.ts.map +0 -1
  47. package/node_modules/@modelcontextprotocol/sdk/dist/server/index.test.js +0 -408
  48. package/node_modules/@modelcontextprotocol/sdk/dist/server/index.test.js.map +0 -1
  49. package/node_modules/@modelcontextprotocol/sdk/dist/server/sse.d.ts +0 -46
  50. package/node_modules/@modelcontextprotocol/sdk/dist/server/sse.d.ts.map +0 -1
  51. package/node_modules/@modelcontextprotocol/sdk/dist/server/sse.js +0 -116
  52. package/node_modules/@modelcontextprotocol/sdk/dist/server/sse.js.map +0 -1
  53. package/node_modules/@modelcontextprotocol/sdk/dist/server/stdio.d.ts +0 -28
  54. package/node_modules/@modelcontextprotocol/sdk/dist/server/stdio.d.ts.map +0 -1
  55. package/node_modules/@modelcontextprotocol/sdk/dist/server/stdio.js +0 -69
  56. package/node_modules/@modelcontextprotocol/sdk/dist/server/stdio.js.map +0 -1
  57. package/node_modules/@modelcontextprotocol/sdk/dist/server/stdio.test.d.ts +0 -2
  58. package/node_modules/@modelcontextprotocol/sdk/dist/server/stdio.test.d.ts.map +0 -1
  59. package/node_modules/@modelcontextprotocol/sdk/dist/server/stdio.test.js +0 -87
  60. package/node_modules/@modelcontextprotocol/sdk/dist/server/stdio.test.js.map +0 -1
  61. package/node_modules/@modelcontextprotocol/sdk/dist/shared/protocol.d.ts +0 -157
  62. package/node_modules/@modelcontextprotocol/sdk/dist/shared/protocol.d.ts.map +0 -1
  63. package/node_modules/@modelcontextprotocol/sdk/dist/shared/protocol.js +0 -297
  64. package/node_modules/@modelcontextprotocol/sdk/dist/shared/protocol.js.map +0 -1
  65. package/node_modules/@modelcontextprotocol/sdk/dist/shared/stdio.d.ts +0 -13
  66. package/node_modules/@modelcontextprotocol/sdk/dist/shared/stdio.d.ts.map +0 -1
  67. package/node_modules/@modelcontextprotocol/sdk/dist/shared/stdio.js +0 -31
  68. package/node_modules/@modelcontextprotocol/sdk/dist/shared/stdio.js.map +0 -1
  69. package/node_modules/@modelcontextprotocol/sdk/dist/shared/stdio.test.d.ts +0 -2
  70. package/node_modules/@modelcontextprotocol/sdk/dist/shared/stdio.test.d.ts.map +0 -1
  71. package/node_modules/@modelcontextprotocol/sdk/dist/shared/stdio.test.js +0 -27
  72. package/node_modules/@modelcontextprotocol/sdk/dist/shared/stdio.test.js.map +0 -1
  73. package/node_modules/@modelcontextprotocol/sdk/dist/shared/transport.d.ts +0 -39
  74. package/node_modules/@modelcontextprotocol/sdk/dist/shared/transport.d.ts.map +0 -1
  75. package/node_modules/@modelcontextprotocol/sdk/dist/shared/transport.js +0 -2
  76. package/node_modules/@modelcontextprotocol/sdk/dist/shared/transport.js.map +0 -1
  77. package/node_modules/@modelcontextprotocol/sdk/dist/types.d.ts +0 -26425
  78. package/node_modules/@modelcontextprotocol/sdk/dist/types.d.ts.map +0 -1
  79. package/node_modules/@modelcontextprotocol/sdk/dist/types.js +0 -997
  80. package/node_modules/@modelcontextprotocol/sdk/dist/types.js.map +0 -1
  81. package/node_modules/@modelcontextprotocol/sdk/package.json +0 -61
  82. package/node_modules/bytes/History.md +0 -97
  83. package/node_modules/bytes/LICENSE +0 -23
  84. package/node_modules/bytes/Readme.md +0 -152
  85. package/node_modules/bytes/index.js +0 -170
  86. package/node_modules/bytes/package.json +0 -42
  87. package/node_modules/content-type/HISTORY.md +0 -29
  88. package/node_modules/content-type/LICENSE +0 -22
  89. package/node_modules/content-type/README.md +0 -94
  90. package/node_modules/content-type/index.js +0 -225
  91. package/node_modules/content-type/package.json +0 -42
  92. package/node_modules/depd/History.md +0 -103
  93. package/node_modules/depd/LICENSE +0 -22
  94. package/node_modules/depd/Readme.md +0 -280
  95. package/node_modules/depd/index.js +0 -538
  96. package/node_modules/depd/lib/browser/index.js +0 -77
  97. package/node_modules/depd/package.json +0 -45
  98. package/node_modules/http-errors/HISTORY.md +0 -180
  99. package/node_modules/http-errors/LICENSE +0 -23
  100. package/node_modules/http-errors/README.md +0 -169
  101. package/node_modules/http-errors/index.js +0 -289
  102. package/node_modules/http-errors/package.json +0 -50
  103. package/node_modules/iconv-lite/.github/dependabot.yml +0 -11
  104. package/node_modules/iconv-lite/.idea/codeStyles/Project.xml +0 -47
  105. package/node_modules/iconv-lite/.idea/codeStyles/codeStyleConfig.xml +0 -5
  106. package/node_modules/iconv-lite/.idea/iconv-lite.iml +0 -12
  107. package/node_modules/iconv-lite/.idea/inspectionProfiles/Project_Default.xml +0 -6
  108. package/node_modules/iconv-lite/.idea/modules.xml +0 -8
  109. package/node_modules/iconv-lite/.idea/vcs.xml +0 -6
  110. package/node_modules/iconv-lite/Changelog.md +0 -212
  111. package/node_modules/iconv-lite/LICENSE +0 -21
  112. package/node_modules/iconv-lite/README.md +0 -130
  113. package/node_modules/iconv-lite/encodings/dbcs-codec.js +0 -597
  114. package/node_modules/iconv-lite/encodings/dbcs-data.js +0 -188
  115. package/node_modules/iconv-lite/encodings/index.js +0 -23
  116. package/node_modules/iconv-lite/encodings/internal.js +0 -198
  117. package/node_modules/iconv-lite/encodings/sbcs-codec.js +0 -72
  118. package/node_modules/iconv-lite/encodings/sbcs-data-generated.js +0 -451
  119. package/node_modules/iconv-lite/encodings/sbcs-data.js +0 -179
  120. package/node_modules/iconv-lite/encodings/tables/big5-added.json +0 -122
  121. package/node_modules/iconv-lite/encodings/tables/cp936.json +0 -264
  122. package/node_modules/iconv-lite/encodings/tables/cp949.json +0 -273
  123. package/node_modules/iconv-lite/encodings/tables/cp950.json +0 -177
  124. package/node_modules/iconv-lite/encodings/tables/eucjp.json +0 -182
  125. package/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +0 -1
  126. package/node_modules/iconv-lite/encodings/tables/gbk-added.json +0 -56
  127. package/node_modules/iconv-lite/encodings/tables/shiftjis.json +0 -125
  128. package/node_modules/iconv-lite/encodings/utf16.js +0 -197
  129. package/node_modules/iconv-lite/encodings/utf32.js +0 -319
  130. package/node_modules/iconv-lite/encodings/utf7.js +0 -290
  131. package/node_modules/iconv-lite/lib/bom-handling.js +0 -52
  132. package/node_modules/iconv-lite/lib/index.d.ts +0 -41
  133. package/node_modules/iconv-lite/lib/index.js +0 -180
  134. package/node_modules/iconv-lite/lib/streams.js +0 -109
  135. package/node_modules/iconv-lite/package.json +0 -44
  136. package/node_modules/inherits/LICENSE +0 -16
  137. package/node_modules/inherits/README.md +0 -42
  138. package/node_modules/inherits/inherits.js +0 -9
  139. package/node_modules/inherits/inherits_browser.js +0 -27
  140. package/node_modules/inherits/package.json +0 -29
  141. package/node_modules/raw-body/HISTORY.md +0 -325
  142. package/node_modules/raw-body/LICENSE +0 -22
  143. package/node_modules/raw-body/README.md +0 -223
  144. package/node_modules/raw-body/SECURITY.md +0 -24
  145. package/node_modules/raw-body/index.d.ts +0 -85
  146. package/node_modules/raw-body/index.js +0 -336
  147. package/node_modules/raw-body/package.json +0 -50
  148. package/node_modules/safer-buffer/LICENSE +0 -21
  149. package/node_modules/safer-buffer/Porting-Buffer.md +0 -268
  150. package/node_modules/safer-buffer/Readme.md +0 -156
  151. package/node_modules/safer-buffer/dangerous.js +0 -58
  152. package/node_modules/safer-buffer/package.json +0 -34
  153. package/node_modules/safer-buffer/safer.js +0 -77
  154. package/node_modules/safer-buffer/tests.js +0 -406
  155. package/node_modules/setprototypeof/LICENSE +0 -13
  156. package/node_modules/setprototypeof/README.md +0 -31
  157. package/node_modules/setprototypeof/index.d.ts +0 -2
  158. package/node_modules/setprototypeof/index.js +0 -17
  159. package/node_modules/setprototypeof/package.json +0 -38
  160. package/node_modules/setprototypeof/test/index.js +0 -24
  161. package/node_modules/statuses/HISTORY.md +0 -82
  162. package/node_modules/statuses/LICENSE +0 -23
  163. package/node_modules/statuses/README.md +0 -136
  164. package/node_modules/statuses/codes.json +0 -65
  165. package/node_modules/statuses/index.js +0 -146
  166. package/node_modules/statuses/package.json +0 -49
  167. package/node_modules/toidentifier/HISTORY.md +0 -9
  168. package/node_modules/toidentifier/LICENSE +0 -21
  169. package/node_modules/toidentifier/README.md +0 -61
  170. package/node_modules/toidentifier/index.js +0 -32
  171. package/node_modules/toidentifier/package.json +0 -38
  172. package/node_modules/unpipe/HISTORY.md +0 -4
  173. package/node_modules/unpipe/LICENSE +0 -22
  174. package/node_modules/unpipe/README.md +0 -43
  175. package/node_modules/unpipe/index.js +0 -69
  176. package/node_modules/unpipe/package.json +0 -27
  177. package/node_modules/zod/LICENSE +0 -21
  178. package/node_modules/zod/README.md +0 -208
  179. package/node_modules/zod/index.cjs +0 -33
  180. package/node_modules/zod/index.d.cts +0 -4
  181. package/node_modules/zod/index.d.ts +0 -4
  182. package/node_modules/zod/index.js +0 -4
  183. package/node_modules/zod/package.json +0 -118
  184. package/node_modules/zod/src/index.ts +0 -4
  185. package/node_modules/zod/src/v3/ZodError.ts +0 -330
  186. package/node_modules/zod/src/v3/benchmarks/datetime.ts +0 -58
  187. package/node_modules/zod/src/v3/benchmarks/discriminatedUnion.ts +0 -80
  188. package/node_modules/zod/src/v3/benchmarks/index.ts +0 -59
  189. package/node_modules/zod/src/v3/benchmarks/ipv4.ts +0 -57
  190. package/node_modules/zod/src/v3/benchmarks/object.ts +0 -69
  191. package/node_modules/zod/src/v3/benchmarks/primitives.ts +0 -162
  192. package/node_modules/zod/src/v3/benchmarks/realworld.ts +0 -63
  193. package/node_modules/zod/src/v3/benchmarks/string.ts +0 -55
  194. package/node_modules/zod/src/v3/benchmarks/union.ts +0 -80
  195. package/node_modules/zod/src/v3/errors.ts +0 -13
  196. package/node_modules/zod/src/v3/external.ts +0 -6
  197. package/node_modules/zod/src/v3/helpers/enumUtil.ts +0 -17
  198. package/node_modules/zod/src/v3/helpers/errorUtil.ts +0 -8
  199. package/node_modules/zod/src/v3/helpers/parseUtil.ts +0 -176
  200. package/node_modules/zod/src/v3/helpers/partialUtil.ts +0 -34
  201. package/node_modules/zod/src/v3/helpers/typeAliases.ts +0 -2
  202. package/node_modules/zod/src/v3/helpers/util.ts +0 -224
  203. package/node_modules/zod/src/v3/index.ts +0 -4
  204. package/node_modules/zod/src/v3/locales/en.ts +0 -124
  205. package/node_modules/zod/src/v3/standard-schema.ts +0 -113
  206. package/node_modules/zod/src/v3/tests/Mocker.ts +0 -54
  207. package/node_modules/zod/src/v3/tests/all-errors.test.ts +0 -157
  208. package/node_modules/zod/src/v3/tests/anyunknown.test.ts +0 -28
  209. package/node_modules/zod/src/v3/tests/array.test.ts +0 -71
  210. package/node_modules/zod/src/v3/tests/async-parsing.test.ts +0 -388
  211. package/node_modules/zod/src/v3/tests/async-refinements.test.ts +0 -46
  212. package/node_modules/zod/src/v3/tests/base.test.ts +0 -29
  213. package/node_modules/zod/src/v3/tests/bigint.test.ts +0 -55
  214. package/node_modules/zod/src/v3/tests/branded.test.ts +0 -53
  215. package/node_modules/zod/src/v3/tests/catch.test.ts +0 -220
  216. package/node_modules/zod/src/v3/tests/coerce.test.ts +0 -133
  217. package/node_modules/zod/src/v3/tests/complex.test.ts +0 -56
  218. package/node_modules/zod/src/v3/tests/custom.test.ts +0 -31
  219. package/node_modules/zod/src/v3/tests/date.test.ts +0 -32
  220. package/node_modules/zod/src/v3/tests/deepmasking.test.ts +0 -186
  221. package/node_modules/zod/src/v3/tests/default.test.ts +0 -112
  222. package/node_modules/zod/src/v3/tests/description.test.ts +0 -33
  223. package/node_modules/zod/src/v3/tests/discriminated-unions.test.ts +0 -315
  224. package/node_modules/zod/src/v3/tests/enum.test.ts +0 -80
  225. package/node_modules/zod/src/v3/tests/error.test.ts +0 -551
  226. package/node_modules/zod/src/v3/tests/firstparty.test.ts +0 -87
  227. package/node_modules/zod/src/v3/tests/firstpartyschematypes.test.ts +0 -21
  228. package/node_modules/zod/src/v3/tests/function.test.ts +0 -257
  229. package/node_modules/zod/src/v3/tests/generics.test.ts +0 -48
  230. package/node_modules/zod/src/v3/tests/instanceof.test.ts +0 -37
  231. package/node_modules/zod/src/v3/tests/intersection.test.ts +0 -110
  232. package/node_modules/zod/src/v3/tests/language-server.source.ts +0 -76
  233. package/node_modules/zod/src/v3/tests/language-server.test.ts +0 -207
  234. package/node_modules/zod/src/v3/tests/literal.test.ts +0 -36
  235. package/node_modules/zod/src/v3/tests/map.test.ts +0 -110
  236. package/node_modules/zod/src/v3/tests/masking.test.ts +0 -4
  237. package/node_modules/zod/src/v3/tests/mocker.test.ts +0 -19
  238. package/node_modules/zod/src/v3/tests/nan.test.ts +0 -21
  239. package/node_modules/zod/src/v3/tests/nativeEnum.test.ts +0 -87
  240. package/node_modules/zod/src/v3/tests/nullable.test.ts +0 -42
  241. package/node_modules/zod/src/v3/tests/number.test.ts +0 -176
  242. package/node_modules/zod/src/v3/tests/object-augmentation.test.ts +0 -29
  243. package/node_modules/zod/src/v3/tests/object-in-es5-env.test.ts +0 -29
  244. package/node_modules/zod/src/v3/tests/object.test.ts +0 -434
  245. package/node_modules/zod/src/v3/tests/optional.test.ts +0 -42
  246. package/node_modules/zod/src/v3/tests/parseUtil.test.ts +0 -23
  247. package/node_modules/zod/src/v3/tests/parser.test.ts +0 -41
  248. package/node_modules/zod/src/v3/tests/partials.test.ts +0 -243
  249. package/node_modules/zod/src/v3/tests/pickomit.test.ts +0 -111
  250. package/node_modules/zod/src/v3/tests/pipeline.test.ts +0 -29
  251. package/node_modules/zod/src/v3/tests/preprocess.test.ts +0 -186
  252. package/node_modules/zod/src/v3/tests/primitive.test.ts +0 -440
  253. package/node_modules/zod/src/v3/tests/promise.test.ts +0 -90
  254. package/node_modules/zod/src/v3/tests/readonly.test.ts +0 -194
  255. package/node_modules/zod/src/v3/tests/record.test.ts +0 -171
  256. package/node_modules/zod/src/v3/tests/recursive.test.ts +0 -197
  257. package/node_modules/zod/src/v3/tests/refine.test.ts +0 -313
  258. package/node_modules/zod/src/v3/tests/safeparse.test.ts +0 -27
  259. package/node_modules/zod/src/v3/tests/set.test.ts +0 -142
  260. package/node_modules/zod/src/v3/tests/standard-schema.test.ts +0 -83
  261. package/node_modules/zod/src/v3/tests/string.test.ts +0 -916
  262. package/node_modules/zod/src/v3/tests/transformer.test.ts +0 -233
  263. package/node_modules/zod/src/v3/tests/tuple.test.ts +0 -90
  264. package/node_modules/zod/src/v3/tests/unions.test.ts +0 -57
  265. package/node_modules/zod/src/v3/tests/validations.test.ts +0 -133
  266. package/node_modules/zod/src/v3/tests/void.test.ts +0 -15
  267. package/node_modules/zod/src/v3/types.ts +0 -5136
  268. package/node_modules/zod/src/v4/classic/checks.ts +0 -30
  269. package/node_modules/zod/src/v4/classic/coerce.ts +0 -27
  270. package/node_modules/zod/src/v4/classic/compat.ts +0 -66
  271. package/node_modules/zod/src/v4/classic/errors.ts +0 -75
  272. package/node_modules/zod/src/v4/classic/external.ts +0 -50
  273. package/node_modules/zod/src/v4/classic/index.ts +0 -5
  274. package/node_modules/zod/src/v4/classic/iso.ts +0 -90
  275. package/node_modules/zod/src/v4/classic/parse.ts +0 -33
  276. package/node_modules/zod/src/v4/classic/schemas.ts +0 -2054
  277. package/node_modules/zod/src/v4/classic/tests/anyunknown.test.ts +0 -26
  278. package/node_modules/zod/src/v4/classic/tests/array.test.ts +0 -264
  279. package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +0 -210
  280. package/node_modules/zod/src/v4/classic/tests/async-parsing.test.ts +0 -381
  281. package/node_modules/zod/src/v4/classic/tests/async-refinements.test.ts +0 -68
  282. package/node_modules/zod/src/v4/classic/tests/base.test.ts +0 -7
  283. package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +0 -54
  284. package/node_modules/zod/src/v4/classic/tests/brand.test.ts +0 -63
  285. package/node_modules/zod/src/v4/classic/tests/catch.test.ts +0 -252
  286. package/node_modules/zod/src/v4/classic/tests/coalesce.test.ts +0 -20
  287. package/node_modules/zod/src/v4/classic/tests/coerce.test.ts +0 -160
  288. package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +0 -352
  289. package/node_modules/zod/src/v4/classic/tests/custom.test.ts +0 -40
  290. package/node_modules/zod/src/v4/classic/tests/date.test.ts +0 -31
  291. package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +0 -296
  292. package/node_modules/zod/src/v4/classic/tests/default.test.ts +0 -313
  293. package/node_modules/zod/src/v4/classic/tests/description.test.ts +0 -32
  294. package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +0 -619
  295. package/node_modules/zod/src/v4/classic/tests/enum.test.ts +0 -285
  296. package/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +0 -527
  297. package/node_modules/zod/src/v4/classic/tests/error.test.ts +0 -711
  298. package/node_modules/zod/src/v4/classic/tests/file.test.ts +0 -91
  299. package/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +0 -175
  300. package/node_modules/zod/src/v4/classic/tests/function.test.ts +0 -268
  301. package/node_modules/zod/src/v4/classic/tests/generics.test.ts +0 -72
  302. package/node_modules/zod/src/v4/classic/tests/index.test.ts +0 -829
  303. package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +0 -34
  304. package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +0 -171
  305. package/node_modules/zod/src/v4/classic/tests/json.test.ts +0 -108
  306. package/node_modules/zod/src/v4/classic/tests/lazy.test.ts +0 -227
  307. package/node_modules/zod/src/v4/classic/tests/literal.test.ts +0 -92
  308. package/node_modules/zod/src/v4/classic/tests/map.test.ts +0 -196
  309. package/node_modules/zod/src/v4/classic/tests/nan.test.ts +0 -21
  310. package/node_modules/zod/src/v4/classic/tests/nested-refine.test.ts +0 -168
  311. package/node_modules/zod/src/v4/classic/tests/nonoptional.test.ts +0 -86
  312. package/node_modules/zod/src/v4/classic/tests/nullable.test.ts +0 -22
  313. package/node_modules/zod/src/v4/classic/tests/number.test.ts +0 -247
  314. package/node_modules/zod/src/v4/classic/tests/object.test.ts +0 -563
  315. package/node_modules/zod/src/v4/classic/tests/optional.test.ts +0 -123
  316. package/node_modules/zod/src/v4/classic/tests/partial.test.ts +0 -147
  317. package/node_modules/zod/src/v4/classic/tests/pickomit.test.ts +0 -127
  318. package/node_modules/zod/src/v4/classic/tests/pipe.test.ts +0 -81
  319. package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +0 -37
  320. package/node_modules/zod/src/v4/classic/tests/preprocess.test.ts +0 -298
  321. package/node_modules/zod/src/v4/classic/tests/primitive.test.ts +0 -175
  322. package/node_modules/zod/src/v4/classic/tests/promise.test.ts +0 -81
  323. package/node_modules/zod/src/v4/classic/tests/prototypes.test.ts +0 -23
  324. package/node_modules/zod/src/v4/classic/tests/readonly.test.ts +0 -252
  325. package/node_modules/zod/src/v4/classic/tests/record.test.ts +0 -342
  326. package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +0 -356
  327. package/node_modules/zod/src/v4/classic/tests/refine.test.ts +0 -532
  328. package/node_modules/zod/src/v4/classic/tests/registries.test.ts +0 -204
  329. package/node_modules/zod/src/v4/classic/tests/set.test.ts +0 -179
  330. package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +0 -57
  331. package/node_modules/zod/src/v4/classic/tests/string-formats.test.ts +0 -109
  332. package/node_modules/zod/src/v4/classic/tests/string.test.ts +0 -881
  333. package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +0 -66
  334. package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +0 -758
  335. package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +0 -2314
  336. package/node_modules/zod/src/v4/classic/tests/transform.test.ts +0 -250
  337. package/node_modules/zod/src/v4/classic/tests/tuple.test.ts +0 -163
  338. package/node_modules/zod/src/v4/classic/tests/union.test.ts +0 -94
  339. package/node_modules/zod/src/v4/classic/tests/validations.test.ts +0 -283
  340. package/node_modules/zod/src/v4/classic/tests/void.test.ts +0 -12
  341. package/node_modules/zod/src/v4/core/api.ts +0 -1594
  342. package/node_modules/zod/src/v4/core/checks.ts +0 -1283
  343. package/node_modules/zod/src/v4/core/config.ts +0 -15
  344. package/node_modules/zod/src/v4/core/core.ts +0 -134
  345. package/node_modules/zod/src/v4/core/doc.ts +0 -44
  346. package/node_modules/zod/src/v4/core/errors.ts +0 -424
  347. package/node_modules/zod/src/v4/core/function.ts +0 -176
  348. package/node_modules/zod/src/v4/core/index.ts +0 -15
  349. package/node_modules/zod/src/v4/core/json-schema.ts +0 -143
  350. package/node_modules/zod/src/v4/core/parse.ts +0 -94
  351. package/node_modules/zod/src/v4/core/regexes.ts +0 -135
  352. package/node_modules/zod/src/v4/core/registries.ts +0 -96
  353. package/node_modules/zod/src/v4/core/schemas.ts +0 -3842
  354. package/node_modules/zod/src/v4/core/standard-schema.ts +0 -64
  355. package/node_modules/zod/src/v4/core/tests/index.test.ts +0 -46
  356. package/node_modules/zod/src/v4/core/tests/locales/be.test.ts +0 -124
  357. package/node_modules/zod/src/v4/core/tests/locales/en.test.ts +0 -22
  358. package/node_modules/zod/src/v4/core/tests/locales/ru.test.ts +0 -128
  359. package/node_modules/zod/src/v4/core/tests/locales/tr.test.ts +0 -69
  360. package/node_modules/zod/src/v4/core/to-json-schema.ts +0 -977
  361. package/node_modules/zod/src/v4/core/util.ts +0 -775
  362. package/node_modules/zod/src/v4/core/versions.ts +0 -5
  363. package/node_modules/zod/src/v4/core/zsf.ts +0 -323
  364. package/node_modules/zod/src/v4/index.ts +0 -4
  365. package/node_modules/zod/src/v4/locales/ar.ts +0 -125
  366. package/node_modules/zod/src/v4/locales/az.ts +0 -121
  367. package/node_modules/zod/src/v4/locales/be.ts +0 -184
  368. package/node_modules/zod/src/v4/locales/ca.ts +0 -127
  369. package/node_modules/zod/src/v4/locales/cs.ts +0 -142
  370. package/node_modules/zod/src/v4/locales/de.ts +0 -124
  371. package/node_modules/zod/src/v4/locales/en.ts +0 -127
  372. package/node_modules/zod/src/v4/locales/eo.ts +0 -125
  373. package/node_modules/zod/src/v4/locales/es.ts +0 -125
  374. package/node_modules/zod/src/v4/locales/fa.ts +0 -134
  375. package/node_modules/zod/src/v4/locales/fi.ts +0 -131
  376. package/node_modules/zod/src/v4/locales/fr-CA.ts +0 -126
  377. package/node_modules/zod/src/v4/locales/fr.ts +0 -124
  378. package/node_modules/zod/src/v4/locales/he.ts +0 -125
  379. package/node_modules/zod/src/v4/locales/hu.ts +0 -126
  380. package/node_modules/zod/src/v4/locales/id.ts +0 -125
  381. package/node_modules/zod/src/v4/locales/index.ts +0 -39
  382. package/node_modules/zod/src/v4/locales/it.ts +0 -125
  383. package/node_modules/zod/src/v4/locales/ja.ts +0 -122
  384. package/node_modules/zod/src/v4/locales/kh.ts +0 -126
  385. package/node_modules/zod/src/v4/locales/ko.ts +0 -131
  386. package/node_modules/zod/src/v4/locales/mk.ts +0 -127
  387. package/node_modules/zod/src/v4/locales/ms.ts +0 -124
  388. package/node_modules/zod/src/v4/locales/nl.ts +0 -126
  389. package/node_modules/zod/src/v4/locales/no.ts +0 -124
  390. package/node_modules/zod/src/v4/locales/ota.ts +0 -125
  391. package/node_modules/zod/src/v4/locales/pl.ts +0 -126
  392. package/node_modules/zod/src/v4/locales/ps.ts +0 -133
  393. package/node_modules/zod/src/v4/locales/pt.ts +0 -123
  394. package/node_modules/zod/src/v4/locales/ru.ts +0 -184
  395. package/node_modules/zod/src/v4/locales/sl.ts +0 -126
  396. package/node_modules/zod/src/v4/locales/sv.ts +0 -127
  397. package/node_modules/zod/src/v4/locales/ta.ts +0 -125
  398. package/node_modules/zod/src/v4/locales/th.ts +0 -126
  399. package/node_modules/zod/src/v4/locales/tr.ts +0 -121
  400. package/node_modules/zod/src/v4/locales/ua.ts +0 -126
  401. package/node_modules/zod/src/v4/locales/ur.ts +0 -126
  402. package/node_modules/zod/src/v4/locales/vi.ts +0 -125
  403. package/node_modules/zod/src/v4/locales/zh-CN.ts +0 -123
  404. package/node_modules/zod/src/v4/locales/zh-TW.ts +0 -125
  405. package/node_modules/zod/src/v4/mini/checks.ts +0 -32
  406. package/node_modules/zod/src/v4/mini/coerce.ts +0 -22
  407. package/node_modules/zod/src/v4/mini/external.ts +0 -40
  408. package/node_modules/zod/src/v4/mini/index.ts +0 -3
  409. package/node_modules/zod/src/v4/mini/iso.ts +0 -62
  410. package/node_modules/zod/src/v4/mini/parse.ts +0 -1
  411. package/node_modules/zod/src/v4/mini/schemas.ts +0 -1579
  412. package/node_modules/zod/src/v4/mini/tests/assignability.test.ts +0 -129
  413. package/node_modules/zod/src/v4/mini/tests/brand.test.ts +0 -51
  414. package/node_modules/zod/src/v4/mini/tests/checks.test.ts +0 -144
  415. package/node_modules/zod/src/v4/mini/tests/computed.test.ts +0 -36
  416. package/node_modules/zod/src/v4/mini/tests/error.test.ts +0 -22
  417. package/node_modules/zod/src/v4/mini/tests/functions.test.ts +0 -43
  418. package/node_modules/zod/src/v4/mini/tests/index.test.ts +0 -871
  419. package/node_modules/zod/src/v4/mini/tests/number.test.ts +0 -95
  420. package/node_modules/zod/src/v4/mini/tests/object.test.ts +0 -185
  421. package/node_modules/zod/src/v4/mini/tests/prototypes.test.ts +0 -43
  422. package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +0 -275
  423. package/node_modules/zod/src/v4/mini/tests/string.test.ts +0 -299
  424. package/node_modules/zod/src/v4-mini/index.ts +0 -1
  425. package/node_modules/zod/v3/ZodError.cjs +0 -138
  426. package/node_modules/zod/v3/ZodError.d.cts +0 -164
  427. package/node_modules/zod/v3/ZodError.d.ts +0 -164
  428. package/node_modules/zod/v3/ZodError.js +0 -133
  429. package/node_modules/zod/v3/errors.cjs +0 -17
  430. package/node_modules/zod/v3/errors.d.cts +0 -5
  431. package/node_modules/zod/v3/errors.d.ts +0 -5
  432. package/node_modules/zod/v3/errors.js +0 -9
  433. package/node_modules/zod/v3/external.cjs +0 -22
  434. package/node_modules/zod/v3/external.d.cts +0 -6
  435. package/node_modules/zod/v3/external.d.ts +0 -6
  436. package/node_modules/zod/v3/external.js +0 -6
  437. package/node_modules/zod/v3/helpers/enumUtil.cjs +0 -2
  438. package/node_modules/zod/v3/helpers/enumUtil.d.cts +0 -8
  439. package/node_modules/zod/v3/helpers/enumUtil.d.ts +0 -8
  440. package/node_modules/zod/v3/helpers/enumUtil.js +0 -1
  441. package/node_modules/zod/v3/helpers/errorUtil.cjs +0 -9
  442. package/node_modules/zod/v3/helpers/errorUtil.d.cts +0 -9
  443. package/node_modules/zod/v3/helpers/errorUtil.d.ts +0 -9
  444. package/node_modules/zod/v3/helpers/errorUtil.js +0 -6
  445. package/node_modules/zod/v3/helpers/parseUtil.cjs +0 -124
  446. package/node_modules/zod/v3/helpers/parseUtil.d.cts +0 -78
  447. package/node_modules/zod/v3/helpers/parseUtil.d.ts +0 -78
  448. package/node_modules/zod/v3/helpers/parseUtil.js +0 -109
  449. package/node_modules/zod/v3/helpers/partialUtil.cjs +0 -2
  450. package/node_modules/zod/v3/helpers/partialUtil.d.cts +0 -8
  451. package/node_modules/zod/v3/helpers/partialUtil.d.ts +0 -8
  452. package/node_modules/zod/v3/helpers/partialUtil.js +0 -1
  453. package/node_modules/zod/v3/helpers/typeAliases.cjs +0 -2
  454. package/node_modules/zod/v3/helpers/typeAliases.d.cts +0 -2
  455. package/node_modules/zod/v3/helpers/typeAliases.d.ts +0 -2
  456. package/node_modules/zod/v3/helpers/typeAliases.js +0 -1
  457. package/node_modules/zod/v3/helpers/util.cjs +0 -137
  458. package/node_modules/zod/v3/helpers/util.d.cts +0 -85
  459. package/node_modules/zod/v3/helpers/util.d.ts +0 -85
  460. package/node_modules/zod/v3/helpers/util.js +0 -133
  461. package/node_modules/zod/v3/index.cjs +0 -33
  462. package/node_modules/zod/v3/index.d.cts +0 -4
  463. package/node_modules/zod/v3/index.d.ts +0 -4
  464. package/node_modules/zod/v3/index.js +0 -4
  465. package/node_modules/zod/v3/locales/en.cjs +0 -111
  466. package/node_modules/zod/v3/locales/en.d.cts +0 -3
  467. package/node_modules/zod/v3/locales/en.d.ts +0 -3
  468. package/node_modules/zod/v3/locales/en.js +0 -109
  469. package/node_modules/zod/v3/standard-schema.cjs +0 -2
  470. package/node_modules/zod/v3/standard-schema.d.cts +0 -102
  471. package/node_modules/zod/v3/standard-schema.d.ts +0 -102
  472. package/node_modules/zod/v3/standard-schema.js +0 -1
  473. package/node_modules/zod/v3/types.cjs +0 -3775
  474. package/node_modules/zod/v3/types.d.cts +0 -1031
  475. package/node_modules/zod/v3/types.d.ts +0 -1031
  476. package/node_modules/zod/v3/types.js +0 -3693
  477. package/node_modules/zod/v4/classic/checks.cjs +0 -32
  478. package/node_modules/zod/v4/classic/checks.d.cts +0 -1
  479. package/node_modules/zod/v4/classic/checks.d.ts +0 -1
  480. package/node_modules/zod/v4/classic/checks.js +0 -1
  481. package/node_modules/zod/v4/classic/coerce.cjs +0 -47
  482. package/node_modules/zod/v4/classic/coerce.d.cts +0 -17
  483. package/node_modules/zod/v4/classic/coerce.d.ts +0 -17
  484. package/node_modules/zod/v4/classic/coerce.js +0 -17
  485. package/node_modules/zod/v4/classic/compat.cjs +0 -57
  486. package/node_modules/zod/v4/classic/compat.d.cts +0 -46
  487. package/node_modules/zod/v4/classic/compat.d.ts +0 -46
  488. package/node_modules/zod/v4/classic/compat.js +0 -27
  489. package/node_modules/zod/v4/classic/errors.cjs +0 -67
  490. package/node_modules/zod/v4/classic/errors.d.cts +0 -30
  491. package/node_modules/zod/v4/classic/errors.d.ts +0 -30
  492. package/node_modules/zod/v4/classic/errors.js +0 -41
  493. package/node_modules/zod/v4/classic/external.cjs +0 -70
  494. package/node_modules/zod/v4/classic/external.d.cts +0 -13
  495. package/node_modules/zod/v4/classic/external.d.ts +0 -13
  496. package/node_modules/zod/v4/classic/external.js +0 -18
  497. package/node_modules/zod/v4/classic/index.cjs +0 -33
  498. package/node_modules/zod/v4/classic/index.d.cts +0 -4
  499. package/node_modules/zod/v4/classic/index.d.ts +0 -4
  500. package/node_modules/zod/v4/classic/index.js +0 -4
  501. package/node_modules/zod/v4/classic/iso.cjs +0 -60
  502. package/node_modules/zod/v4/classic/iso.d.cts +0 -22
  503. package/node_modules/zod/v4/classic/iso.d.ts +0 -22
  504. package/node_modules/zod/v4/classic/iso.js +0 -30
  505. package/node_modules/zod/v4/classic/parse.cjs +0 -32
  506. package/node_modules/zod/v4/classic/parse.d.cts +0 -23
  507. package/node_modules/zod/v4/classic/parse.d.ts +0 -23
  508. package/node_modules/zod/v4/classic/parse.js +0 -6
  509. package/node_modules/zod/v4/classic/schemas.cjs +0 -1109
  510. package/node_modules/zod/v4/classic/schemas.d.cts +0 -630
  511. package/node_modules/zod/v4/classic/schemas.d.ts +0 -630
  512. package/node_modules/zod/v4/classic/schemas.js +0 -1006
  513. package/node_modules/zod/v4/core/api.cjs +0 -1039
  514. package/node_modules/zod/v4/core/api.d.cts +0 -284
  515. package/node_modules/zod/v4/core/api.d.ts +0 -284
  516. package/node_modules/zod/v4/core/api.js +0 -906
  517. package/node_modules/zod/v4/core/checks.cjs +0 -591
  518. package/node_modules/zod/v4/core/checks.d.cts +0 -278
  519. package/node_modules/zod/v4/core/checks.d.ts +0 -278
  520. package/node_modules/zod/v4/core/checks.js +0 -565
  521. package/node_modules/zod/v4/core/core.cjs +0 -67
  522. package/node_modules/zod/v4/core/core.d.cts +0 -49
  523. package/node_modules/zod/v4/core/core.d.ts +0 -49
  524. package/node_modules/zod/v4/core/core.js +0 -61
  525. package/node_modules/zod/v4/core/doc.cjs +0 -39
  526. package/node_modules/zod/v4/core/doc.d.cts +0 -14
  527. package/node_modules/zod/v4/core/doc.d.ts +0 -14
  528. package/node_modules/zod/v4/core/doc.js +0 -35
  529. package/node_modules/zod/v4/core/errors.cjs +0 -226
  530. package/node_modules/zod/v4/core/errors.d.cts +0 -208
  531. package/node_modules/zod/v4/core/errors.d.ts +0 -208
  532. package/node_modules/zod/v4/core/errors.js +0 -195
  533. package/node_modules/zod/v4/core/function.cjs +0 -102
  534. package/node_modules/zod/v4/core/function.d.cts +0 -52
  535. package/node_modules/zod/v4/core/function.d.ts +0 -52
  536. package/node_modules/zod/v4/core/function.js +0 -75
  537. package/node_modules/zod/v4/core/index.cjs +0 -44
  538. package/node_modules/zod/v4/core/index.d.cts +0 -15
  539. package/node_modules/zod/v4/core/index.d.ts +0 -15
  540. package/node_modules/zod/v4/core/index.js +0 -15
  541. package/node_modules/zod/v4/core/json-schema.cjs +0 -2
  542. package/node_modules/zod/v4/core/json-schema.d.cts +0 -87
  543. package/node_modules/zod/v4/core/json-schema.d.ts +0 -87
  544. package/node_modules/zod/v4/core/json-schema.js +0 -1
  545. package/node_modules/zod/v4/core/parse.cjs +0 -87
  546. package/node_modules/zod/v4/core/parse.d.cts +0 -25
  547. package/node_modules/zod/v4/core/parse.d.ts +0 -25
  548. package/node_modules/zod/v4/core/parse.js +0 -57
  549. package/node_modules/zod/v4/core/regexes.cjs +0 -103
  550. package/node_modules/zod/v4/core/regexes.d.cts +0 -62
  551. package/node_modules/zod/v4/core/regexes.d.ts +0 -62
  552. package/node_modules/zod/v4/core/regexes.js +0 -95
  553. package/node_modules/zod/v4/core/registries.cjs +0 -56
  554. package/node_modules/zod/v4/core/registries.d.cts +0 -35
  555. package/node_modules/zod/v4/core/registries.d.ts +0 -35
  556. package/node_modules/zod/v4/core/registries.js +0 -51
  557. package/node_modules/zod/v4/core/schemas.cjs +0 -1748
  558. package/node_modules/zod/v4/core/schemas.d.cts +0 -1041
  559. package/node_modules/zod/v4/core/schemas.d.ts +0 -1041
  560. package/node_modules/zod/v4/core/schemas.js +0 -1717
  561. package/node_modules/zod/v4/core/standard-schema.cjs +0 -2
  562. package/node_modules/zod/v4/core/standard-schema.d.cts +0 -55
  563. package/node_modules/zod/v4/core/standard-schema.d.ts +0 -55
  564. package/node_modules/zod/v4/core/standard-schema.js +0 -1
  565. package/node_modules/zod/v4/core/to-json-schema.cjs +0 -854
  566. package/node_modules/zod/v4/core/to-json-schema.d.cts +0 -88
  567. package/node_modules/zod/v4/core/to-json-schema.d.ts +0 -88
  568. package/node_modules/zod/v4/core/to-json-schema.js +0 -849
  569. package/node_modules/zod/v4/core/util.cjs +0 -539
  570. package/node_modules/zod/v4/core/util.d.cts +0 -183
  571. package/node_modules/zod/v4/core/util.d.ts +0 -183
  572. package/node_modules/zod/v4/core/util.js +0 -493
  573. package/node_modules/zod/v4/core/versions.cjs +0 -8
  574. package/node_modules/zod/v4/core/versions.d.cts +0 -5
  575. package/node_modules/zod/v4/core/versions.d.ts +0 -5
  576. package/node_modules/zod/v4/core/versions.js +0 -5
  577. package/node_modules/zod/v4/index.cjs +0 -22
  578. package/node_modules/zod/v4/index.d.cts +0 -3
  579. package/node_modules/zod/v4/index.d.ts +0 -3
  580. package/node_modules/zod/v4/index.js +0 -3
  581. package/node_modules/zod/v4/locales/ar.cjs +0 -142
  582. package/node_modules/zod/v4/locales/ar.d.cts +0 -4
  583. package/node_modules/zod/v4/locales/ar.d.ts +0 -4
  584. package/node_modules/zod/v4/locales/ar.js +0 -116
  585. package/node_modules/zod/v4/locales/az.cjs +0 -141
  586. package/node_modules/zod/v4/locales/az.d.cts +0 -4
  587. package/node_modules/zod/v4/locales/az.d.ts +0 -4
  588. package/node_modules/zod/v4/locales/az.js +0 -115
  589. package/node_modules/zod/v4/locales/be.cjs +0 -190
  590. package/node_modules/zod/v4/locales/be.d.cts +0 -4
  591. package/node_modules/zod/v4/locales/be.d.ts +0 -4
  592. package/node_modules/zod/v4/locales/be.js +0 -164
  593. package/node_modules/zod/v4/locales/ca.cjs +0 -144
  594. package/node_modules/zod/v4/locales/ca.d.cts +0 -4
  595. package/node_modules/zod/v4/locales/ca.d.ts +0 -4
  596. package/node_modules/zod/v4/locales/ca.js +0 -118
  597. package/node_modules/zod/v4/locales/cs.cjs +0 -161
  598. package/node_modules/zod/v4/locales/cs.d.cts +0 -4
  599. package/node_modules/zod/v4/locales/cs.d.ts +0 -4
  600. package/node_modules/zod/v4/locales/cs.js +0 -135
  601. package/node_modules/zod/v4/locales/de.cjs +0 -142
  602. package/node_modules/zod/v4/locales/de.d.cts +0 -4
  603. package/node_modules/zod/v4/locales/de.d.ts +0 -4
  604. package/node_modules/zod/v4/locales/de.js +0 -116
  605. package/node_modules/zod/v4/locales/en.cjs +0 -145
  606. package/node_modules/zod/v4/locales/en.d.cts +0 -5
  607. package/node_modules/zod/v4/locales/en.d.ts +0 -5
  608. package/node_modules/zod/v4/locales/en.js +0 -117
  609. package/node_modules/zod/v4/locales/eo.cjs +0 -144
  610. package/node_modules/zod/v4/locales/eo.d.cts +0 -5
  611. package/node_modules/zod/v4/locales/eo.d.ts +0 -5
  612. package/node_modules/zod/v4/locales/eo.js +0 -116
  613. package/node_modules/zod/v4/locales/es.cjs +0 -143
  614. package/node_modules/zod/v4/locales/es.d.cts +0 -4
  615. package/node_modules/zod/v4/locales/es.d.ts +0 -4
  616. package/node_modules/zod/v4/locales/es.js +0 -117
  617. package/node_modules/zod/v4/locales/fa.cjs +0 -148
  618. package/node_modules/zod/v4/locales/fa.d.cts +0 -4
  619. package/node_modules/zod/v4/locales/fa.d.ts +0 -4
  620. package/node_modules/zod/v4/locales/fa.js +0 -122
  621. package/node_modules/zod/v4/locales/fi.cjs +0 -148
  622. package/node_modules/zod/v4/locales/fi.d.cts +0 -4
  623. package/node_modules/zod/v4/locales/fi.d.ts +0 -4
  624. package/node_modules/zod/v4/locales/fi.js +0 -122
  625. package/node_modules/zod/v4/locales/fr-CA.cjs +0 -143
  626. package/node_modules/zod/v4/locales/fr-CA.d.cts +0 -4
  627. package/node_modules/zod/v4/locales/fr-CA.d.ts +0 -4
  628. package/node_modules/zod/v4/locales/fr-CA.js +0 -117
  629. package/node_modules/zod/v4/locales/fr.cjs +0 -142
  630. package/node_modules/zod/v4/locales/fr.d.cts +0 -4
  631. package/node_modules/zod/v4/locales/fr.d.ts +0 -4
  632. package/node_modules/zod/v4/locales/fr.js +0 -116
  633. package/node_modules/zod/v4/locales/he.cjs +0 -143
  634. package/node_modules/zod/v4/locales/he.d.cts +0 -4
  635. package/node_modules/zod/v4/locales/he.d.ts +0 -4
  636. package/node_modules/zod/v4/locales/he.js +0 -117
  637. package/node_modules/zod/v4/locales/hu.cjs +0 -143
  638. package/node_modules/zod/v4/locales/hu.d.cts +0 -4
  639. package/node_modules/zod/v4/locales/hu.d.ts +0 -4
  640. package/node_modules/zod/v4/locales/hu.js +0 -117
  641. package/node_modules/zod/v4/locales/id.cjs +0 -142
  642. package/node_modules/zod/v4/locales/id.d.cts +0 -4
  643. package/node_modules/zod/v4/locales/id.d.ts +0 -4
  644. package/node_modules/zod/v4/locales/id.js +0 -116
  645. package/node_modules/zod/v4/locales/index.cjs +0 -84
  646. package/node_modules/zod/v4/locales/index.d.cts +0 -39
  647. package/node_modules/zod/v4/locales/index.d.ts +0 -39
  648. package/node_modules/zod/v4/locales/index.js +0 -39
  649. package/node_modules/zod/v4/locales/it.cjs +0 -143
  650. package/node_modules/zod/v4/locales/it.d.cts +0 -4
  651. package/node_modules/zod/v4/locales/it.d.ts +0 -4
  652. package/node_modules/zod/v4/locales/it.js +0 -117
  653. package/node_modules/zod/v4/locales/ja.cjs +0 -141
  654. package/node_modules/zod/v4/locales/ja.d.cts +0 -4
  655. package/node_modules/zod/v4/locales/ja.d.ts +0 -4
  656. package/node_modules/zod/v4/locales/ja.js +0 -115
  657. package/node_modules/zod/v4/locales/kh.cjs +0 -143
  658. package/node_modules/zod/v4/locales/kh.d.cts +0 -4
  659. package/node_modules/zod/v4/locales/kh.d.ts +0 -4
  660. package/node_modules/zod/v4/locales/kh.js +0 -117
  661. package/node_modules/zod/v4/locales/ko.cjs +0 -147
  662. package/node_modules/zod/v4/locales/ko.d.cts +0 -4
  663. package/node_modules/zod/v4/locales/ko.d.ts +0 -4
  664. package/node_modules/zod/v4/locales/ko.js +0 -121
  665. package/node_modules/zod/v4/locales/mk.cjs +0 -144
  666. package/node_modules/zod/v4/locales/mk.d.cts +0 -4
  667. package/node_modules/zod/v4/locales/mk.d.ts +0 -4
  668. package/node_modules/zod/v4/locales/mk.js +0 -118
  669. package/node_modules/zod/v4/locales/ms.cjs +0 -142
  670. package/node_modules/zod/v4/locales/ms.d.cts +0 -4
  671. package/node_modules/zod/v4/locales/ms.d.ts +0 -4
  672. package/node_modules/zod/v4/locales/ms.js +0 -116
  673. package/node_modules/zod/v4/locales/nl.cjs +0 -143
  674. package/node_modules/zod/v4/locales/nl.d.cts +0 -4
  675. package/node_modules/zod/v4/locales/nl.d.ts +0 -4
  676. package/node_modules/zod/v4/locales/nl.js +0 -117
  677. package/node_modules/zod/v4/locales/no.cjs +0 -142
  678. package/node_modules/zod/v4/locales/no.d.cts +0 -4
  679. package/node_modules/zod/v4/locales/no.d.ts +0 -4
  680. package/node_modules/zod/v4/locales/no.js +0 -116
  681. package/node_modules/zod/v4/locales/ota.cjs +0 -143
  682. package/node_modules/zod/v4/locales/ota.d.cts +0 -4
  683. package/node_modules/zod/v4/locales/ota.d.ts +0 -4
  684. package/node_modules/zod/v4/locales/ota.js +0 -117
  685. package/node_modules/zod/v4/locales/pl.cjs +0 -143
  686. package/node_modules/zod/v4/locales/pl.d.cts +0 -4
  687. package/node_modules/zod/v4/locales/pl.d.ts +0 -4
  688. package/node_modules/zod/v4/locales/pl.js +0 -117
  689. package/node_modules/zod/v4/locales/ps.cjs +0 -148
  690. package/node_modules/zod/v4/locales/ps.d.cts +0 -4
  691. package/node_modules/zod/v4/locales/ps.d.ts +0 -4
  692. package/node_modules/zod/v4/locales/ps.js +0 -122
  693. package/node_modules/zod/v4/locales/pt.cjs +0 -142
  694. package/node_modules/zod/v4/locales/pt.d.cts +0 -4
  695. package/node_modules/zod/v4/locales/pt.d.ts +0 -4
  696. package/node_modules/zod/v4/locales/pt.js +0 -116
  697. package/node_modules/zod/v4/locales/ru.cjs +0 -190
  698. package/node_modules/zod/v4/locales/ru.d.cts +0 -4
  699. package/node_modules/zod/v4/locales/ru.d.ts +0 -4
  700. package/node_modules/zod/v4/locales/ru.js +0 -164
  701. package/node_modules/zod/v4/locales/sl.cjs +0 -143
  702. package/node_modules/zod/v4/locales/sl.d.cts +0 -4
  703. package/node_modules/zod/v4/locales/sl.d.ts +0 -4
  704. package/node_modules/zod/v4/locales/sl.js +0 -117
  705. package/node_modules/zod/v4/locales/sv.cjs +0 -144
  706. package/node_modules/zod/v4/locales/sv.d.cts +0 -4
  707. package/node_modules/zod/v4/locales/sv.d.ts +0 -4
  708. package/node_modules/zod/v4/locales/sv.js +0 -118
  709. package/node_modules/zod/v4/locales/ta.cjs +0 -143
  710. package/node_modules/zod/v4/locales/ta.d.cts +0 -4
  711. package/node_modules/zod/v4/locales/ta.d.ts +0 -4
  712. package/node_modules/zod/v4/locales/ta.js +0 -117
  713. package/node_modules/zod/v4/locales/th.cjs +0 -143
  714. package/node_modules/zod/v4/locales/th.d.cts +0 -4
  715. package/node_modules/zod/v4/locales/th.d.ts +0 -4
  716. package/node_modules/zod/v4/locales/th.js +0 -117
  717. package/node_modules/zod/v4/locales/tr.cjs +0 -143
  718. package/node_modules/zod/v4/locales/tr.d.cts +0 -5
  719. package/node_modules/zod/v4/locales/tr.d.ts +0 -5
  720. package/node_modules/zod/v4/locales/tr.js +0 -115
  721. package/node_modules/zod/v4/locales/ua.cjs +0 -143
  722. package/node_modules/zod/v4/locales/ua.d.cts +0 -4
  723. package/node_modules/zod/v4/locales/ua.d.ts +0 -4
  724. package/node_modules/zod/v4/locales/ua.js +0 -117
  725. package/node_modules/zod/v4/locales/ur.cjs +0 -143
  726. package/node_modules/zod/v4/locales/ur.d.cts +0 -4
  727. package/node_modules/zod/v4/locales/ur.d.ts +0 -4
  728. package/node_modules/zod/v4/locales/ur.js +0 -117
  729. package/node_modules/zod/v4/locales/vi.cjs +0 -142
  730. package/node_modules/zod/v4/locales/vi.d.cts +0 -4
  731. package/node_modules/zod/v4/locales/vi.d.ts +0 -4
  732. package/node_modules/zod/v4/locales/vi.js +0 -116
  733. package/node_modules/zod/v4/locales/zh-CN.cjs +0 -142
  734. package/node_modules/zod/v4/locales/zh-CN.d.cts +0 -4
  735. package/node_modules/zod/v4/locales/zh-CN.d.ts +0 -4
  736. package/node_modules/zod/v4/locales/zh-CN.js +0 -116
  737. package/node_modules/zod/v4/locales/zh-TW.cjs +0 -143
  738. package/node_modules/zod/v4/locales/zh-TW.d.cts +0 -4
  739. package/node_modules/zod/v4/locales/zh-TW.d.ts +0 -4
  740. package/node_modules/zod/v4/locales/zh-TW.js +0 -117
  741. package/node_modules/zod/v4/mini/checks.cjs +0 -34
  742. package/node_modules/zod/v4/mini/checks.d.cts +0 -1
  743. package/node_modules/zod/v4/mini/checks.d.ts +0 -1
  744. package/node_modules/zod/v4/mini/checks.js +0 -1
  745. package/node_modules/zod/v4/mini/coerce.cjs +0 -47
  746. package/node_modules/zod/v4/mini/coerce.d.cts +0 -7
  747. package/node_modules/zod/v4/mini/coerce.d.ts +0 -7
  748. package/node_modules/zod/v4/mini/coerce.js +0 -17
  749. package/node_modules/zod/v4/mini/external.cjs +0 -62
  750. package/node_modules/zod/v4/mini/external.d.cts +0 -11
  751. package/node_modules/zod/v4/mini/external.d.ts +0 -11
  752. package/node_modules/zod/v4/mini/external.js +0 -13
  753. package/node_modules/zod/v4/mini/index.cjs +0 -32
  754. package/node_modules/zod/v4/mini/index.d.cts +0 -3
  755. package/node_modules/zod/v4/mini/index.d.ts +0 -3
  756. package/node_modules/zod/v4/mini/index.js +0 -3
  757. package/node_modules/zod/v4/mini/iso.cjs +0 -60
  758. package/node_modules/zod/v4/mini/iso.d.cts +0 -22
  759. package/node_modules/zod/v4/mini/iso.d.ts +0 -22
  760. package/node_modules/zod/v4/mini/iso.js +0 -30
  761. package/node_modules/zod/v4/mini/parse.cjs +0 -8
  762. package/node_modules/zod/v4/mini/parse.d.cts +0 -1
  763. package/node_modules/zod/v4/mini/parse.d.ts +0 -1
  764. package/node_modules/zod/v4/mini/parse.js +0 -1
  765. package/node_modules/zod/v4/mini/schemas.cjs +0 -839
  766. package/node_modules/zod/v4/mini/schemas.d.cts +0 -356
  767. package/node_modules/zod/v4/mini/schemas.d.ts +0 -356
  768. package/node_modules/zod/v4/mini/schemas.js +0 -732
  769. package/node_modules/zod/v4-mini/index.cjs +0 -17
  770. package/node_modules/zod/v4-mini/index.d.cts +0 -1
  771. package/node_modules/zod/v4-mini/index.d.ts +0 -1
  772. package/node_modules/zod/v4-mini/index.js +0 -1
@@ -1,1717 +0,0 @@
1
- import * as checks from "./checks.js";
2
- import * as core from "./core.js";
3
- import { Doc } from "./doc.js";
4
- import { safeParse, safeParseAsync } from "./parse.js";
5
- import * as regexes from "./regexes.js";
6
- import * as util from "./util.js";
7
- import { version } from "./versions.js";
8
- export const $ZodType = /*@__PURE__*/ core.$constructor("$ZodType", (inst, def) => {
9
- var _a;
10
- inst ?? (inst = {});
11
- inst._zod.def = def; // set _def property
12
- inst._zod.bag = inst._zod.bag || {}; // initialize _bag object
13
- inst._zod.version = version;
14
- const checks = [...(inst._zod.def.checks ?? [])];
15
- // if inst is itself a checks.$ZodCheck, run it as a check
16
- if (inst._zod.traits.has("$ZodCheck")) {
17
- checks.unshift(inst);
18
- }
19
- //
20
- for (const ch of checks) {
21
- for (const fn of ch._zod.onattach) {
22
- fn(inst);
23
- }
24
- }
25
- if (checks.length === 0) {
26
- // deferred initializer
27
- // inst._zod.parse is not yet defined
28
- (_a = inst._zod).deferred ?? (_a.deferred = []);
29
- inst._zod.deferred?.push(() => {
30
- inst._zod.run = inst._zod.parse;
31
- });
32
- }
33
- else {
34
- const runChecks = (payload, checks, ctx) => {
35
- let isAborted = util.aborted(payload);
36
- let asyncResult;
37
- for (const ch of checks) {
38
- if (ch._zod.def.when) {
39
- const shouldRun = ch._zod.def.when(payload);
40
- if (!shouldRun)
41
- continue;
42
- }
43
- else if (isAborted) {
44
- continue;
45
- }
46
- const currLen = payload.issues.length;
47
- const _ = ch._zod.check(payload);
48
- if (_ instanceof Promise && ctx?.async === false) {
49
- throw new core.$ZodAsyncError();
50
- }
51
- if (asyncResult || _ instanceof Promise) {
52
- asyncResult = (asyncResult ?? Promise.resolve()).then(async () => {
53
- await _;
54
- const nextLen = payload.issues.length;
55
- if (nextLen === currLen)
56
- return;
57
- if (!isAborted)
58
- isAborted = util.aborted(payload, currLen);
59
- });
60
- }
61
- else {
62
- const nextLen = payload.issues.length;
63
- if (nextLen === currLen)
64
- continue;
65
- if (!isAborted)
66
- isAborted = util.aborted(payload, currLen);
67
- }
68
- }
69
- if (asyncResult) {
70
- return asyncResult.then(() => {
71
- return payload;
72
- });
73
- }
74
- return payload;
75
- };
76
- inst._zod.run = (payload, ctx) => {
77
- const result = inst._zod.parse(payload, ctx);
78
- if (result instanceof Promise) {
79
- if (ctx.async === false)
80
- throw new core.$ZodAsyncError();
81
- return result.then((result) => runChecks(result, checks, ctx));
82
- }
83
- return runChecks(result, checks, ctx);
84
- };
85
- }
86
- inst["~standard"] = {
87
- validate: (value) => {
88
- try {
89
- const r = safeParse(inst, value);
90
- return r.success ? { value: r.data } : { issues: r.error?.issues };
91
- }
92
- catch (_) {
93
- return safeParseAsync(inst, value).then((r) => (r.success ? { value: r.data } : { issues: r.error?.issues }));
94
- }
95
- },
96
- vendor: "zod",
97
- version: 1,
98
- };
99
- });
100
- export { clone } from "./util.js";
101
- export const $ZodString = /*@__PURE__*/ core.$constructor("$ZodString", (inst, def) => {
102
- $ZodType.init(inst, def);
103
- inst._zod.pattern = [...(inst?._zod.bag?.patterns ?? [])].pop() ?? regexes.string(inst._zod.bag);
104
- inst._zod.parse = (payload, _) => {
105
- if (def.coerce)
106
- try {
107
- payload.value = String(payload.value);
108
- }
109
- catch (_) { }
110
- if (typeof payload.value === "string")
111
- return payload;
112
- payload.issues.push({
113
- expected: "string",
114
- code: "invalid_type",
115
- input: payload.value,
116
- inst,
117
- });
118
- return payload;
119
- };
120
- });
121
- export const $ZodStringFormat = /*@__PURE__*/ core.$constructor("$ZodStringFormat", (inst, def) => {
122
- // check initialization must come first
123
- checks.$ZodCheckStringFormat.init(inst, def);
124
- $ZodString.init(inst, def);
125
- });
126
- export const $ZodGUID = /*@__PURE__*/ core.$constructor("$ZodGUID", (inst, def) => {
127
- def.pattern ?? (def.pattern = regexes.guid);
128
- $ZodStringFormat.init(inst, def);
129
- });
130
- export const $ZodUUID = /*@__PURE__*/ core.$constructor("$ZodUUID", (inst, def) => {
131
- if (def.version) {
132
- const versionMap = {
133
- v1: 1,
134
- v2: 2,
135
- v3: 3,
136
- v4: 4,
137
- v5: 5,
138
- v6: 6,
139
- v7: 7,
140
- v8: 8,
141
- };
142
- const v = versionMap[def.version];
143
- if (v === undefined)
144
- throw new Error(`Invalid UUID version: "${def.version}"`);
145
- def.pattern ?? (def.pattern = regexes.uuid(v));
146
- }
147
- else
148
- def.pattern ?? (def.pattern = regexes.uuid());
149
- $ZodStringFormat.init(inst, def);
150
- });
151
- export const $ZodEmail = /*@__PURE__*/ core.$constructor("$ZodEmail", (inst, def) => {
152
- def.pattern ?? (def.pattern = regexes.email);
153
- $ZodStringFormat.init(inst, def);
154
- });
155
- export const $ZodURL = /*@__PURE__*/ core.$constructor("$ZodURL", (inst, def) => {
156
- $ZodStringFormat.init(inst, def);
157
- inst._zod.check = (payload) => {
158
- try {
159
- const orig = payload.value;
160
- const url = new URL(orig);
161
- const href = url.href;
162
- if (def.hostname) {
163
- def.hostname.lastIndex = 0;
164
- if (!def.hostname.test(url.hostname)) {
165
- payload.issues.push({
166
- code: "invalid_format",
167
- format: "url",
168
- note: "Invalid hostname",
169
- pattern: regexes.hostname.source,
170
- input: payload.value,
171
- inst,
172
- continue: !def.abort,
173
- });
174
- }
175
- }
176
- if (def.protocol) {
177
- def.protocol.lastIndex = 0;
178
- if (!def.protocol.test(url.protocol.endsWith(":") ? url.protocol.slice(0, -1) : url.protocol)) {
179
- payload.issues.push({
180
- code: "invalid_format",
181
- format: "url",
182
- note: "Invalid protocol",
183
- pattern: def.protocol.source,
184
- input: payload.value,
185
- inst,
186
- continue: !def.abort,
187
- });
188
- }
189
- }
190
- // payload.value = url.href;
191
- if (!orig.endsWith("/") && href.endsWith("/")) {
192
- payload.value = href.slice(0, -1);
193
- }
194
- else {
195
- payload.value = href;
196
- }
197
- return;
198
- }
199
- catch (_) {
200
- payload.issues.push({
201
- code: "invalid_format",
202
- format: "url",
203
- input: payload.value,
204
- inst,
205
- continue: !def.abort,
206
- });
207
- }
208
- };
209
- });
210
- export const $ZodEmoji = /*@__PURE__*/ core.$constructor("$ZodEmoji", (inst, def) => {
211
- def.pattern ?? (def.pattern = regexes.emoji());
212
- $ZodStringFormat.init(inst, def);
213
- });
214
- export const $ZodNanoID = /*@__PURE__*/ core.$constructor("$ZodNanoID", (inst, def) => {
215
- def.pattern ?? (def.pattern = regexes.nanoid);
216
- $ZodStringFormat.init(inst, def);
217
- });
218
- export const $ZodCUID = /*@__PURE__*/ core.$constructor("$ZodCUID", (inst, def) => {
219
- def.pattern ?? (def.pattern = regexes.cuid);
220
- $ZodStringFormat.init(inst, def);
221
- });
222
- export const $ZodCUID2 = /*@__PURE__*/ core.$constructor("$ZodCUID2", (inst, def) => {
223
- def.pattern ?? (def.pattern = regexes.cuid2);
224
- $ZodStringFormat.init(inst, def);
225
- });
226
- export const $ZodULID = /*@__PURE__*/ core.$constructor("$ZodULID", (inst, def) => {
227
- def.pattern ?? (def.pattern = regexes.ulid);
228
- $ZodStringFormat.init(inst, def);
229
- });
230
- export const $ZodXID = /*@__PURE__*/ core.$constructor("$ZodXID", (inst, def) => {
231
- def.pattern ?? (def.pattern = regexes.xid);
232
- $ZodStringFormat.init(inst, def);
233
- });
234
- export const $ZodKSUID = /*@__PURE__*/ core.$constructor("$ZodKSUID", (inst, def) => {
235
- def.pattern ?? (def.pattern = regexes.ksuid);
236
- $ZodStringFormat.init(inst, def);
237
- });
238
- export const $ZodISODateTime = /*@__PURE__*/ core.$constructor("$ZodISODateTime", (inst, def) => {
239
- def.pattern ?? (def.pattern = regexes.datetime(def));
240
- $ZodStringFormat.init(inst, def);
241
- });
242
- export const $ZodISODate = /*@__PURE__*/ core.$constructor("$ZodISODate", (inst, def) => {
243
- def.pattern ?? (def.pattern = regexes.date);
244
- $ZodStringFormat.init(inst, def);
245
- });
246
- export const $ZodISOTime = /*@__PURE__*/ core.$constructor("$ZodISOTime", (inst, def) => {
247
- def.pattern ?? (def.pattern = regexes.time(def));
248
- $ZodStringFormat.init(inst, def);
249
- });
250
- export const $ZodISODuration = /*@__PURE__*/ core.$constructor("$ZodISODuration", (inst, def) => {
251
- def.pattern ?? (def.pattern = regexes.duration);
252
- $ZodStringFormat.init(inst, def);
253
- });
254
- export const $ZodIPv4 = /*@__PURE__*/ core.$constructor("$ZodIPv4", (inst, def) => {
255
- def.pattern ?? (def.pattern = regexes.ipv4);
256
- $ZodStringFormat.init(inst, def);
257
- inst._zod.onattach.push((inst) => {
258
- const bag = inst._zod.bag;
259
- bag.format = `ipv4`;
260
- });
261
- });
262
- export const $ZodIPv6 = /*@__PURE__*/ core.$constructor("$ZodIPv6", (inst, def) => {
263
- def.pattern ?? (def.pattern = regexes.ipv6);
264
- $ZodStringFormat.init(inst, def);
265
- inst._zod.onattach.push((inst) => {
266
- const bag = inst._zod.bag;
267
- bag.format = `ipv6`;
268
- });
269
- inst._zod.check = (payload) => {
270
- try {
271
- new URL(`http://[${payload.value}]`);
272
- // return;
273
- }
274
- catch {
275
- payload.issues.push({
276
- code: "invalid_format",
277
- format: "ipv6",
278
- input: payload.value,
279
- inst,
280
- continue: !def.abort,
281
- });
282
- }
283
- };
284
- });
285
- export const $ZodCIDRv4 = /*@__PURE__*/ core.$constructor("$ZodCIDRv4", (inst, def) => {
286
- def.pattern ?? (def.pattern = regexes.cidrv4);
287
- $ZodStringFormat.init(inst, def);
288
- });
289
- export const $ZodCIDRv6 = /*@__PURE__*/ core.$constructor("$ZodCIDRv6", (inst, def) => {
290
- def.pattern ?? (def.pattern = regexes.cidrv6); // not used for validation
291
- $ZodStringFormat.init(inst, def);
292
- inst._zod.check = (payload) => {
293
- const [address, prefix] = payload.value.split("/");
294
- try {
295
- if (!prefix)
296
- throw new Error();
297
- const prefixNum = Number(prefix);
298
- if (`${prefixNum}` !== prefix)
299
- throw new Error();
300
- if (prefixNum < 0 || prefixNum > 128)
301
- throw new Error();
302
- new URL(`http://[${address}]`);
303
- }
304
- catch {
305
- payload.issues.push({
306
- code: "invalid_format",
307
- format: "cidrv6",
308
- input: payload.value,
309
- inst,
310
- continue: !def.abort,
311
- });
312
- }
313
- };
314
- });
315
- ////////////////////////////// ZodBase64 //////////////////////////////
316
- export function isValidBase64(data) {
317
- if (data === "")
318
- return true;
319
- if (data.length % 4 !== 0)
320
- return false;
321
- try {
322
- atob(data);
323
- return true;
324
- }
325
- catch {
326
- return false;
327
- }
328
- }
329
- export const $ZodBase64 = /*@__PURE__*/ core.$constructor("$ZodBase64", (inst, def) => {
330
- def.pattern ?? (def.pattern = regexes.base64);
331
- $ZodStringFormat.init(inst, def);
332
- inst._zod.onattach.push((inst) => {
333
- inst._zod.bag.contentEncoding = "base64";
334
- });
335
- inst._zod.check = (payload) => {
336
- if (isValidBase64(payload.value))
337
- return;
338
- payload.issues.push({
339
- code: "invalid_format",
340
- format: "base64",
341
- input: payload.value,
342
- inst,
343
- continue: !def.abort,
344
- });
345
- };
346
- });
347
- ////////////////////////////// ZodBase64 //////////////////////////////
348
- export function isValidBase64URL(data) {
349
- if (!regexes.base64url.test(data))
350
- return false;
351
- const base64 = data.replace(/[-_]/g, (c) => (c === "-" ? "+" : "/"));
352
- const padded = base64.padEnd(Math.ceil(base64.length / 4) * 4, "=");
353
- return isValidBase64(padded);
354
- }
355
- export const $ZodBase64URL = /*@__PURE__*/ core.$constructor("$ZodBase64URL", (inst, def) => {
356
- def.pattern ?? (def.pattern = regexes.base64url);
357
- $ZodStringFormat.init(inst, def);
358
- inst._zod.onattach.push((inst) => {
359
- inst._zod.bag.contentEncoding = "base64url";
360
- });
361
- inst._zod.check = (payload) => {
362
- if (isValidBase64URL(payload.value))
363
- return;
364
- payload.issues.push({
365
- code: "invalid_format",
366
- format: "base64url",
367
- input: payload.value,
368
- inst,
369
- continue: !def.abort,
370
- });
371
- };
372
- });
373
- export const $ZodE164 = /*@__PURE__*/ core.$constructor("$ZodE164", (inst, def) => {
374
- def.pattern ?? (def.pattern = regexes.e164);
375
- $ZodStringFormat.init(inst, def);
376
- });
377
- ////////////////////////////// ZodJWT //////////////////////////////
378
- export function isValidJWT(token, algorithm = null) {
379
- try {
380
- const tokensParts = token.split(".");
381
- if (tokensParts.length !== 3)
382
- return false;
383
- const [header] = tokensParts;
384
- if (!header)
385
- return false;
386
- const parsedHeader = JSON.parse(atob(header));
387
- if ("typ" in parsedHeader && parsedHeader?.typ !== "JWT")
388
- return false;
389
- if (!parsedHeader.alg)
390
- return false;
391
- if (algorithm && (!("alg" in parsedHeader) || parsedHeader.alg !== algorithm))
392
- return false;
393
- return true;
394
- }
395
- catch {
396
- return false;
397
- }
398
- }
399
- export const $ZodJWT = /*@__PURE__*/ core.$constructor("$ZodJWT", (inst, def) => {
400
- $ZodStringFormat.init(inst, def);
401
- inst._zod.check = (payload) => {
402
- if (isValidJWT(payload.value, def.alg))
403
- return;
404
- payload.issues.push({
405
- code: "invalid_format",
406
- format: "jwt",
407
- input: payload.value,
408
- inst,
409
- continue: !def.abort,
410
- });
411
- };
412
- });
413
- export const $ZodCustomStringFormat = /*@__PURE__*/ core.$constructor("$ZodCustomStringFormat", (inst, def) => {
414
- $ZodStringFormat.init(inst, def);
415
- inst._zod.check = (payload) => {
416
- if (def.fn(payload.value))
417
- return;
418
- payload.issues.push({
419
- code: "invalid_format",
420
- format: def.format,
421
- input: payload.value,
422
- inst,
423
- continue: !def.abort,
424
- });
425
- };
426
- });
427
- export const $ZodNumber = /*@__PURE__*/ core.$constructor("$ZodNumber", (inst, def) => {
428
- $ZodType.init(inst, def);
429
- inst._zod.pattern = inst._zod.bag.pattern ?? regexes.number;
430
- inst._zod.parse = (payload, _ctx) => {
431
- if (def.coerce)
432
- try {
433
- payload.value = Number(payload.value);
434
- }
435
- catch (_) { }
436
- const input = payload.value;
437
- if (typeof input === "number" && !Number.isNaN(input) && Number.isFinite(input)) {
438
- return payload;
439
- }
440
- const received = typeof input === "number"
441
- ? Number.isNaN(input)
442
- ? "NaN"
443
- : !Number.isFinite(input)
444
- ? "Infinity"
445
- : undefined
446
- : undefined;
447
- payload.issues.push({
448
- expected: "number",
449
- code: "invalid_type",
450
- input,
451
- inst,
452
- ...(received ? { received } : {}),
453
- });
454
- return payload;
455
- };
456
- });
457
- export const $ZodNumberFormat = /*@__PURE__*/ core.$constructor("$ZodNumber", (inst, def) => {
458
- checks.$ZodCheckNumberFormat.init(inst, def);
459
- $ZodNumber.init(inst, def); // no format checksp
460
- });
461
- export const $ZodBoolean = /*@__PURE__*/ core.$constructor("$ZodBoolean", (inst, def) => {
462
- $ZodType.init(inst, def);
463
- inst._zod.pattern = regexes.boolean;
464
- inst._zod.parse = (payload, _ctx) => {
465
- if (def.coerce)
466
- try {
467
- payload.value = Boolean(payload.value);
468
- }
469
- catch (_) { }
470
- const input = payload.value;
471
- if (typeof input === "boolean")
472
- return payload;
473
- payload.issues.push({
474
- expected: "boolean",
475
- code: "invalid_type",
476
- input,
477
- inst,
478
- });
479
- return payload;
480
- };
481
- });
482
- export const $ZodBigInt = /*@__PURE__*/ core.$constructor("$ZodBigInt", (inst, def) => {
483
- $ZodType.init(inst, def);
484
- inst._zod.pattern = regexes.bigint;
485
- inst._zod.parse = (payload, _ctx) => {
486
- if (def.coerce)
487
- try {
488
- payload.value = BigInt(payload.value);
489
- }
490
- catch (_) { }
491
- if (typeof payload.value === "bigint")
492
- return payload;
493
- payload.issues.push({
494
- expected: "bigint",
495
- code: "invalid_type",
496
- input: payload.value,
497
- inst,
498
- });
499
- return payload;
500
- };
501
- });
502
- export const $ZodBigIntFormat = /*@__PURE__*/ core.$constructor("$ZodBigInt", (inst, def) => {
503
- checks.$ZodCheckBigIntFormat.init(inst, def);
504
- $ZodBigInt.init(inst, def); // no format checks
505
- });
506
- export const $ZodSymbol = /*@__PURE__*/ core.$constructor("$ZodSymbol", (inst, def) => {
507
- $ZodType.init(inst, def);
508
- inst._zod.parse = (payload, _ctx) => {
509
- const input = payload.value;
510
- if (typeof input === "symbol")
511
- return payload;
512
- payload.issues.push({
513
- expected: "symbol",
514
- code: "invalid_type",
515
- input,
516
- inst,
517
- });
518
- return payload;
519
- };
520
- });
521
- export const $ZodUndefined = /*@__PURE__*/ core.$constructor("$ZodUndefined", (inst, def) => {
522
- $ZodType.init(inst, def);
523
- inst._zod.pattern = regexes.undefined;
524
- inst._zod.values = new Set([undefined]);
525
- inst._zod.optin = "optional";
526
- inst._zod.optout = "optional";
527
- inst._zod.parse = (payload, _ctx) => {
528
- const input = payload.value;
529
- if (typeof input === "undefined")
530
- return payload;
531
- payload.issues.push({
532
- expected: "undefined",
533
- code: "invalid_type",
534
- input,
535
- inst,
536
- });
537
- return payload;
538
- };
539
- });
540
- export const $ZodNull = /*@__PURE__*/ core.$constructor("$ZodNull", (inst, def) => {
541
- $ZodType.init(inst, def);
542
- inst._zod.pattern = regexes.null;
543
- inst._zod.values = new Set([null]);
544
- inst._zod.parse = (payload, _ctx) => {
545
- const input = payload.value;
546
- if (input === null)
547
- return payload;
548
- payload.issues.push({
549
- expected: "null",
550
- code: "invalid_type",
551
- input,
552
- inst,
553
- });
554
- return payload;
555
- };
556
- });
557
- export const $ZodAny = /*@__PURE__*/ core.$constructor("$ZodAny", (inst, def) => {
558
- $ZodType.init(inst, def);
559
- inst._zod.parse = (payload) => payload;
560
- });
561
- export const $ZodUnknown = /*@__PURE__*/ core.$constructor("$ZodUnknown", (inst, def) => {
562
- $ZodType.init(inst, def);
563
- inst._zod.parse = (payload) => payload;
564
- });
565
- export const $ZodNever = /*@__PURE__*/ core.$constructor("$ZodNever", (inst, def) => {
566
- $ZodType.init(inst, def);
567
- inst._zod.parse = (payload, _ctx) => {
568
- payload.issues.push({
569
- expected: "never",
570
- code: "invalid_type",
571
- input: payload.value,
572
- inst,
573
- });
574
- return payload;
575
- };
576
- });
577
- export const $ZodVoid = /*@__PURE__*/ core.$constructor("$ZodVoid", (inst, def) => {
578
- $ZodType.init(inst, def);
579
- inst._zod.parse = (payload, _ctx) => {
580
- const input = payload.value;
581
- if (typeof input === "undefined")
582
- return payload;
583
- payload.issues.push({
584
- expected: "void",
585
- code: "invalid_type",
586
- input,
587
- inst,
588
- });
589
- return payload;
590
- };
591
- });
592
- export const $ZodDate = /*@__PURE__*/ core.$constructor("$ZodDate", (inst, def) => {
593
- $ZodType.init(inst, def);
594
- inst._zod.parse = (payload, _ctx) => {
595
- if (def.coerce) {
596
- try {
597
- payload.value = new Date(payload.value);
598
- }
599
- catch (_err) { }
600
- }
601
- const input = payload.value;
602
- const isDate = input instanceof Date;
603
- const isValidDate = isDate && !Number.isNaN(input.getTime());
604
- if (isValidDate)
605
- return payload;
606
- payload.issues.push({
607
- expected: "date",
608
- code: "invalid_type",
609
- input,
610
- ...(isDate ? { received: "Invalid Date" } : {}),
611
- inst,
612
- });
613
- return payload;
614
- };
615
- });
616
- function handleArrayResult(result, final, index) {
617
- if (result.issues.length) {
618
- final.issues.push(...util.prefixIssues(index, result.issues));
619
- }
620
- final.value[index] = result.value;
621
- }
622
- export const $ZodArray = /*@__PURE__*/ core.$constructor("$ZodArray", (inst, def) => {
623
- $ZodType.init(inst, def);
624
- inst._zod.parse = (payload, ctx) => {
625
- const input = payload.value;
626
- if (!Array.isArray(input)) {
627
- payload.issues.push({
628
- expected: "array",
629
- code: "invalid_type",
630
- input,
631
- inst,
632
- });
633
- return payload;
634
- }
635
- payload.value = Array(input.length);
636
- const proms = [];
637
- for (let i = 0; i < input.length; i++) {
638
- const item = input[i];
639
- const result = def.element._zod.run({
640
- value: item,
641
- issues: [],
642
- }, ctx);
643
- if (result instanceof Promise) {
644
- proms.push(result.then((result) => handleArrayResult(result, payload, i)));
645
- }
646
- else {
647
- handleArrayResult(result, payload, i);
648
- }
649
- }
650
- if (proms.length) {
651
- return Promise.all(proms).then(() => payload);
652
- }
653
- return payload; //handleArrayResultsAsync(parseResults, final);
654
- };
655
- });
656
- function handleObjectResult(result, final, key) {
657
- // if(isOptional)
658
- if (result.issues.length) {
659
- final.issues.push(...util.prefixIssues(key, result.issues));
660
- }
661
- final.value[key] = result.value;
662
- }
663
- function handleOptionalObjectResult(result, final, key, input) {
664
- if (result.issues.length) {
665
- // validation failed against value schema
666
- if (input[key] === undefined) {
667
- // if input was undefined, ignore the error
668
- if (key in input) {
669
- final.value[key] = undefined;
670
- }
671
- else {
672
- final.value[key] = result.value;
673
- }
674
- }
675
- else {
676
- final.issues.push(...util.prefixIssues(key, result.issues));
677
- }
678
- }
679
- else if (result.value === undefined) {
680
- // validation returned `undefined`
681
- if (key in input)
682
- final.value[key] = undefined;
683
- }
684
- else {
685
- // non-undefined value
686
- final.value[key] = result.value;
687
- }
688
- }
689
- export const $ZodObject = /*@__PURE__*/ core.$constructor("$ZodObject", (inst, def) => {
690
- // requires cast because technically $ZodObject doesn't extend
691
- $ZodType.init(inst, def);
692
- const _normalized = util.cached(() => {
693
- const keys = Object.keys(def.shape);
694
- for (const k of keys) {
695
- if (!(def.shape[k] instanceof $ZodType)) {
696
- throw new Error(`Invalid element at key "${k}": expected a Zod schema`);
697
- }
698
- }
699
- const okeys = util.optionalKeys(def.shape);
700
- return {
701
- shape: def.shape,
702
- keys,
703
- keySet: new Set(keys),
704
- numKeys: keys.length,
705
- optionalKeys: new Set(okeys),
706
- };
707
- });
708
- util.defineLazy(inst._zod, "propValues", () => {
709
- const shape = def.shape;
710
- const propValues = {};
711
- for (const key in shape) {
712
- const field = shape[key]._zod;
713
- if (field.values) {
714
- propValues[key] ?? (propValues[key] = new Set());
715
- for (const v of field.values)
716
- propValues[key].add(v);
717
- }
718
- }
719
- return propValues;
720
- });
721
- const generateFastpass = (shape) => {
722
- const doc = new Doc(["shape", "payload", "ctx"]);
723
- const normalized = _normalized.value;
724
- const parseStr = (key) => {
725
- const k = util.esc(key);
726
- return `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
727
- };
728
- doc.write(`const input = payload.value;`);
729
- const ids = Object.create(null);
730
- let counter = 0;
731
- for (const key of normalized.keys) {
732
- ids[key] = `key_${counter++}`;
733
- }
734
- // A: preserve key order {
735
- doc.write(`const newResult = {}`);
736
- for (const key of normalized.keys) {
737
- if (normalized.optionalKeys.has(key)) {
738
- const id = ids[key];
739
- doc.write(`const ${id} = ${parseStr(key)};`);
740
- const k = util.esc(key);
741
- doc.write(`
742
- if (${id}.issues.length) {
743
- if (input[${k}] === undefined) {
744
- if (${k} in input) {
745
- newResult[${k}] = undefined;
746
- }
747
- } else {
748
- payload.issues = payload.issues.concat(
749
- ${id}.issues.map((iss) => ({
750
- ...iss,
751
- path: iss.path ? [${k}, ...iss.path] : [${k}],
752
- }))
753
- );
754
- }
755
- } else if (${id}.value === undefined) {
756
- if (${k} in input) newResult[${k}] = undefined;
757
- } else {
758
- newResult[${k}] = ${id}.value;
759
- }
760
- `);
761
- }
762
- else {
763
- const id = ids[key];
764
- // const id = ids[key];
765
- doc.write(`const ${id} = ${parseStr(key)};`);
766
- doc.write(`
767
- if (${id}.issues.length) payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
768
- ...iss,
769
- path: iss.path ? [${util.esc(key)}, ...iss.path] : [${util.esc(key)}]
770
- })));`);
771
- doc.write(`newResult[${util.esc(key)}] = ${id}.value`);
772
- }
773
- }
774
- doc.write(`payload.value = newResult;`);
775
- doc.write(`return payload;`);
776
- const fn = doc.compile();
777
- return (payload, ctx) => fn(shape, payload, ctx);
778
- };
779
- let fastpass;
780
- const isObject = util.isObject;
781
- const jit = !core.globalConfig.jitless;
782
- const allowsEval = util.allowsEval;
783
- const fastEnabled = jit && allowsEval.value; // && !def.catchall;
784
- const catchall = def.catchall;
785
- let value;
786
- inst._zod.parse = (payload, ctx) => {
787
- value ?? (value = _normalized.value);
788
- const input = payload.value;
789
- if (!isObject(input)) {
790
- payload.issues.push({
791
- expected: "object",
792
- code: "invalid_type",
793
- input,
794
- inst,
795
- });
796
- return payload;
797
- }
798
- const proms = [];
799
- if (jit && fastEnabled && ctx?.async === false && ctx.jitless !== true) {
800
- // always synchronous
801
- if (!fastpass)
802
- fastpass = generateFastpass(def.shape);
803
- payload = fastpass(payload, ctx);
804
- }
805
- else {
806
- payload.value = {};
807
- const shape = value.shape;
808
- for (const key of value.keys) {
809
- const el = shape[key];
810
- // do not add omitted optional keys
811
- // if (!(key in input)) {
812
- // if (optionalKeys.has(key)) continue;
813
- // payload.issues.push({
814
- // code: "invalid_type",
815
- // path: [key],
816
- // expected: "nonoptional",
817
- // note: `Missing required key: "${key}"`,
818
- // input,
819
- // inst,
820
- // });
821
- // }
822
- const r = el._zod.run({ value: input[key], issues: [] }, ctx);
823
- const isOptional = el._zod.optin === "optional" && el._zod.optout === "optional";
824
- if (r instanceof Promise) {
825
- proms.push(r.then((r) => isOptional ? handleOptionalObjectResult(r, payload, key, input) : handleObjectResult(r, payload, key)));
826
- }
827
- else if (isOptional) {
828
- handleOptionalObjectResult(r, payload, key, input);
829
- }
830
- else {
831
- handleObjectResult(r, payload, key);
832
- }
833
- }
834
- }
835
- if (!catchall) {
836
- // return payload;
837
- return proms.length ? Promise.all(proms).then(() => payload) : payload;
838
- }
839
- const unrecognized = [];
840
- // iterate over input keys
841
- const keySet = value.keySet;
842
- const _catchall = catchall._zod;
843
- const t = _catchall.def.type;
844
- for (const key of Object.keys(input)) {
845
- if (keySet.has(key))
846
- continue;
847
- if (t === "never") {
848
- unrecognized.push(key);
849
- continue;
850
- }
851
- const r = _catchall.run({ value: input[key], issues: [] }, ctx);
852
- if (r instanceof Promise) {
853
- proms.push(r.then((r) => handleObjectResult(r, payload, key)));
854
- }
855
- else {
856
- handleObjectResult(r, payload, key);
857
- }
858
- }
859
- if (unrecognized.length) {
860
- payload.issues.push({
861
- code: "unrecognized_keys",
862
- keys: unrecognized,
863
- input,
864
- inst,
865
- });
866
- }
867
- if (!proms.length)
868
- return payload;
869
- return Promise.all(proms).then(() => {
870
- return payload;
871
- });
872
- };
873
- });
874
- function handleUnionResults(results, final, inst, ctx) {
875
- for (const result of results) {
876
- if (result.issues.length === 0) {
877
- final.value = result.value;
878
- return final;
879
- }
880
- }
881
- final.issues.push({
882
- code: "invalid_union",
883
- input: final.value,
884
- inst,
885
- errors: results.map((result) => result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config()))),
886
- });
887
- return final;
888
- }
889
- export const $ZodUnion = /*@__PURE__*/ core.$constructor("$ZodUnion", (inst, def) => {
890
- $ZodType.init(inst, def);
891
- util.defineLazy(inst._zod, "optin", () => def.options.some((o) => o._zod.optin === "optional") ? "optional" : undefined);
892
- util.defineLazy(inst._zod, "optout", () => def.options.some((o) => o._zod.optout === "optional") ? "optional" : undefined);
893
- util.defineLazy(inst._zod, "values", () => {
894
- if (def.options.every((o) => o._zod.values)) {
895
- return new Set(def.options.flatMap((option) => Array.from(option._zod.values)));
896
- }
897
- return undefined;
898
- });
899
- util.defineLazy(inst._zod, "pattern", () => {
900
- if (def.options.every((o) => o._zod.pattern)) {
901
- const patterns = def.options.map((o) => o._zod.pattern);
902
- return new RegExp(`^(${patterns.map((p) => util.cleanRegex(p.source)).join("|")})$`);
903
- }
904
- return undefined;
905
- });
906
- inst._zod.parse = (payload, ctx) => {
907
- let async = false;
908
- const results = [];
909
- for (const option of def.options) {
910
- const result = option._zod.run({
911
- value: payload.value,
912
- issues: [],
913
- }, ctx);
914
- if (result instanceof Promise) {
915
- results.push(result);
916
- async = true;
917
- }
918
- else {
919
- if (result.issues.length === 0)
920
- return result;
921
- results.push(result);
922
- }
923
- }
924
- if (!async)
925
- return handleUnionResults(results, payload, inst, ctx);
926
- return Promise.all(results).then((results) => {
927
- return handleUnionResults(results, payload, inst, ctx);
928
- });
929
- };
930
- });
931
- export const $ZodDiscriminatedUnion =
932
- /*@__PURE__*/
933
- core.$constructor("$ZodDiscriminatedUnion", (inst, def) => {
934
- $ZodUnion.init(inst, def);
935
- const _super = inst._zod.parse;
936
- util.defineLazy(inst._zod, "propValues", () => {
937
- const propValues = {};
938
- for (const option of def.options) {
939
- const pv = option._zod.propValues;
940
- if (!pv || Object.keys(pv).length === 0)
941
- throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(option)}"`);
942
- for (const [k, v] of Object.entries(pv)) {
943
- if (!propValues[k])
944
- propValues[k] = new Set();
945
- for (const val of v) {
946
- propValues[k].add(val);
947
- }
948
- }
949
- }
950
- return propValues;
951
- });
952
- const disc = util.cached(() => {
953
- const opts = def.options;
954
- const map = new Map();
955
- for (const o of opts) {
956
- const values = o._zod.propValues[def.discriminator];
957
- if (!values || values.size === 0)
958
- throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(o)}"`);
959
- for (const v of values) {
960
- if (map.has(v)) {
961
- throw new Error(`Duplicate discriminator value "${String(v)}"`);
962
- }
963
- map.set(v, o);
964
- }
965
- }
966
- return map;
967
- });
968
- inst._zod.parse = (payload, ctx) => {
969
- const input = payload.value;
970
- if (!util.isObject(input)) {
971
- payload.issues.push({
972
- code: "invalid_type",
973
- expected: "object",
974
- input,
975
- inst,
976
- });
977
- return payload;
978
- }
979
- const opt = disc.value.get(input?.[def.discriminator]);
980
- if (opt) {
981
- return opt._zod.run(payload, ctx);
982
- }
983
- if (def.unionFallback) {
984
- return _super(payload, ctx);
985
- }
986
- // no matching discriminator
987
- payload.issues.push({
988
- code: "invalid_union",
989
- errors: [],
990
- note: "No matching discriminator",
991
- input,
992
- path: [def.discriminator],
993
- inst,
994
- });
995
- return payload;
996
- };
997
- });
998
- export const $ZodIntersection = /*@__PURE__*/ core.$constructor("$ZodIntersection", (inst, def) => {
999
- $ZodType.init(inst, def);
1000
- inst._zod.parse = (payload, ctx) => {
1001
- const input = payload.value;
1002
- const left = def.left._zod.run({ value: input, issues: [] }, ctx);
1003
- const right = def.right._zod.run({ value: input, issues: [] }, ctx);
1004
- const async = left instanceof Promise || right instanceof Promise;
1005
- if (async) {
1006
- return Promise.all([left, right]).then(([left, right]) => {
1007
- return handleIntersectionResults(payload, left, right);
1008
- });
1009
- }
1010
- return handleIntersectionResults(payload, left, right);
1011
- };
1012
- });
1013
- function mergeValues(a, b) {
1014
- // const aType = parse.t(a);
1015
- // const bType = parse.t(b);
1016
- if (a === b) {
1017
- return { valid: true, data: a };
1018
- }
1019
- if (a instanceof Date && b instanceof Date && +a === +b) {
1020
- return { valid: true, data: a };
1021
- }
1022
- if (util.isPlainObject(a) && util.isPlainObject(b)) {
1023
- const bKeys = Object.keys(b);
1024
- const sharedKeys = Object.keys(a).filter((key) => bKeys.indexOf(key) !== -1);
1025
- const newObj = { ...a, ...b };
1026
- for (const key of sharedKeys) {
1027
- const sharedValue = mergeValues(a[key], b[key]);
1028
- if (!sharedValue.valid) {
1029
- return {
1030
- valid: false,
1031
- mergeErrorPath: [key, ...sharedValue.mergeErrorPath],
1032
- };
1033
- }
1034
- newObj[key] = sharedValue.data;
1035
- }
1036
- return { valid: true, data: newObj };
1037
- }
1038
- if (Array.isArray(a) && Array.isArray(b)) {
1039
- if (a.length !== b.length) {
1040
- return { valid: false, mergeErrorPath: [] };
1041
- }
1042
- const newArray = [];
1043
- for (let index = 0; index < a.length; index++) {
1044
- const itemA = a[index];
1045
- const itemB = b[index];
1046
- const sharedValue = mergeValues(itemA, itemB);
1047
- if (!sharedValue.valid) {
1048
- return {
1049
- valid: false,
1050
- mergeErrorPath: [index, ...sharedValue.mergeErrorPath],
1051
- };
1052
- }
1053
- newArray.push(sharedValue.data);
1054
- }
1055
- return { valid: true, data: newArray };
1056
- }
1057
- return { valid: false, mergeErrorPath: [] };
1058
- }
1059
- function handleIntersectionResults(result, left, right) {
1060
- if (left.issues.length) {
1061
- result.issues.push(...left.issues);
1062
- }
1063
- if (right.issues.length) {
1064
- result.issues.push(...right.issues);
1065
- }
1066
- if (util.aborted(result))
1067
- return result;
1068
- const merged = mergeValues(left.value, right.value);
1069
- if (!merged.valid) {
1070
- throw new Error(`Unmergable intersection. Error path: ` + `${JSON.stringify(merged.mergeErrorPath)}`);
1071
- }
1072
- result.value = merged.data;
1073
- return result;
1074
- }
1075
- export const $ZodTuple = /*@__PURE__*/ core.$constructor("$ZodTuple", (inst, def) => {
1076
- $ZodType.init(inst, def);
1077
- const items = def.items;
1078
- const optStart = items.length - [...items].reverse().findIndex((item) => item._zod.optin !== "optional");
1079
- inst._zod.parse = (payload, ctx) => {
1080
- const input = payload.value;
1081
- if (!Array.isArray(input)) {
1082
- payload.issues.push({
1083
- input,
1084
- inst,
1085
- expected: "tuple",
1086
- code: "invalid_type",
1087
- });
1088
- return payload;
1089
- }
1090
- payload.value = [];
1091
- const proms = [];
1092
- if (!def.rest) {
1093
- const tooBig = input.length > items.length;
1094
- const tooSmall = input.length < optStart - 1;
1095
- if (tooBig || tooSmall) {
1096
- payload.issues.push({
1097
- input,
1098
- inst,
1099
- origin: "array",
1100
- ...(tooBig ? { code: "too_big", maximum: items.length } : { code: "too_small", minimum: items.length }),
1101
- });
1102
- return payload;
1103
- }
1104
- }
1105
- let i = -1;
1106
- for (const item of items) {
1107
- i++;
1108
- if (i >= input.length)
1109
- if (i >= optStart)
1110
- continue;
1111
- const result = item._zod.run({
1112
- value: input[i],
1113
- issues: [],
1114
- }, ctx);
1115
- if (result instanceof Promise) {
1116
- proms.push(result.then((result) => handleTupleResult(result, payload, i)));
1117
- }
1118
- else {
1119
- handleTupleResult(result, payload, i);
1120
- }
1121
- }
1122
- if (def.rest) {
1123
- const rest = input.slice(items.length);
1124
- for (const el of rest) {
1125
- i++;
1126
- const result = def.rest._zod.run({
1127
- value: el,
1128
- issues: [],
1129
- }, ctx);
1130
- if (result instanceof Promise) {
1131
- proms.push(result.then((result) => handleTupleResult(result, payload, i)));
1132
- }
1133
- else {
1134
- handleTupleResult(result, payload, i);
1135
- }
1136
- }
1137
- }
1138
- if (proms.length)
1139
- return Promise.all(proms).then(() => payload);
1140
- return payload;
1141
- };
1142
- });
1143
- function handleTupleResult(result, final, index) {
1144
- if (result.issues.length) {
1145
- final.issues.push(...util.prefixIssues(index, result.issues));
1146
- }
1147
- final.value[index] = result.value;
1148
- }
1149
- export const $ZodRecord = /*@__PURE__*/ core.$constructor("$ZodRecord", (inst, def) => {
1150
- $ZodType.init(inst, def);
1151
- inst._zod.parse = (payload, ctx) => {
1152
- const input = payload.value;
1153
- if (!util.isPlainObject(input)) {
1154
- payload.issues.push({
1155
- expected: "record",
1156
- code: "invalid_type",
1157
- input,
1158
- inst,
1159
- });
1160
- return payload;
1161
- }
1162
- const proms = [];
1163
- if (def.keyType._zod.values) {
1164
- const values = def.keyType._zod.values;
1165
- payload.value = {};
1166
- for (const key of values) {
1167
- if (typeof key === "string" || typeof key === "number" || typeof key === "symbol") {
1168
- const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);
1169
- if (result instanceof Promise) {
1170
- proms.push(result.then((result) => {
1171
- if (result.issues.length) {
1172
- payload.issues.push(...util.prefixIssues(key, result.issues));
1173
- }
1174
- payload.value[key] = result.value;
1175
- }));
1176
- }
1177
- else {
1178
- if (result.issues.length) {
1179
- payload.issues.push(...util.prefixIssues(key, result.issues));
1180
- }
1181
- payload.value[key] = result.value;
1182
- }
1183
- }
1184
- }
1185
- let unrecognized;
1186
- for (const key in input) {
1187
- if (!values.has(key)) {
1188
- unrecognized = unrecognized ?? [];
1189
- unrecognized.push(key);
1190
- }
1191
- }
1192
- if (unrecognized && unrecognized.length > 0) {
1193
- payload.issues.push({
1194
- code: "unrecognized_keys",
1195
- input,
1196
- inst,
1197
- keys: unrecognized,
1198
- });
1199
- }
1200
- }
1201
- else {
1202
- payload.value = {};
1203
- for (const key of Reflect.ownKeys(input)) {
1204
- if (key === "__proto__")
1205
- continue;
1206
- const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
1207
- if (keyResult instanceof Promise) {
1208
- throw new Error("Async schemas not supported in object keys currently");
1209
- }
1210
- if (keyResult.issues.length) {
1211
- payload.issues.push({
1212
- origin: "record",
1213
- code: "invalid_key",
1214
- issues: keyResult.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),
1215
- input: key,
1216
- path: [key],
1217
- inst,
1218
- });
1219
- payload.value[keyResult.value] = keyResult.value;
1220
- continue;
1221
- }
1222
- const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);
1223
- if (result instanceof Promise) {
1224
- proms.push(result.then((result) => {
1225
- if (result.issues.length) {
1226
- payload.issues.push(...util.prefixIssues(key, result.issues));
1227
- }
1228
- payload.value[keyResult.value] = result.value;
1229
- }));
1230
- }
1231
- else {
1232
- if (result.issues.length) {
1233
- payload.issues.push(...util.prefixIssues(key, result.issues));
1234
- }
1235
- payload.value[keyResult.value] = result.value;
1236
- }
1237
- }
1238
- }
1239
- if (proms.length) {
1240
- return Promise.all(proms).then(() => payload);
1241
- }
1242
- return payload;
1243
- };
1244
- });
1245
- export const $ZodMap = /*@__PURE__*/ core.$constructor("$ZodMap", (inst, def) => {
1246
- $ZodType.init(inst, def);
1247
- inst._zod.parse = (payload, ctx) => {
1248
- const input = payload.value;
1249
- if (!(input instanceof Map)) {
1250
- payload.issues.push({
1251
- expected: "map",
1252
- code: "invalid_type",
1253
- input,
1254
- inst,
1255
- });
1256
- return payload;
1257
- }
1258
- const proms = [];
1259
- payload.value = new Map();
1260
- for (const [key, value] of input) {
1261
- const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
1262
- const valueResult = def.valueType._zod.run({ value: value, issues: [] }, ctx);
1263
- if (keyResult instanceof Promise || valueResult instanceof Promise) {
1264
- proms.push(Promise.all([keyResult, valueResult]).then(([keyResult, valueResult]) => {
1265
- handleMapResult(keyResult, valueResult, payload, key, input, inst, ctx);
1266
- }));
1267
- }
1268
- else {
1269
- handleMapResult(keyResult, valueResult, payload, key, input, inst, ctx);
1270
- }
1271
- }
1272
- if (proms.length)
1273
- return Promise.all(proms).then(() => payload);
1274
- return payload;
1275
- };
1276
- });
1277
- function handleMapResult(keyResult, valueResult, final, key, input, inst, ctx) {
1278
- if (keyResult.issues.length) {
1279
- if (util.propertyKeyTypes.has(typeof key)) {
1280
- final.issues.push(...util.prefixIssues(key, keyResult.issues));
1281
- }
1282
- else {
1283
- final.issues.push({
1284
- origin: "map",
1285
- code: "invalid_key",
1286
- input,
1287
- inst,
1288
- issues: keyResult.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),
1289
- });
1290
- }
1291
- }
1292
- if (valueResult.issues.length) {
1293
- if (util.propertyKeyTypes.has(typeof key)) {
1294
- final.issues.push(...util.prefixIssues(key, valueResult.issues));
1295
- }
1296
- else {
1297
- final.issues.push({
1298
- origin: "map",
1299
- code: "invalid_element",
1300
- input,
1301
- inst,
1302
- key: key,
1303
- issues: valueResult.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),
1304
- });
1305
- }
1306
- }
1307
- final.value.set(keyResult.value, valueResult.value);
1308
- }
1309
- export const $ZodSet = /*@__PURE__*/ core.$constructor("$ZodSet", (inst, def) => {
1310
- $ZodType.init(inst, def);
1311
- inst._zod.parse = (payload, ctx) => {
1312
- const input = payload.value;
1313
- if (!(input instanceof Set)) {
1314
- payload.issues.push({
1315
- input,
1316
- inst,
1317
- expected: "set",
1318
- code: "invalid_type",
1319
- });
1320
- return payload;
1321
- }
1322
- const proms = [];
1323
- payload.value = new Set();
1324
- for (const item of input) {
1325
- const result = def.valueType._zod.run({ value: item, issues: [] }, ctx);
1326
- if (result instanceof Promise) {
1327
- proms.push(result.then((result) => handleSetResult(result, payload)));
1328
- }
1329
- else
1330
- handleSetResult(result, payload);
1331
- }
1332
- if (proms.length)
1333
- return Promise.all(proms).then(() => payload);
1334
- return payload;
1335
- };
1336
- });
1337
- function handleSetResult(result, final) {
1338
- if (result.issues.length) {
1339
- final.issues.push(...result.issues);
1340
- }
1341
- final.value.add(result.value);
1342
- }
1343
- export const $ZodEnum = /*@__PURE__*/ core.$constructor("$ZodEnum", (inst, def) => {
1344
- $ZodType.init(inst, def);
1345
- const values = util.getEnumValues(def.entries);
1346
- inst._zod.values = new Set(values);
1347
- inst._zod.pattern = new RegExp(`^(${values
1348
- .filter((k) => util.propertyKeyTypes.has(typeof k))
1349
- .map((o) => (typeof o === "string" ? util.escapeRegex(o) : o.toString()))
1350
- .join("|")})$`);
1351
- inst._zod.parse = (payload, _ctx) => {
1352
- const input = payload.value;
1353
- if (inst._zod.values.has(input)) {
1354
- return payload;
1355
- }
1356
- payload.issues.push({
1357
- code: "invalid_value",
1358
- values,
1359
- input,
1360
- inst,
1361
- });
1362
- return payload;
1363
- };
1364
- });
1365
- export const $ZodLiteral = /*@__PURE__*/ core.$constructor("$ZodLiteral", (inst, def) => {
1366
- $ZodType.init(inst, def);
1367
- inst._zod.values = new Set(def.values);
1368
- inst._zod.pattern = new RegExp(`^(${def.values
1369
- .map((o) => (typeof o === "string" ? util.escapeRegex(o) : o ? o.toString() : String(o)))
1370
- .join("|")})$`);
1371
- inst._zod.parse = (payload, _ctx) => {
1372
- const input = payload.value;
1373
- if (inst._zod.values.has(input)) {
1374
- return payload;
1375
- }
1376
- payload.issues.push({
1377
- code: "invalid_value",
1378
- values: def.values,
1379
- input,
1380
- inst,
1381
- });
1382
- return payload;
1383
- };
1384
- });
1385
- export const $ZodFile = /*@__PURE__*/ core.$constructor("$ZodFile", (inst, def) => {
1386
- $ZodType.init(inst, def);
1387
- inst._zod.parse = (payload, _ctx) => {
1388
- const input = payload.value;
1389
- if (input instanceof File)
1390
- return payload;
1391
- payload.issues.push({
1392
- expected: "file",
1393
- code: "invalid_type",
1394
- input,
1395
- inst,
1396
- });
1397
- return payload;
1398
- };
1399
- });
1400
- export const $ZodTransform = /*@__PURE__*/ core.$constructor("$ZodTransform", (inst, def) => {
1401
- $ZodType.init(inst, def);
1402
- inst._zod.parse = (payload, _ctx) => {
1403
- const _out = def.transform(payload.value, payload);
1404
- if (_ctx.async) {
1405
- const output = _out instanceof Promise ? _out : Promise.resolve(_out);
1406
- return output.then((output) => {
1407
- payload.value = output;
1408
- return payload;
1409
- });
1410
- }
1411
- if (_out instanceof Promise) {
1412
- throw new core.$ZodAsyncError();
1413
- }
1414
- payload.value = _out;
1415
- return payload;
1416
- };
1417
- });
1418
- export const $ZodOptional = /*@__PURE__*/ core.$constructor("$ZodOptional", (inst, def) => {
1419
- $ZodType.init(inst, def);
1420
- inst._zod.optin = "optional";
1421
- inst._zod.optout = "optional";
1422
- util.defineLazy(inst._zod, "values", () => {
1423
- return def.innerType._zod.values ? new Set([...def.innerType._zod.values, undefined]) : undefined;
1424
- });
1425
- util.defineLazy(inst._zod, "pattern", () => {
1426
- const pattern = def.innerType._zod.pattern;
1427
- return pattern ? new RegExp(`^(${util.cleanRegex(pattern.source)})?$`) : undefined;
1428
- });
1429
- inst._zod.parse = (payload, ctx) => {
1430
- if (def.innerType._zod.optin === "optional") {
1431
- return def.innerType._zod.run(payload, ctx);
1432
- }
1433
- if (payload.value === undefined) {
1434
- return payload;
1435
- }
1436
- return def.innerType._zod.run(payload, ctx);
1437
- };
1438
- });
1439
- export const $ZodNullable = /*@__PURE__*/ core.$constructor("$ZodNullable", (inst, def) => {
1440
- $ZodType.init(inst, def);
1441
- util.defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
1442
- util.defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
1443
- util.defineLazy(inst._zod, "pattern", () => {
1444
- const pattern = def.innerType._zod.pattern;
1445
- return pattern ? new RegExp(`^(${util.cleanRegex(pattern.source)}|null)$`) : undefined;
1446
- });
1447
- util.defineLazy(inst._zod, "values", () => {
1448
- return def.innerType._zod.values ? new Set([...def.innerType._zod.values, null]) : undefined;
1449
- });
1450
- inst._zod.parse = (payload, ctx) => {
1451
- if (payload.value === null)
1452
- return payload;
1453
- return def.innerType._zod.run(payload, ctx);
1454
- };
1455
- });
1456
- export const $ZodDefault = /*@__PURE__*/ core.$constructor("$ZodDefault", (inst, def) => {
1457
- $ZodType.init(inst, def);
1458
- // inst._zod.qin = "true";
1459
- inst._zod.optin = "optional";
1460
- util.defineLazy(inst._zod, "values", () => def.innerType._zod.values);
1461
- inst._zod.parse = (payload, ctx) => {
1462
- if (payload.value === undefined) {
1463
- payload.value = def.defaultValue;
1464
- /**
1465
- * $ZodDefault always returns the default value immediately.
1466
- * It doesn't pass the default value into the validator ("prefault"). There's no reason to pass the default value through validation. The validity of the default is enforced by TypeScript statically. Otherwise, it's the responsibility of the user to ensure the default is valid. In the case of pipes with divergent in/out types, you can specify the default on the `in` schema of your ZodPipe to set a "prefault" for the pipe. */
1467
- return payload;
1468
- }
1469
- const result = def.innerType._zod.run(payload, ctx);
1470
- if (result instanceof Promise) {
1471
- return result.then((result) => handleDefaultResult(result, def));
1472
- }
1473
- return handleDefaultResult(result, def);
1474
- };
1475
- });
1476
- function handleDefaultResult(payload, def) {
1477
- if (payload.value === undefined) {
1478
- payload.value = def.defaultValue;
1479
- }
1480
- return payload;
1481
- }
1482
- export const $ZodPrefault = /*@__PURE__*/ core.$constructor("$ZodPrefault", (inst, def) => {
1483
- $ZodType.init(inst, def);
1484
- inst._zod.optin = "optional";
1485
- util.defineLazy(inst._zod, "values", () => def.innerType._zod.values);
1486
- inst._zod.parse = (payload, ctx) => {
1487
- if (payload.value === undefined) {
1488
- payload.value = def.defaultValue;
1489
- }
1490
- return def.innerType._zod.run(payload, ctx);
1491
- };
1492
- });
1493
- export const $ZodNonOptional = /*@__PURE__*/ core.$constructor("$ZodNonOptional", (inst, def) => {
1494
- $ZodType.init(inst, def);
1495
- util.defineLazy(inst._zod, "values", () => {
1496
- const v = def.innerType._zod.values;
1497
- return v ? new Set([...v].filter((x) => x !== undefined)) : undefined;
1498
- });
1499
- inst._zod.parse = (payload, ctx) => {
1500
- const result = def.innerType._zod.run(payload, ctx);
1501
- if (result instanceof Promise) {
1502
- return result.then((result) => handleNonOptionalResult(result, inst));
1503
- }
1504
- return handleNonOptionalResult(result, inst);
1505
- };
1506
- });
1507
- function handleNonOptionalResult(payload, inst) {
1508
- if (!payload.issues.length && payload.value === undefined) {
1509
- payload.issues.push({
1510
- code: "invalid_type",
1511
- expected: "nonoptional",
1512
- input: payload.value,
1513
- inst,
1514
- });
1515
- }
1516
- return payload;
1517
- }
1518
- export const $ZodSuccess = /*@__PURE__*/ core.$constructor("$ZodSuccess", (inst, def) => {
1519
- $ZodType.init(inst, def);
1520
- inst._zod.parse = (payload, ctx) => {
1521
- const result = def.innerType._zod.run(payload, ctx);
1522
- if (result instanceof Promise) {
1523
- return result.then((result) => {
1524
- payload.value = result.issues.length === 0;
1525
- return payload;
1526
- });
1527
- }
1528
- payload.value = result.issues.length === 0;
1529
- return payload;
1530
- };
1531
- });
1532
- export const $ZodCatch = /*@__PURE__*/ core.$constructor("$ZodCatch", (inst, def) => {
1533
- $ZodType.init(inst, def);
1534
- inst._zod.optin = "optional";
1535
- util.defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
1536
- util.defineLazy(inst._zod, "values", () => def.innerType._zod.values);
1537
- inst._zod.parse = (payload, ctx) => {
1538
- const result = def.innerType._zod.run(payload, ctx);
1539
- if (result instanceof Promise) {
1540
- return result.then((result) => {
1541
- payload.value = result.value;
1542
- if (result.issues.length) {
1543
- payload.value = def.catchValue({
1544
- ...payload,
1545
- error: {
1546
- issues: result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),
1547
- },
1548
- input: payload.value,
1549
- });
1550
- payload.issues = [];
1551
- }
1552
- return payload;
1553
- });
1554
- }
1555
- payload.value = result.value;
1556
- if (result.issues.length) {
1557
- payload.value = def.catchValue({
1558
- ...payload,
1559
- error: {
1560
- issues: result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),
1561
- },
1562
- input: payload.value,
1563
- });
1564
- payload.issues = [];
1565
- }
1566
- return payload;
1567
- };
1568
- });
1569
- export const $ZodNaN = /*@__PURE__*/ core.$constructor("$ZodNaN", (inst, def) => {
1570
- $ZodType.init(inst, def);
1571
- inst._zod.parse = (payload, _ctx) => {
1572
- if (typeof payload.value !== "number" || !Number.isNaN(payload.value)) {
1573
- payload.issues.push({
1574
- input: payload.value,
1575
- inst,
1576
- expected: "nan",
1577
- code: "invalid_type",
1578
- });
1579
- return payload;
1580
- }
1581
- return payload;
1582
- };
1583
- });
1584
- export const $ZodPipe = /*@__PURE__*/ core.$constructor("$ZodPipe", (inst, def) => {
1585
- $ZodType.init(inst, def);
1586
- util.defineLazy(inst._zod, "values", () => def.in._zod.values);
1587
- util.defineLazy(inst._zod, "optin", () => def.in._zod.optin);
1588
- util.defineLazy(inst._zod, "optout", () => def.out._zod.optout);
1589
- inst._zod.parse = (payload, ctx) => {
1590
- const left = def.in._zod.run(payload, ctx);
1591
- if (left instanceof Promise) {
1592
- return left.then((left) => handlePipeResult(left, def, ctx));
1593
- }
1594
- return handlePipeResult(left, def, ctx);
1595
- };
1596
- });
1597
- function handlePipeResult(left, def, ctx) {
1598
- if (util.aborted(left)) {
1599
- return left;
1600
- }
1601
- return def.out._zod.run({ value: left.value, issues: left.issues }, ctx);
1602
- }
1603
- export const $ZodReadonly = /*@__PURE__*/ core.$constructor("$ZodReadonly", (inst, def) => {
1604
- $ZodType.init(inst, def);
1605
- util.defineLazy(inst._zod, "propValues", () => def.innerType._zod.propValues);
1606
- util.defineLazy(inst._zod, "values", () => def.innerType._zod.values);
1607
- util.defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
1608
- util.defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
1609
- inst._zod.parse = (payload, ctx) => {
1610
- const result = def.innerType._zod.run(payload, ctx);
1611
- if (result instanceof Promise) {
1612
- return result.then(handleReadonlyResult);
1613
- }
1614
- return handleReadonlyResult(result);
1615
- };
1616
- });
1617
- function handleReadonlyResult(payload) {
1618
- payload.value = Object.freeze(payload.value);
1619
- return payload;
1620
- }
1621
- export const $ZodTemplateLiteral = /*@__PURE__*/ core.$constructor("$ZodTemplateLiteral", (inst, def) => {
1622
- $ZodType.init(inst, def);
1623
- const regexParts = [];
1624
- for (const part of def.parts) {
1625
- if (part instanceof $ZodType) {
1626
- if (!part._zod.pattern) {
1627
- // if (!source)
1628
- throw new Error(`Invalid template literal part, no pattern found: ${[...part._zod.traits].shift()}`);
1629
- }
1630
- const source = part._zod.pattern instanceof RegExp ? part._zod.pattern.source : part._zod.pattern;
1631
- if (!source)
1632
- throw new Error(`Invalid template literal part: ${part._zod.traits}`);
1633
- const start = source.startsWith("^") ? 1 : 0;
1634
- const end = source.endsWith("$") ? source.length - 1 : source.length;
1635
- regexParts.push(source.slice(start, end));
1636
- }
1637
- else if (part === null || util.primitiveTypes.has(typeof part)) {
1638
- regexParts.push(util.escapeRegex(`${part}`));
1639
- }
1640
- else {
1641
- throw new Error(`Invalid template literal part: ${part}`);
1642
- }
1643
- }
1644
- inst._zod.pattern = new RegExp(`^${regexParts.join("")}$`);
1645
- inst._zod.parse = (payload, _ctx) => {
1646
- if (typeof payload.value !== "string") {
1647
- payload.issues.push({
1648
- input: payload.value,
1649
- inst,
1650
- expected: "template_literal",
1651
- code: "invalid_type",
1652
- });
1653
- return payload;
1654
- }
1655
- inst._zod.pattern.lastIndex = 0;
1656
- if (!inst._zod.pattern.test(payload.value)) {
1657
- payload.issues.push({
1658
- input: payload.value,
1659
- inst,
1660
- code: "invalid_format",
1661
- format: "template_literal",
1662
- pattern: inst._zod.pattern.source,
1663
- });
1664
- return payload;
1665
- }
1666
- return payload;
1667
- };
1668
- });
1669
- export const $ZodPromise = /*@__PURE__*/ core.$constructor("$ZodPromise", (inst, def) => {
1670
- $ZodType.init(inst, def);
1671
- inst._zod.parse = (payload, ctx) => {
1672
- return Promise.resolve(payload.value).then((inner) => def.innerType._zod.run({ value: inner, issues: [] }, ctx));
1673
- };
1674
- });
1675
- export const $ZodLazy = /*@__PURE__*/ core.$constructor("$ZodLazy", (inst, def) => {
1676
- $ZodType.init(inst, def);
1677
- util.defineLazy(inst._zod, "innerType", () => def.getter());
1678
- util.defineLazy(inst._zod, "pattern", () => inst._zod.innerType._zod.pattern);
1679
- util.defineLazy(inst._zod, "propValues", () => inst._zod.innerType._zod.propValues);
1680
- util.defineLazy(inst._zod, "optin", () => inst._zod.innerType._zod.optin);
1681
- util.defineLazy(inst._zod, "optout", () => inst._zod.innerType._zod.optout);
1682
- inst._zod.parse = (payload, ctx) => {
1683
- const inner = inst._zod.innerType;
1684
- return inner._zod.run(payload, ctx);
1685
- };
1686
- });
1687
- export const $ZodCustom = /*@__PURE__*/ core.$constructor("$ZodCustom", (inst, def) => {
1688
- checks.$ZodCheck.init(inst, def);
1689
- $ZodType.init(inst, def);
1690
- inst._zod.parse = (payload, _) => {
1691
- return payload;
1692
- };
1693
- inst._zod.check = (payload) => {
1694
- const input = payload.value;
1695
- const r = def.fn(input);
1696
- if (r instanceof Promise) {
1697
- return r.then((r) => handleRefineResult(r, payload, input, inst));
1698
- }
1699
- handleRefineResult(r, payload, input, inst);
1700
- return;
1701
- };
1702
- });
1703
- function handleRefineResult(result, payload, input, inst) {
1704
- if (!result) {
1705
- const _iss = {
1706
- code: "custom",
1707
- input,
1708
- inst, // incorporates params.error into issue reporting
1709
- path: [...(inst._zod.def.path ?? [])], // incorporates params.error into issue reporting
1710
- continue: !inst._zod.def.abort,
1711
- // params: inst._zod.def.params,
1712
- };
1713
- if (inst._zod.def.params)
1714
- _iss.params = inst._zod.def.params;
1715
- payload.issues.push(util.issue(_iss));
1716
- }
1717
- }