@xenosystem/agent-cli 0.5.188 → 0.5.190

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 (865) hide show
  1. package/dist/cli.js +1 -1
  2. package/dist/index.js +2530 -2530
  3. package/dist/metafile-esm.json +1 -1
  4. package/dist/sdk-build-identity.json +18 -18
  5. package/native/xeno-pty/prebuilds/win32-x64/manifest.json +18 -18
  6. package/package.json +94 -94
  7. package/node_modules/@xeno-corporation/account/LICENSE +0 -39
  8. package/node_modules/@xeno-corporation/account/README.md +0 -266
  9. package/node_modules/@xeno-corporation/account/dist/chunk-FELZILY4.mjs +0 -60
  10. package/node_modules/@xeno-corporation/account/dist/chunk-FELZILY4.mjs.map +0 -1
  11. package/node_modules/@xeno-corporation/account/dist/client-D7OSWGkE.d.mts +0 -2337
  12. package/node_modules/@xeno-corporation/account/dist/client-D7OSWGkE.d.ts +0 -2337
  13. package/node_modules/@xeno-corporation/account/dist/index.d.mts +0 -110
  14. package/node_modules/@xeno-corporation/account/dist/index.d.ts +0 -110
  15. package/node_modules/@xeno-corporation/account/dist/index.js +0 -4116
  16. package/node_modules/@xeno-corporation/account/dist/index.js.map +0 -1
  17. package/node_modules/@xeno-corporation/account/dist/index.mjs +0 -3968
  18. package/node_modules/@xeno-corporation/account/dist/index.mjs.map +0 -1
  19. package/node_modules/@xeno-corporation/account/dist/node.d.mts +0 -109
  20. package/node_modules/@xeno-corporation/account/dist/node.d.ts +0 -109
  21. package/node_modules/@xeno-corporation/account/dist/node.js +0 -1448
  22. package/node_modules/@xeno-corporation/account/dist/node.js.map +0 -1
  23. package/node_modules/@xeno-corporation/account/dist/node.mjs +0 -1374
  24. package/node_modules/@xeno-corporation/account/dist/node.mjs.map +0 -1
  25. package/node_modules/@xeno-corporation/account/package.json +0 -62
  26. package/node_modules/zod/LICENSE +0 -21
  27. package/node_modules/zod/README.md +0 -218
  28. package/node_modules/zod/compile.cjs +0 -96
  29. package/node_modules/zod/compile.d.cts +0 -1
  30. package/node_modules/zod/compile.d.ts +0 -1
  31. package/node_modules/zod/compile.js +0 -52
  32. package/node_modules/zod/index.cjs +0 -52
  33. package/node_modules/zod/index.d.cts +0 -3
  34. package/node_modules/zod/index.d.ts +0 -3
  35. package/node_modules/zod/index.js +0 -7
  36. package/node_modules/zod/locales/index.cjs +0 -36
  37. package/node_modules/zod/locales/index.d.cts +0 -1
  38. package/node_modules/zod/locales/index.d.ts +0 -1
  39. package/node_modules/zod/locales/index.js +0 -1
  40. package/node_modules/zod/locales/package.json +0 -7
  41. package/node_modules/zod/mini/index.cjs +0 -51
  42. package/node_modules/zod/mini/index.d.cts +0 -3
  43. package/node_modules/zod/mini/index.d.ts +0 -3
  44. package/node_modules/zod/mini/index.js +0 -3
  45. package/node_modules/zod/mini/package.json +0 -7
  46. package/node_modules/zod/package.json +0 -147
  47. package/node_modules/zod/src/compile.ts +0 -56
  48. package/node_modules/zod/src/index.ts +0 -7
  49. package/node_modules/zod/src/locales/index.ts +0 -1
  50. package/node_modules/zod/src/mini/index.ts +0 -3
  51. package/node_modules/zod/src/v3/ZodError.ts +0 -340
  52. package/node_modules/zod/src/v3/benchmarks/datetime.ts +0 -58
  53. package/node_modules/zod/src/v3/benchmarks/discriminatedUnion.ts +0 -80
  54. package/node_modules/zod/src/v3/benchmarks/index.ts +0 -59
  55. package/node_modules/zod/src/v3/benchmarks/ipv4.ts +0 -57
  56. package/node_modules/zod/src/v3/benchmarks/object.ts +0 -69
  57. package/node_modules/zod/src/v3/benchmarks/primitives.ts +0 -162
  58. package/node_modules/zod/src/v3/benchmarks/realworld.ts +0 -63
  59. package/node_modules/zod/src/v3/benchmarks/string.ts +0 -55
  60. package/node_modules/zod/src/v3/benchmarks/union.ts +0 -80
  61. package/node_modules/zod/src/v3/errors.ts +0 -13
  62. package/node_modules/zod/src/v3/external.ts +0 -6
  63. package/node_modules/zod/src/v3/helpers/enumUtil.ts +0 -17
  64. package/node_modules/zod/src/v3/helpers/errorUtil.ts +0 -8
  65. package/node_modules/zod/src/v3/helpers/parseUtil.ts +0 -176
  66. package/node_modules/zod/src/v3/helpers/partialUtil.ts +0 -34
  67. package/node_modules/zod/src/v3/helpers/typeAliases.ts +0 -2
  68. package/node_modules/zod/src/v3/helpers/util.ts +0 -224
  69. package/node_modules/zod/src/v3/index.ts +0 -4
  70. package/node_modules/zod/src/v3/locales/en.ts +0 -124
  71. package/node_modules/zod/src/v3/standard-schema.ts +0 -113
  72. package/node_modules/zod/src/v3/tests/Mocker.ts +0 -54
  73. package/node_modules/zod/src/v3/tests/all-errors.test.ts +0 -157
  74. package/node_modules/zod/src/v3/tests/anyunknown.test.ts +0 -28
  75. package/node_modules/zod/src/v3/tests/array.test.ts +0 -71
  76. package/node_modules/zod/src/v3/tests/async-parsing.test.ts +0 -388
  77. package/node_modules/zod/src/v3/tests/async-refinements.test.ts +0 -46
  78. package/node_modules/zod/src/v3/tests/base.test.ts +0 -29
  79. package/node_modules/zod/src/v3/tests/bigint.test.ts +0 -55
  80. package/node_modules/zod/src/v3/tests/branded.test.ts +0 -53
  81. package/node_modules/zod/src/v3/tests/catch.test.ts +0 -220
  82. package/node_modules/zod/src/v3/tests/coerce.test.ts +0 -133
  83. package/node_modules/zod/src/v3/tests/complex.test.ts +0 -70
  84. package/node_modules/zod/src/v3/tests/custom.test.ts +0 -31
  85. package/node_modules/zod/src/v3/tests/date.test.ts +0 -32
  86. package/node_modules/zod/src/v3/tests/deepmasking.test.ts +0 -186
  87. package/node_modules/zod/src/v3/tests/default.test.ts +0 -112
  88. package/node_modules/zod/src/v3/tests/description.test.ts +0 -33
  89. package/node_modules/zod/src/v3/tests/discriminated-unions.test.ts +0 -315
  90. package/node_modules/zod/src/v3/tests/enum.test.ts +0 -80
  91. package/node_modules/zod/src/v3/tests/error.test.ts +0 -586
  92. package/node_modules/zod/src/v3/tests/firstparty.test.ts +0 -87
  93. package/node_modules/zod/src/v3/tests/firstpartyschematypes.test.ts +0 -21
  94. package/node_modules/zod/src/v3/tests/function.test.ts +0 -261
  95. package/node_modules/zod/src/v3/tests/generics.test.ts +0 -48
  96. package/node_modules/zod/src/v3/tests/instanceof.test.ts +0 -37
  97. package/node_modules/zod/src/v3/tests/intersection.test.ts +0 -128
  98. package/node_modules/zod/src/v3/tests/language-server.source.ts +0 -76
  99. package/node_modules/zod/src/v3/tests/language-server.test.ts +0 -206
  100. package/node_modules/zod/src/v3/tests/literal.test.ts +0 -36
  101. package/node_modules/zod/src/v3/tests/map.test.ts +0 -110
  102. package/node_modules/zod/src/v3/tests/masking.test.ts +0 -4
  103. package/node_modules/zod/src/v3/tests/mocker.test.ts +0 -19
  104. package/node_modules/zod/src/v3/tests/nan.test.ts +0 -24
  105. package/node_modules/zod/src/v3/tests/nativeEnum.test.ts +0 -87
  106. package/node_modules/zod/src/v3/tests/nullable.test.ts +0 -42
  107. package/node_modules/zod/src/v3/tests/number.test.ts +0 -176
  108. package/node_modules/zod/src/v3/tests/object-augmentation.test.ts +0 -29
  109. package/node_modules/zod/src/v3/tests/object-in-es5-env.test.ts +0 -29
  110. package/node_modules/zod/src/v3/tests/object.test.ts +0 -431
  111. package/node_modules/zod/src/v3/tests/optional.test.ts +0 -42
  112. package/node_modules/zod/src/v3/tests/parseUtil.test.ts +0 -23
  113. package/node_modules/zod/src/v3/tests/parser.test.ts +0 -41
  114. package/node_modules/zod/src/v3/tests/partials.test.ts +0 -243
  115. package/node_modules/zod/src/v3/tests/pickomit.test.ts +0 -111
  116. package/node_modules/zod/src/v3/tests/pipeline.test.ts +0 -29
  117. package/node_modules/zod/src/v3/tests/preprocess.test.ts +0 -186
  118. package/node_modules/zod/src/v3/tests/primitive.test.ts +0 -440
  119. package/node_modules/zod/src/v3/tests/promise.test.ts +0 -90
  120. package/node_modules/zod/src/v3/tests/readonly.test.ts +0 -114
  121. package/node_modules/zod/src/v3/tests/record.test.ts +0 -171
  122. package/node_modules/zod/src/v3/tests/recursive.test.ts +0 -197
  123. package/node_modules/zod/src/v3/tests/refine.test.ts +0 -313
  124. package/node_modules/zod/src/v3/tests/safeparse.test.ts +0 -27
  125. package/node_modules/zod/src/v3/tests/set.test.ts +0 -142
  126. package/node_modules/zod/src/v3/tests/standard-schema.test.ts +0 -83
  127. package/node_modules/zod/src/v3/tests/string.test.ts +0 -922
  128. package/node_modules/zod/src/v3/tests/transformer.test.ts +0 -233
  129. package/node_modules/zod/src/v3/tests/tuple.test.ts +0 -90
  130. package/node_modules/zod/src/v3/tests/unions.test.ts +0 -57
  131. package/node_modules/zod/src/v3/tests/validations.test.ts +0 -133
  132. package/node_modules/zod/src/v3/tests/void.test.ts +0 -15
  133. package/node_modules/zod/src/v3/types.ts +0 -5138
  134. package/node_modules/zod/src/v4/classic/checks.ts +0 -33
  135. package/node_modules/zod/src/v4/classic/coerce.ts +0 -27
  136. package/node_modules/zod/src/v4/classic/compat.ts +0 -78
  137. package/node_modules/zod/src/v4/classic/deep-partial.ts +0 -76
  138. package/node_modules/zod/src/v4/classic/errors.ts +0 -97
  139. package/node_modules/zod/src/v4/classic/external.ts +0 -57
  140. package/node_modules/zod/src/v4/classic/from-json-schema.ts +0 -944
  141. package/node_modules/zod/src/v4/classic/in-out.ts +0 -45
  142. package/node_modules/zod/src/v4/classic/index.ts +0 -5
  143. package/node_modules/zod/src/v4/classic/iso.ts +0 -20
  144. package/node_modules/zod/src/v4/classic/parse.ts +0 -88
  145. package/node_modules/zod/src/v4/classic/schemas.ts +0 -2937
  146. package/node_modules/zod/src/v4/classic/tests/anyunknown.test.ts +0 -26
  147. package/node_modules/zod/src/v4/classic/tests/apply.test.ts +0 -86
  148. package/node_modules/zod/src/v4/classic/tests/array.test.ts +0 -291
  149. package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +0 -402
  150. package/node_modules/zod/src/v4/classic/tests/async-parsing.test.ts +0 -381
  151. package/node_modules/zod/src/v4/classic/tests/async-refinements.test.ts +0 -68
  152. package/node_modules/zod/src/v4/classic/tests/base.test.ts +0 -7
  153. package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +0 -89
  154. package/node_modules/zod/src/v4/classic/tests/brand.test.ts +0 -106
  155. package/node_modules/zod/src/v4/classic/tests/catch.test.ts +0 -604
  156. package/node_modules/zod/src/v4/classic/tests/coalesce.test.ts +0 -20
  157. package/node_modules/zod/src/v4/classic/tests/codec-examples.test.ts +0 -572
  158. package/node_modules/zod/src/v4/classic/tests/codec.test.ts +0 -704
  159. package/node_modules/zod/src/v4/classic/tests/coerce.test.ts +0 -160
  160. package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +0 -374
  161. package/node_modules/zod/src/v4/classic/tests/credit-card.test.ts +0 -76
  162. package/node_modules/zod/src/v4/classic/tests/custom.test.ts +0 -40
  163. package/node_modules/zod/src/v4/classic/tests/cyclic-data.test.ts +0 -985
  164. package/node_modules/zod/src/v4/classic/tests/date.test.ts +0 -92
  165. package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +0 -316
  166. package/node_modules/zod/src/v4/classic/tests/deep-partial.test.ts +0 -380
  167. package/node_modules/zod/src/v4/classic/tests/default-locale.test.ts +0 -32
  168. package/node_modules/zod/src/v4/classic/tests/default.test.ts +0 -455
  169. package/node_modules/zod/src/v4/classic/tests/describe-meta-checks.test.ts +0 -27
  170. package/node_modules/zod/src/v4/classic/tests/description.test.ts +0 -32
  171. package/node_modules/zod/src/v4/classic/tests/detached-methods.test.ts +0 -221
  172. package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +0 -942
  173. package/node_modules/zod/src/v4/classic/tests/enum.test.ts +0 -305
  174. package/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +0 -917
  175. package/node_modules/zod/src/v4/classic/tests/error.test.ts +0 -1108
  176. package/node_modules/zod/src/v4/classic/tests/file.test.ts +0 -96
  177. package/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +0 -179
  178. package/node_modules/zod/src/v4/classic/tests/fix-json-issue.test.ts +0 -26
  179. package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +0 -1467
  180. package/node_modules/zod/src/v4/classic/tests/function.test.ts +0 -391
  181. package/node_modules/zod/src/v4/classic/tests/generics.test.ts +0 -72
  182. package/node_modules/zod/src/v4/classic/tests/global-config.test.ts +0 -32
  183. package/node_modules/zod/src/v4/classic/tests/hash.test.ts +0 -67
  184. package/node_modules/zod/src/v4/classic/tests/iban.test.ts +0 -81
  185. package/node_modules/zod/src/v4/classic/tests/in-out.test.ts +0 -159
  186. package/node_modules/zod/src/v4/classic/tests/index.test.ts +0 -958
  187. package/node_modules/zod/src/v4/classic/tests/instance-footprint.test.ts +0 -319
  188. package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +0 -127
  189. package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +0 -334
  190. package/node_modules/zod/src/v4/classic/tests/issue-schema.test.ts +0 -215
  191. package/node_modules/zod/src/v4/classic/tests/jitless-allows-eval.test.ts +0 -39
  192. package/node_modules/zod/src/v4/classic/tests/json.test.ts +0 -109
  193. package/node_modules/zod/src/v4/classic/tests/lazy.test.ts +0 -262
  194. package/node_modules/zod/src/v4/classic/tests/literal.test.ts +0 -128
  195. package/node_modules/zod/src/v4/classic/tests/locales_ka.test.ts +0 -29
  196. package/node_modules/zod/src/v4/classic/tests/locales_ro.test.ts +0 -24
  197. package/node_modules/zod/src/v4/classic/tests/map.test.ts +0 -349
  198. package/node_modules/zod/src/v4/classic/tests/nan.test.ts +0 -21
  199. package/node_modules/zod/src/v4/classic/tests/nested-refine.test.ts +0 -168
  200. package/node_modules/zod/src/v4/classic/tests/nonoptional.test.ts +0 -101
  201. package/node_modules/zod/src/v4/classic/tests/nullable.test.ts +0 -22
  202. package/node_modules/zod/src/v4/classic/tests/number.test.ts +0 -401
  203. package/node_modules/zod/src/v4/classic/tests/object.test.ts +0 -1006
  204. package/node_modules/zod/src/v4/classic/tests/optin-ladder.test.ts +0 -235
  205. package/node_modules/zod/src/v4/classic/tests/optional.test.ts +0 -366
  206. package/node_modules/zod/src/v4/classic/tests/partial.test.ts +0 -497
  207. package/node_modules/zod/src/v4/classic/tests/pickomit.test.ts +0 -211
  208. package/node_modules/zod/src/v4/classic/tests/pipe.test.ts +0 -101
  209. package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +0 -144
  210. package/node_modules/zod/src/v4/classic/tests/preprocess-types.test.ts +0 -44
  211. package/node_modules/zod/src/v4/classic/tests/preprocess.test.ts +0 -351
  212. package/node_modules/zod/src/v4/classic/tests/primitive.test.ts +0 -175
  213. package/node_modules/zod/src/v4/classic/tests/promise.test.ts +0 -81
  214. package/node_modules/zod/src/v4/classic/tests/properties.test.ts +0 -141
  215. package/node_modules/zod/src/v4/classic/tests/prototypes.test.ts +0 -23
  216. package/node_modules/zod/src/v4/classic/tests/readonly.test.ts +0 -184
  217. package/node_modules/zod/src/v4/classic/tests/record.test.ts +0 -885
  218. package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +0 -707
  219. package/node_modules/zod/src/v4/classic/tests/redos.test.ts +0 -68
  220. package/node_modules/zod/src/v4/classic/tests/refine.test.ts +0 -693
  221. package/node_modules/zod/src/v4/classic/tests/registries.test.ts +0 -243
  222. package/node_modules/zod/src/v4/classic/tests/set.test.ts +0 -196
  223. package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +0 -153
  224. package/node_modules/zod/src/v4/classic/tests/string-formats.test.ts +0 -125
  225. package/node_modules/zod/src/v4/classic/tests/string.test.ts +0 -1440
  226. package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +0 -124
  227. package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +0 -812
  228. package/node_modules/zod/src/v4/classic/tests/to-json-schema-methods.test.ts +0 -438
  229. package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +0 -4733
  230. package/node_modules/zod/src/v4/classic/tests/transform.test.ts +0 -378
  231. package/node_modules/zod/src/v4/classic/tests/tuple.test.ts +0 -511
  232. package/node_modules/zod/src/v4/classic/tests/union.test.ts +0 -310
  233. package/node_modules/zod/src/v4/classic/tests/url.test.ts +0 -13
  234. package/node_modules/zod/src/v4/classic/tests/validate.test.ts +0 -645
  235. package/node_modules/zod/src/v4/classic/tests/validations.test.ts +0 -283
  236. package/node_modules/zod/src/v4/classic/tests/void.test.ts +0 -12
  237. package/node_modules/zod/src/v4/core/api.ts +0 -1875
  238. package/node_modules/zod/src/v4/core/checks.ts +0 -1266
  239. package/node_modules/zod/src/v4/core/compile.ts +0 -2322
  240. package/node_modules/zod/src/v4/core/core.ts +0 -230
  241. package/node_modules/zod/src/v4/core/doc.ts +0 -52
  242. package/node_modules/zod/src/v4/core/errors.ts +0 -543
  243. package/node_modules/zod/src/v4/core/index.ts +0 -19
  244. package/node_modules/zod/src/v4/core/json-schema-generator.ts +0 -131
  245. package/node_modules/zod/src/v4/core/json-schema-processors.ts +0 -934
  246. package/node_modules/zod/src/v4/core/json-schema.ts +0 -148
  247. package/node_modules/zod/src/v4/core/memoizer.ts +0 -331
  248. package/node_modules/zod/src/v4/core/parse.ts +0 -309
  249. package/node_modules/zod/src/v4/core/regexes.ts +0 -217
  250. package/node_modules/zod/src/v4/core/registries.ts +0 -105
  251. package/node_modules/zod/src/v4/core/schemas.ts +0 -5226
  252. package/node_modules/zod/src/v4/core/standard-schema.ts +0 -159
  253. package/node_modules/zod/src/v4/core/tests/cached.test.ts +0 -54
  254. package/node_modules/zod/src/v4/core/tests/compile-differential.test.ts +0 -1004
  255. package/node_modules/zod/src/v4/core/tests/compile-generative.test.ts +0 -445
  256. package/node_modules/zod/src/v4/core/tests/compile-global.test.ts +0 -89
  257. package/node_modules/zod/src/v4/core/tests/compile-off-by-default.test.ts +0 -26
  258. package/node_modules/zod/src/v4/core/tests/compile-stats.test.ts +0 -34
  259. package/node_modules/zod/src/v4/core/tests/compile.test.ts +0 -2036
  260. package/node_modules/zod/src/v4/core/tests/email-regex.test.ts +0 -140
  261. package/node_modules/zod/src/v4/core/tests/extend.test.ts +0 -59
  262. package/node_modules/zod/src/v4/core/tests/index.test.ts +0 -46
  263. package/node_modules/zod/src/v4/core/tests/locales/be.test.ts +0 -124
  264. package/node_modules/zod/src/v4/core/tests/locales/el.test.ts +0 -214
  265. package/node_modules/zod/src/v4/core/tests/locales/en.test.ts +0 -22
  266. package/node_modules/zod/src/v4/core/tests/locales/es.test.ts +0 -180
  267. package/node_modules/zod/src/v4/core/tests/locales/fr.test.ts +0 -72
  268. package/node_modules/zod/src/v4/core/tests/locales/he.test.ts +0 -379
  269. package/node_modules/zod/src/v4/core/tests/locales/hr.test.ts +0 -163
  270. package/node_modules/zod/src/v4/core/tests/locales/nl.test.ts +0 -46
  271. package/node_modules/zod/src/v4/core/tests/locales/parity.test.ts +0 -42
  272. package/node_modules/zod/src/v4/core/tests/locales/ru.test.ts +0 -128
  273. package/node_modules/zod/src/v4/core/tests/locales/tg.test.ts +0 -85
  274. package/node_modules/zod/src/v4/core/tests/locales/tk.test.ts +0 -69
  275. package/node_modules/zod/src/v4/core/tests/locales/tr.test.ts +0 -69
  276. package/node_modules/zod/src/v4/core/tests/locales/uz.test.ts +0 -105
  277. package/node_modules/zod/src/v4/core/tests/polyfill-collision.test.ts +0 -46
  278. package/node_modules/zod/src/v4/core/tests/record-constructor.test.ts +0 -125
  279. package/node_modules/zod/src/v4/core/tests/recursive-tuples.test.ts +0 -45
  280. package/node_modules/zod/src/v4/core/tests/treeshake.test.ts +0 -51
  281. package/node_modules/zod/src/v4/core/tests/url-no-canparse.test.ts +0 -133
  282. package/node_modules/zod/src/v4/core/to-json-schema.ts +0 -857
  283. package/node_modules/zod/src/v4/core/util.ts +0 -1293
  284. package/node_modules/zod/src/v4/core/versions.ts +0 -5
  285. package/node_modules/zod/src/v4/core/visit.ts +0 -193
  286. package/node_modules/zod/src/v4/core/zsf.ts +0 -323
  287. package/node_modules/zod/src/v4/index.ts +0 -4
  288. package/node_modules/zod/src/v4/locales/ar.ts +0 -120
  289. package/node_modules/zod/src/v4/locales/az.ts +0 -116
  290. package/node_modules/zod/src/v4/locales/be.ts +0 -188
  291. package/node_modules/zod/src/v4/locales/bg.ts +0 -133
  292. package/node_modules/zod/src/v4/locales/bn.ts +0 -123
  293. package/node_modules/zod/src/v4/locales/ca.ts +0 -121
  294. package/node_modules/zod/src/v4/locales/ckb.ts +0 -140
  295. package/node_modules/zod/src/v4/locales/cs.ts +0 -123
  296. package/node_modules/zod/src/v4/locales/da.ts +0 -128
  297. package/node_modules/zod/src/v4/locales/de.ts +0 -121
  298. package/node_modules/zod/src/v4/locales/el.ts +0 -124
  299. package/node_modules/zod/src/v4/locales/en.ts +0 -136
  300. package/node_modules/zod/src/v4/locales/eo.ts +0 -123
  301. package/node_modules/zod/src/v4/locales/es.ts +0 -145
  302. package/node_modules/zod/src/v4/locales/fa.ts +0 -131
  303. package/node_modules/zod/src/v4/locales/fi.ts +0 -126
  304. package/node_modules/zod/src/v4/locales/fr-CA.ts +0 -121
  305. package/node_modules/zod/src/v4/locales/fr.ts +0 -139
  306. package/node_modules/zod/src/v4/locales/gu.ts +0 -123
  307. package/node_modules/zod/src/v4/locales/he.ts +0 -253
  308. package/node_modules/zod/src/v4/locales/hi.ts +0 -126
  309. package/node_modules/zod/src/v4/locales/hr.ts +0 -135
  310. package/node_modules/zod/src/v4/locales/hu.ts +0 -122
  311. package/node_modules/zod/src/v4/locales/hy.ts +0 -175
  312. package/node_modules/zod/src/v4/locales/id.ts +0 -120
  313. package/node_modules/zod/src/v4/locales/index.ts +0 -63
  314. package/node_modules/zod/src/v4/locales/is.ts +0 -124
  315. package/node_modules/zod/src/v4/locales/it.ts +0 -121
  316. package/node_modules/zod/src/v4/locales/ja.ts +0 -119
  317. package/node_modules/zod/src/v4/locales/ka.ts +0 -128
  318. package/node_modules/zod/src/v4/locales/kh.ts +0 -7
  319. package/node_modules/zod/src/v4/locales/km.ts +0 -124
  320. package/node_modules/zod/src/v4/locales/kn.ts +0 -126
  321. package/node_modules/zod/src/v4/locales/ko.ts +0 -126
  322. package/node_modules/zod/src/v4/locales/lt.ts +0 -243
  323. package/node_modules/zod/src/v4/locales/mk.ts +0 -123
  324. package/node_modules/zod/src/v4/locales/ms.ts +0 -120
  325. package/node_modules/zod/src/v4/locales/ne.ts +0 -128
  326. package/node_modules/zod/src/v4/locales/nl.ts +0 -126
  327. package/node_modules/zod/src/v4/locales/nn.ts +0 -121
  328. package/node_modules/zod/src/v4/locales/no.ts +0 -121
  329. package/node_modules/zod/src/v4/locales/ota.ts +0 -122
  330. package/node_modules/zod/src/v4/locales/pl.ts +0 -123
  331. package/node_modules/zod/src/v4/locales/ps.ts +0 -131
  332. package/node_modules/zod/src/v4/locales/pt-BR.ts +0 -161
  333. package/node_modules/zod/src/v4/locales/pt.ts +0 -159
  334. package/node_modules/zod/src/v4/locales/ro.ts +0 -132
  335. package/node_modules/zod/src/v4/locales/ru.ts +0 -188
  336. package/node_modules/zod/src/v4/locales/sk.ts +0 -123
  337. package/node_modules/zod/src/v4/locales/sl.ts +0 -123
  338. package/node_modules/zod/src/v4/locales/sv.ts +0 -124
  339. package/node_modules/zod/src/v4/locales/ta.ts +0 -123
  340. package/node_modules/zod/src/v4/locales/tg.ts +0 -135
  341. package/node_modules/zod/src/v4/locales/th.ts +0 -124
  342. package/node_modules/zod/src/v4/locales/tk.ts +0 -113
  343. package/node_modules/zod/src/v4/locales/tr.ts +0 -116
  344. package/node_modules/zod/src/v4/locales/ua.ts +0 -7
  345. package/node_modules/zod/src/v4/locales/uk.ts +0 -122
  346. package/node_modules/zod/src/v4/locales/ur.ts +0 -124
  347. package/node_modules/zod/src/v4/locales/uz.ts +0 -120
  348. package/node_modules/zod/src/v4/locales/vi.ts +0 -122
  349. package/node_modules/zod/src/v4/locales/yo.ts +0 -129
  350. package/node_modules/zod/src/v4/locales/zh-CN.ts +0 -121
  351. package/node_modules/zod/src/v4/locales/zh-TW.ts +0 -120
  352. package/node_modules/zod/src/v4/mini/checks.ts +0 -33
  353. package/node_modules/zod/src/v4/mini/coerce.ts +0 -27
  354. package/node_modules/zod/src/v4/mini/deep-partial.ts +0 -73
  355. package/node_modules/zod/src/v4/mini/external.ts +0 -52
  356. package/node_modules/zod/src/v4/mini/in-out.ts +0 -45
  357. package/node_modules/zod/src/v4/mini/index.ts +0 -3
  358. package/node_modules/zod/src/v4/mini/iso.ts +0 -66
  359. package/node_modules/zod/src/v4/mini/parse.ts +0 -16
  360. package/node_modules/zod/src/v4/mini/schemas.ts +0 -2051
  361. package/node_modules/zod/src/v4/mini/tests/apply.test.ts +0 -57
  362. package/node_modules/zod/src/v4/mini/tests/assignability.test.ts +0 -190
  363. package/node_modules/zod/src/v4/mini/tests/brand.test.ts +0 -94
  364. package/node_modules/zod/src/v4/mini/tests/checks.test.ts +0 -158
  365. package/node_modules/zod/src/v4/mini/tests/codec.test.ts +0 -582
  366. package/node_modules/zod/src/v4/mini/tests/computed.test.ts +0 -30
  367. package/node_modules/zod/src/v4/mini/tests/cyclic-data.test.ts +0 -84
  368. package/node_modules/zod/src/v4/mini/tests/deep-partial.test.ts +0 -54
  369. package/node_modules/zod/src/v4/mini/tests/error.test.ts +0 -41
  370. package/node_modules/zod/src/v4/mini/tests/functions.test.ts +0 -14
  371. package/node_modules/zod/src/v4/mini/tests/index.test.ts +0 -1146
  372. package/node_modules/zod/src/v4/mini/tests/number.test.ts +0 -109
  373. package/node_modules/zod/src/v4/mini/tests/object.test.ts +0 -292
  374. package/node_modules/zod/src/v4/mini/tests/prototypes.test.ts +0 -43
  375. package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +0 -341
  376. package/node_modules/zod/src/v4/mini/tests/standard-schema.test.ts +0 -50
  377. package/node_modules/zod/src/v4/mini/tests/string.test.ts +0 -396
  378. package/node_modules/zod/src/v4-mini/index.ts +0 -3
  379. package/node_modules/zod/v3/ZodError.cjs +0 -167
  380. package/node_modules/zod/v3/ZodError.d.cts +0 -164
  381. package/node_modules/zod/v3/ZodError.d.ts +0 -164
  382. package/node_modules/zod/v3/ZodError.js +0 -143
  383. package/node_modules/zod/v3/errors.cjs +0 -36
  384. package/node_modules/zod/v3/errors.d.cts +0 -5
  385. package/node_modules/zod/v3/errors.d.ts +0 -5
  386. package/node_modules/zod/v3/errors.js +0 -9
  387. package/node_modules/zod/v3/external.cjs +0 -41
  388. package/node_modules/zod/v3/external.d.cts +0 -6
  389. package/node_modules/zod/v3/external.d.ts +0 -6
  390. package/node_modules/zod/v3/external.js +0 -6
  391. package/node_modules/zod/v3/helpers/enumUtil.cjs +0 -21
  392. package/node_modules/zod/v3/helpers/enumUtil.d.cts +0 -8
  393. package/node_modules/zod/v3/helpers/enumUtil.d.ts +0 -8
  394. package/node_modules/zod/v3/helpers/enumUtil.js +0 -1
  395. package/node_modules/zod/v3/helpers/errorUtil.cjs +0 -28
  396. package/node_modules/zod/v3/helpers/errorUtil.d.cts +0 -9
  397. package/node_modules/zod/v3/helpers/errorUtil.d.ts +0 -9
  398. package/node_modules/zod/v3/helpers/errorUtil.js +0 -6
  399. package/node_modules/zod/v3/helpers/parseUtil.cjs +0 -143
  400. package/node_modules/zod/v3/helpers/parseUtil.d.cts +0 -78
  401. package/node_modules/zod/v3/helpers/parseUtil.d.ts +0 -78
  402. package/node_modules/zod/v3/helpers/parseUtil.js +0 -109
  403. package/node_modules/zod/v3/helpers/partialUtil.cjs +0 -21
  404. package/node_modules/zod/v3/helpers/partialUtil.d.cts +0 -8
  405. package/node_modules/zod/v3/helpers/partialUtil.d.ts +0 -8
  406. package/node_modules/zod/v3/helpers/partialUtil.js +0 -1
  407. package/node_modules/zod/v3/helpers/typeAliases.cjs +0 -21
  408. package/node_modules/zod/v3/helpers/typeAliases.d.cts +0 -2
  409. package/node_modules/zod/v3/helpers/typeAliases.d.ts +0 -2
  410. package/node_modules/zod/v3/helpers/typeAliases.js +0 -1
  411. package/node_modules/zod/v3/helpers/util.cjs +0 -156
  412. package/node_modules/zod/v3/helpers/util.d.cts +0 -85
  413. package/node_modules/zod/v3/helpers/util.d.ts +0 -85
  414. package/node_modules/zod/v3/helpers/util.js +0 -133
  415. package/node_modules/zod/v3/index.cjs +0 -52
  416. package/node_modules/zod/v3/index.d.cts +0 -4
  417. package/node_modules/zod/v3/index.d.ts +0 -4
  418. package/node_modules/zod/v3/index.js +0 -4
  419. package/node_modules/zod/v3/locales/en.cjs +0 -112
  420. package/node_modules/zod/v3/locales/en.d.cts +0 -3
  421. package/node_modules/zod/v3/locales/en.d.ts +0 -3
  422. package/node_modules/zod/v3/locales/en.js +0 -109
  423. package/node_modules/zod/v3/package.json +0 -7
  424. package/node_modules/zod/v3/standard-schema.cjs +0 -21
  425. package/node_modules/zod/v3/standard-schema.d.cts +0 -102
  426. package/node_modules/zod/v3/standard-schema.d.ts +0 -102
  427. package/node_modules/zod/v3/standard-schema.js +0 -1
  428. package/node_modules/zod/v3/types.cjs +0 -3798
  429. package/node_modules/zod/v3/types.d.cts +0 -1034
  430. package/node_modules/zod/v3/types.d.ts +0 -1034
  431. package/node_modules/zod/v3/types.js +0 -3697
  432. package/node_modules/zod/v4/classic/checks.cjs +0 -53
  433. package/node_modules/zod/v4/classic/checks.d.cts +0 -1
  434. package/node_modules/zod/v4/classic/checks.d.ts +0 -1
  435. package/node_modules/zod/v4/classic/checks.js +0 -1
  436. package/node_modules/zod/v4/classic/coerce.cjs +0 -66
  437. package/node_modules/zod/v4/classic/coerce.d.cts +0 -17
  438. package/node_modules/zod/v4/classic/coerce.d.ts +0 -17
  439. package/node_modules/zod/v4/classic/coerce.js +0 -17
  440. package/node_modules/zod/v4/classic/compat.cjs +0 -80
  441. package/node_modules/zod/v4/classic/compat.d.cts +0 -48
  442. package/node_modules/zod/v4/classic/compat.d.ts +0 -48
  443. package/node_modules/zod/v4/classic/compat.js +0 -31
  444. package/node_modules/zod/v4/classic/deep-partial.cjs +0 -58
  445. package/node_modules/zod/v4/classic/deep-partial.d.cts +0 -14
  446. package/node_modules/zod/v4/classic/deep-partial.d.ts +0 -14
  447. package/node_modules/zod/v4/classic/deep-partial.js +0 -13
  448. package/node_modules/zod/v4/classic/errors.cjs +0 -102
  449. package/node_modules/zod/v4/classic/errors.d.cts +0 -29
  450. package/node_modules/zod/v4/classic/errors.d.ts +0 -29
  451. package/node_modules/zod/v4/classic/errors.js +0 -57
  452. package/node_modules/zod/v4/classic/external.cjs +0 -97
  453. package/node_modules/zod/v4/classic/external.d.cts +0 -19
  454. package/node_modules/zod/v4/classic/external.d.ts +0 -19
  455. package/node_modules/zod/v4/classic/external.js +0 -17
  456. package/node_modules/zod/v4/classic/from-json-schema.cjs +0 -926
  457. package/node_modules/zod/v4/classic/from-json-schema.d.cts +0 -12
  458. package/node_modules/zod/v4/classic/from-json-schema.d.ts +0 -12
  459. package/node_modules/zod/v4/classic/from-json-schema.js +0 -881
  460. package/node_modules/zod/v4/classic/in-out.cjs +0 -82
  461. package/node_modules/zod/v4/classic/in-out.d.cts +0 -8
  462. package/node_modules/zod/v4/classic/in-out.d.ts +0 -8
  463. package/node_modules/zod/v4/classic/in-out.js +0 -36
  464. package/node_modules/zod/v4/classic/index.cjs +0 -52
  465. package/node_modules/zod/v4/classic/index.d.cts +0 -3
  466. package/node_modules/zod/v4/classic/index.d.ts +0 -3
  467. package/node_modules/zod/v4/classic/index.js +0 -4
  468. package/node_modules/zod/v4/classic/iso.cjs +0 -68
  469. package/node_modules/zod/v4/classic/iso.d.cts +0 -7
  470. package/node_modules/zod/v4/classic/iso.d.ts +0 -7
  471. package/node_modules/zod/v4/classic/iso.js +0 -15
  472. package/node_modules/zod/v4/classic/package.json +0 -7
  473. package/node_modules/zod/v4/classic/parse.cjs +0 -63
  474. package/node_modules/zod/v4/classic/parse.d.cts +0 -44
  475. package/node_modules/zod/v4/classic/parse.d.ts +0 -44
  476. package/node_modules/zod/v4/classic/parse.js +0 -16
  477. package/node_modules/zod/v4/classic/schemas.cjs +0 -1676
  478. package/node_modules/zod/v4/classic/schemas.d.cts +0 -816
  479. package/node_modules/zod/v4/classic/schemas.d.ts +0 -816
  480. package/node_modules/zod/v4/classic/schemas.js +0 -1535
  481. package/node_modules/zod/v4/core/api.cjs +0 -1269
  482. package/node_modules/zod/v4/core/api.d.cts +0 -335
  483. package/node_modules/zod/v4/core/api.d.ts +0 -335
  484. package/node_modules/zod/v4/core/api.js +0 -1107
  485. package/node_modules/zod/v4/core/checks.cjs +0 -561
  486. package/node_modules/zod/v4/core/checks.d.cts +0 -294
  487. package/node_modules/zod/v4/core/checks.d.ts +0 -294
  488. package/node_modules/zod/v4/core/checks.js +0 -516
  489. package/node_modules/zod/v4/core/compile.cjs +0 -1916
  490. package/node_modules/zod/v4/core/compile.d.cts +0 -65
  491. package/node_modules/zod/v4/core/compile.d.ts +0 -65
  492. package/node_modules/zod/v4/core/compile.js +0 -1866
  493. package/node_modules/zod/v4/core/core.cjs +0 -167
  494. package/node_modules/zod/v4/core/core.d.cts +0 -82
  495. package/node_modules/zod/v4/core/core.d.ts +0 -82
  496. package/node_modules/zod/v4/core/core.js +0 -141
  497. package/node_modules/zod/v4/core/doc.cjs +0 -61
  498. package/node_modules/zod/v4/core/doc.d.cts +0 -16
  499. package/node_modules/zod/v4/core/doc.d.ts +0 -16
  500. package/node_modules/zod/v4/core/doc.js +0 -38
  501. package/node_modules/zod/v4/core/errors.cjs +0 -317
  502. package/node_modules/zod/v4/core/errors.d.cts +0 -225
  503. package/node_modules/zod/v4/core/errors.d.ts +0 -225
  504. package/node_modules/zod/v4/core/errors.js +0 -267
  505. package/node_modules/zod/v4/core/index.cjs +0 -70
  506. package/node_modules/zod/v4/core/index.d.cts +0 -19
  507. package/node_modules/zod/v4/core/index.d.ts +0 -19
  508. package/node_modules/zod/v4/core/index.js +0 -19
  509. package/node_modules/zod/v4/core/json-schema-generator.cjs +0 -122
  510. package/node_modules/zod/v4/core/json-schema-generator.d.cts +0 -65
  511. package/node_modules/zod/v4/core/json-schema-generator.d.ts +0 -65
  512. package/node_modules/zod/v4/core/json-schema-generator.js +0 -99
  513. package/node_modules/zod/v4/core/json-schema-processors.cjs +0 -929
  514. package/node_modules/zod/v4/core/json-schema-processors.d.cts +0 -65
  515. package/node_modules/zod/v4/core/json-schema-processors.d.ts +0 -65
  516. package/node_modules/zod/v4/core/json-schema-processors.js +0 -843
  517. package/node_modules/zod/v4/core/json-schema.cjs +0 -21
  518. package/node_modules/zod/v4/core/json-schema.d.cts +0 -89
  519. package/node_modules/zod/v4/core/json-schema.d.ts +0 -89
  520. package/node_modules/zod/v4/core/json-schema.js +0 -1
  521. package/node_modules/zod/v4/core/memoizer.cjs +0 -360
  522. package/node_modules/zod/v4/core/memoizer.d.cts +0 -15
  523. package/node_modules/zod/v4/core/memoizer.d.ts +0 -15
  524. package/node_modules/zod/v4/core/memoizer.js +0 -311
  525. package/node_modules/zod/v4/core/package.json +0 -7
  526. package/node_modules/zod/v4/core/parse.cjs +0 -233
  527. package/node_modules/zod/v4/core/parse.d.cts +0 -52
  528. package/node_modules/zod/v4/core/parse.d.ts +0 -52
  529. package/node_modules/zod/v4/core/parse.js +0 -175
  530. package/node_modules/zod/v4/core/regexes.cjs +0 -209
  531. package/node_modules/zod/v4/core/regexes.d.cts +0 -90
  532. package/node_modules/zod/v4/core/regexes.d.ts +0 -90
  533. package/node_modules/zod/v4/core/regexes.js +0 -156
  534. package/node_modules/zod/v4/core/registries.cjs +0 -75
  535. package/node_modules/zod/v4/core/registries.d.cts +0 -35
  536. package/node_modules/zod/v4/core/registries.d.ts +0 -35
  537. package/node_modules/zod/v4/core/registries.js +0 -51
  538. package/node_modules/zod/v4/core/schemas.cjs +0 -2699
  539. package/node_modules/zod/v4/core/schemas.d.cts +0 -1275
  540. package/node_modules/zod/v4/core/schemas.d.ts +0 -1275
  541. package/node_modules/zod/v4/core/schemas.js +0 -2636
  542. package/node_modules/zod/v4/core/standard-schema.cjs +0 -21
  543. package/node_modules/zod/v4/core/standard-schema.d.cts +0 -126
  544. package/node_modules/zod/v4/core/standard-schema.d.ts +0 -126
  545. package/node_modules/zod/v4/core/standard-schema.js +0 -1
  546. package/node_modules/zod/v4/core/to-json-schema.cjs +0 -681
  547. package/node_modules/zod/v4/core/to-json-schema.d.cts +0 -154
  548. package/node_modules/zod/v4/core/to-json-schema.d.ts +0 -154
  549. package/node_modules/zod/v4/core/to-json-schema.js +0 -651
  550. package/node_modules/zod/v4/core/util.cjs +0 -964
  551. package/node_modules/zod/v4/core/util.d.cts +0 -280
  552. package/node_modules/zod/v4/core/util.d.ts +0 -280
  553. package/node_modules/zod/v4/core/util.js +0 -873
  554. package/node_modules/zod/v4/core/versions.cjs +0 -27
  555. package/node_modules/zod/v4/core/versions.d.cts +0 -5
  556. package/node_modules/zod/v4/core/versions.d.ts +0 -5
  557. package/node_modules/zod/v4/core/versions.js +0 -5
  558. package/node_modules/zod/v4/core/visit.cjs +0 -214
  559. package/node_modules/zod/v4/core/visit.d.cts +0 -30
  560. package/node_modules/zod/v4/core/visit.d.ts +0 -30
  561. package/node_modules/zod/v4/core/visit.js +0 -169
  562. package/node_modules/zod/v4/index.cjs +0 -51
  563. package/node_modules/zod/v4/index.d.cts +0 -3
  564. package/node_modules/zod/v4/index.d.ts +0 -3
  565. package/node_modules/zod/v4/index.js +0 -4
  566. package/node_modules/zod/v4/locales/ar.cjs +0 -138
  567. package/node_modules/zod/v4/locales/ar.d.cts +0 -5
  568. package/node_modules/zod/v4/locales/ar.d.ts +0 -4
  569. package/node_modules/zod/v4/locales/ar.js +0 -111
  570. package/node_modules/zod/v4/locales/az.cjs +0 -137
  571. package/node_modules/zod/v4/locales/az.d.cts +0 -5
  572. package/node_modules/zod/v4/locales/az.d.ts +0 -4
  573. package/node_modules/zod/v4/locales/az.js +0 -110
  574. package/node_modules/zod/v4/locales/be.cjs +0 -195
  575. package/node_modules/zod/v4/locales/be.d.cts +0 -5
  576. package/node_modules/zod/v4/locales/be.d.ts +0 -4
  577. package/node_modules/zod/v4/locales/be.js +0 -168
  578. package/node_modules/zod/v4/locales/bg.cjs +0 -152
  579. package/node_modules/zod/v4/locales/bg.d.cts +0 -5
  580. package/node_modules/zod/v4/locales/bg.d.ts +0 -4
  581. package/node_modules/zod/v4/locales/bg.js +0 -125
  582. package/node_modules/zod/v4/locales/bn.cjs +0 -140
  583. package/node_modules/zod/v4/locales/bn.d.cts +0 -5
  584. package/node_modules/zod/v4/locales/bn.d.ts +0 -4
  585. package/node_modules/zod/v4/locales/bn.js +0 -113
  586. package/node_modules/zod/v4/locales/ca.cjs +0 -139
  587. package/node_modules/zod/v4/locales/ca.d.cts +0 -5
  588. package/node_modules/zod/v4/locales/ca.d.ts +0 -4
  589. package/node_modules/zod/v4/locales/ca.js +0 -112
  590. package/node_modules/zod/v4/locales/ckb.cjs +0 -160
  591. package/node_modules/zod/v4/locales/ckb.d.cts +0 -5
  592. package/node_modules/zod/v4/locales/ckb.d.ts +0 -4
  593. package/node_modules/zod/v4/locales/ckb.js +0 -133
  594. package/node_modules/zod/v4/locales/cs.cjs +0 -143
  595. package/node_modules/zod/v4/locales/cs.d.cts +0 -5
  596. package/node_modules/zod/v4/locales/cs.d.ts +0 -4
  597. package/node_modules/zod/v4/locales/cs.js +0 -116
  598. package/node_modules/zod/v4/locales/da.cjs +0 -147
  599. package/node_modules/zod/v4/locales/da.d.cts +0 -5
  600. package/node_modules/zod/v4/locales/da.d.ts +0 -4
  601. package/node_modules/zod/v4/locales/da.js +0 -120
  602. package/node_modules/zod/v4/locales/de.cjs +0 -140
  603. package/node_modules/zod/v4/locales/de.d.cts +0 -5
  604. package/node_modules/zod/v4/locales/de.d.ts +0 -4
  605. package/node_modules/zod/v4/locales/de.js +0 -113
  606. package/node_modules/zod/v4/locales/el.cjs +0 -139
  607. package/node_modules/zod/v4/locales/el.d.cts +0 -5
  608. package/node_modules/zod/v4/locales/el.d.ts +0 -4
  609. package/node_modules/zod/v4/locales/el.js +0 -112
  610. package/node_modules/zod/v4/locales/en.cjs +0 -152
  611. package/node_modules/zod/v4/locales/en.d.cts +0 -5
  612. package/node_modules/zod/v4/locales/en.d.ts +0 -4
  613. package/node_modules/zod/v4/locales/en.js +0 -125
  614. package/node_modules/zod/v4/locales/eo.cjs +0 -141
  615. package/node_modules/zod/v4/locales/eo.d.cts +0 -5
  616. package/node_modules/zod/v4/locales/eo.d.ts +0 -4
  617. package/node_modules/zod/v4/locales/eo.js +0 -114
  618. package/node_modules/zod/v4/locales/es.cjs +0 -163
  619. package/node_modules/zod/v4/locales/es.d.cts +0 -5
  620. package/node_modules/zod/v4/locales/es.d.ts +0 -4
  621. package/node_modules/zod/v4/locales/es.js +0 -136
  622. package/node_modules/zod/v4/locales/fa.cjs +0 -146
  623. package/node_modules/zod/v4/locales/fa.d.cts +0 -5
  624. package/node_modules/zod/v4/locales/fa.d.ts +0 -4
  625. package/node_modules/zod/v4/locales/fa.js +0 -119
  626. package/node_modules/zod/v4/locales/fi.cjs +0 -144
  627. package/node_modules/zod/v4/locales/fi.d.cts +0 -5
  628. package/node_modules/zod/v4/locales/fi.d.ts +0 -4
  629. package/node_modules/zod/v4/locales/fi.js +0 -117
  630. package/node_modules/zod/v4/locales/fr-CA.cjs +0 -139
  631. package/node_modules/zod/v4/locales/fr-CA.d.cts +0 -5
  632. package/node_modules/zod/v4/locales/fr-CA.d.ts +0 -4
  633. package/node_modules/zod/v4/locales/fr-CA.js +0 -112
  634. package/node_modules/zod/v4/locales/fr.cjs +0 -156
  635. package/node_modules/zod/v4/locales/fr.d.cts +0 -5
  636. package/node_modules/zod/v4/locales/fr.d.ts +0 -4
  637. package/node_modules/zod/v4/locales/fr.js +0 -129
  638. package/node_modules/zod/v4/locales/gu.cjs +0 -140
  639. package/node_modules/zod/v4/locales/gu.d.cts +0 -5
  640. package/node_modules/zod/v4/locales/gu.d.ts +0 -4
  641. package/node_modules/zod/v4/locales/gu.js +0 -113
  642. package/node_modules/zod/v4/locales/he.cjs +0 -248
  643. package/node_modules/zod/v4/locales/he.d.cts +0 -5
  644. package/node_modules/zod/v4/locales/he.d.ts +0 -4
  645. package/node_modules/zod/v4/locales/he.js +0 -221
  646. package/node_modules/zod/v4/locales/hi.cjs +0 -138
  647. package/node_modules/zod/v4/locales/hi.d.cts +0 -5
  648. package/node_modules/zod/v4/locales/hi.d.ts +0 -4
  649. package/node_modules/zod/v4/locales/hi.js +0 -111
  650. package/node_modules/zod/v4/locales/hr.cjs +0 -153
  651. package/node_modules/zod/v4/locales/hr.d.cts +0 -5
  652. package/node_modules/zod/v4/locales/hr.d.ts +0 -4
  653. package/node_modules/zod/v4/locales/hr.js +0 -126
  654. package/node_modules/zod/v4/locales/hu.cjs +0 -140
  655. package/node_modules/zod/v4/locales/hu.d.cts +0 -5
  656. package/node_modules/zod/v4/locales/hu.d.ts +0 -4
  657. package/node_modules/zod/v4/locales/hu.js +0 -113
  658. package/node_modules/zod/v4/locales/hy.cjs +0 -185
  659. package/node_modules/zod/v4/locales/hy.d.cts +0 -5
  660. package/node_modules/zod/v4/locales/hy.d.ts +0 -4
  661. package/node_modules/zod/v4/locales/hy.js +0 -158
  662. package/node_modules/zod/v4/locales/id.cjs +0 -138
  663. package/node_modules/zod/v4/locales/id.d.cts +0 -5
  664. package/node_modules/zod/v4/locales/id.d.ts +0 -4
  665. package/node_modules/zod/v4/locales/id.js +0 -111
  666. package/node_modules/zod/v4/locales/index.cjs +0 -152
  667. package/node_modules/zod/v4/locales/index.d.cts +0 -63
  668. package/node_modules/zod/v4/locales/index.d.ts +0 -63
  669. package/node_modules/zod/v4/locales/index.js +0 -63
  670. package/node_modules/zod/v4/locales/is.cjs +0 -141
  671. package/node_modules/zod/v4/locales/is.d.cts +0 -5
  672. package/node_modules/zod/v4/locales/is.d.ts +0 -4
  673. package/node_modules/zod/v4/locales/is.js +0 -114
  674. package/node_modules/zod/v4/locales/it.cjs +0 -140
  675. package/node_modules/zod/v4/locales/it.d.cts +0 -5
  676. package/node_modules/zod/v4/locales/it.d.ts +0 -4
  677. package/node_modules/zod/v4/locales/it.js +0 -113
  678. package/node_modules/zod/v4/locales/ja.cjs +0 -139
  679. package/node_modules/zod/v4/locales/ja.d.cts +0 -5
  680. package/node_modules/zod/v4/locales/ja.d.ts +0 -4
  681. package/node_modules/zod/v4/locales/ja.js +0 -112
  682. package/node_modules/zod/v4/locales/ka.cjs +0 -144
  683. package/node_modules/zod/v4/locales/ka.d.cts +0 -5
  684. package/node_modules/zod/v4/locales/ka.d.ts +0 -4
  685. package/node_modules/zod/v4/locales/ka.js +0 -117
  686. package/node_modules/zod/v4/locales/kh.cjs +0 -12
  687. package/node_modules/zod/v4/locales/kh.d.cts +0 -5
  688. package/node_modules/zod/v4/locales/kh.d.ts +0 -5
  689. package/node_modules/zod/v4/locales/kh.js +0 -5
  690. package/node_modules/zod/v4/locales/km.cjs +0 -142
  691. package/node_modules/zod/v4/locales/km.d.cts +0 -5
  692. package/node_modules/zod/v4/locales/km.d.ts +0 -4
  693. package/node_modules/zod/v4/locales/km.js +0 -115
  694. package/node_modules/zod/v4/locales/kn.cjs +0 -143
  695. package/node_modules/zod/v4/locales/kn.d.cts +0 -5
  696. package/node_modules/zod/v4/locales/kn.d.ts +0 -4
  697. package/node_modules/zod/v4/locales/kn.js +0 -116
  698. package/node_modules/zod/v4/locales/ko.cjs +0 -143
  699. package/node_modules/zod/v4/locales/ko.d.cts +0 -5
  700. package/node_modules/zod/v4/locales/ko.d.ts +0 -4
  701. package/node_modules/zod/v4/locales/ko.js +0 -116
  702. package/node_modules/zod/v4/locales/lt.cjs +0 -234
  703. package/node_modules/zod/v4/locales/lt.d.cts +0 -5
  704. package/node_modules/zod/v4/locales/lt.d.ts +0 -4
  705. package/node_modules/zod/v4/locales/lt.js +0 -207
  706. package/node_modules/zod/v4/locales/mk.cjs +0 -141
  707. package/node_modules/zod/v4/locales/mk.d.cts +0 -5
  708. package/node_modules/zod/v4/locales/mk.d.ts +0 -4
  709. package/node_modules/zod/v4/locales/mk.js +0 -114
  710. package/node_modules/zod/v4/locales/ms.cjs +0 -139
  711. package/node_modules/zod/v4/locales/ms.d.cts +0 -5
  712. package/node_modules/zod/v4/locales/ms.d.ts +0 -4
  713. package/node_modules/zod/v4/locales/ms.js +0 -112
  714. package/node_modules/zod/v4/locales/ne.cjs +0 -138
  715. package/node_modules/zod/v4/locales/ne.d.cts +0 -5
  716. package/node_modules/zod/v4/locales/ne.d.ts +0 -4
  717. package/node_modules/zod/v4/locales/ne.js +0 -111
  718. package/node_modules/zod/v4/locales/nl.cjs +0 -142
  719. package/node_modules/zod/v4/locales/nl.d.cts +0 -5
  720. package/node_modules/zod/v4/locales/nl.d.ts +0 -4
  721. package/node_modules/zod/v4/locales/nl.js +0 -115
  722. package/node_modules/zod/v4/locales/nn.cjs +0 -140
  723. package/node_modules/zod/v4/locales/nn.d.cts +0 -5
  724. package/node_modules/zod/v4/locales/nn.d.ts +0 -4
  725. package/node_modules/zod/v4/locales/nn.js +0 -113
  726. package/node_modules/zod/v4/locales/no.cjs +0 -140
  727. package/node_modules/zod/v4/locales/no.d.cts +0 -5
  728. package/node_modules/zod/v4/locales/no.d.ts +0 -4
  729. package/node_modules/zod/v4/locales/no.js +0 -113
  730. package/node_modules/zod/v4/locales/ota.cjs +0 -141
  731. package/node_modules/zod/v4/locales/ota.d.cts +0 -5
  732. package/node_modules/zod/v4/locales/ota.d.ts +0 -4
  733. package/node_modules/zod/v4/locales/ota.js +0 -114
  734. package/node_modules/zod/v4/locales/package.json +0 -7
  735. package/node_modules/zod/v4/locales/pl.cjs +0 -141
  736. package/node_modules/zod/v4/locales/pl.d.cts +0 -5
  737. package/node_modules/zod/v4/locales/pl.d.ts +0 -4
  738. package/node_modules/zod/v4/locales/pl.js +0 -114
  739. package/node_modules/zod/v4/locales/ps.cjs +0 -146
  740. package/node_modules/zod/v4/locales/ps.d.cts +0 -5
  741. package/node_modules/zod/v4/locales/ps.d.ts +0 -4
  742. package/node_modules/zod/v4/locales/ps.js +0 -119
  743. package/node_modules/zod/v4/locales/pt-BR.cjs +0 -170
  744. package/node_modules/zod/v4/locales/pt-BR.d.cts +0 -5
  745. package/node_modules/zod/v4/locales/pt-BR.d.ts +0 -4
  746. package/node_modules/zod/v4/locales/pt-BR.js +0 -143
  747. package/node_modules/zod/v4/locales/pt.cjs +0 -169
  748. package/node_modules/zod/v4/locales/pt.d.cts +0 -5
  749. package/node_modules/zod/v4/locales/pt.d.ts +0 -4
  750. package/node_modules/zod/v4/locales/pt.js +0 -142
  751. package/node_modules/zod/v4/locales/ro.cjs +0 -149
  752. package/node_modules/zod/v4/locales/ro.d.cts +0 -5
  753. package/node_modules/zod/v4/locales/ro.d.ts +0 -4
  754. package/node_modules/zod/v4/locales/ro.js +0 -122
  755. package/node_modules/zod/v4/locales/ru.cjs +0 -195
  756. package/node_modules/zod/v4/locales/ru.d.cts +0 -5
  757. package/node_modules/zod/v4/locales/ru.d.ts +0 -4
  758. package/node_modules/zod/v4/locales/ru.js +0 -168
  759. package/node_modules/zod/v4/locales/sk.cjs +0 -143
  760. package/node_modules/zod/v4/locales/sk.d.cts +0 -5
  761. package/node_modules/zod/v4/locales/sk.d.ts +0 -4
  762. package/node_modules/zod/v4/locales/sk.js +0 -116
  763. package/node_modules/zod/v4/locales/sl.cjs +0 -141
  764. package/node_modules/zod/v4/locales/sl.d.cts +0 -5
  765. package/node_modules/zod/v4/locales/sl.d.ts +0 -4
  766. package/node_modules/zod/v4/locales/sl.js +0 -114
  767. package/node_modules/zod/v4/locales/sv.cjs +0 -142
  768. package/node_modules/zod/v4/locales/sv.d.cts +0 -5
  769. package/node_modules/zod/v4/locales/sv.d.ts +0 -4
  770. package/node_modules/zod/v4/locales/sv.js +0 -115
  771. package/node_modules/zod/v4/locales/ta.cjs +0 -142
  772. package/node_modules/zod/v4/locales/ta.d.cts +0 -5
  773. package/node_modules/zod/v4/locales/ta.d.ts +0 -4
  774. package/node_modules/zod/v4/locales/ta.js +0 -115
  775. package/node_modules/zod/v4/locales/tg.cjs +0 -144
  776. package/node_modules/zod/v4/locales/tg.d.cts +0 -5
  777. package/node_modules/zod/v4/locales/tg.d.ts +0 -4
  778. package/node_modules/zod/v4/locales/tg.js +0 -117
  779. package/node_modules/zod/v4/locales/th.cjs +0 -142
  780. package/node_modules/zod/v4/locales/th.d.cts +0 -5
  781. package/node_modules/zod/v4/locales/th.d.ts +0 -4
  782. package/node_modules/zod/v4/locales/th.js +0 -115
  783. package/node_modules/zod/v4/locales/tk.cjs +0 -134
  784. package/node_modules/zod/v4/locales/tk.d.cts +0 -5
  785. package/node_modules/zod/v4/locales/tk.d.ts +0 -4
  786. package/node_modules/zod/v4/locales/tk.js +0 -107
  787. package/node_modules/zod/v4/locales/tr.cjs +0 -137
  788. package/node_modules/zod/v4/locales/tr.d.cts +0 -5
  789. package/node_modules/zod/v4/locales/tr.d.ts +0 -4
  790. package/node_modules/zod/v4/locales/tr.js +0 -110
  791. package/node_modules/zod/v4/locales/ua.cjs +0 -12
  792. package/node_modules/zod/v4/locales/ua.d.cts +0 -5
  793. package/node_modules/zod/v4/locales/ua.d.ts +0 -5
  794. package/node_modules/zod/v4/locales/ua.js +0 -5
  795. package/node_modules/zod/v4/locales/uk.cjs +0 -140
  796. package/node_modules/zod/v4/locales/uk.d.cts +0 -5
  797. package/node_modules/zod/v4/locales/uk.d.ts +0 -4
  798. package/node_modules/zod/v4/locales/uk.js +0 -113
  799. package/node_modules/zod/v4/locales/ur.cjs +0 -142
  800. package/node_modules/zod/v4/locales/ur.d.cts +0 -5
  801. package/node_modules/zod/v4/locales/ur.d.ts +0 -4
  802. package/node_modules/zod/v4/locales/ur.js +0 -115
  803. package/node_modules/zod/v4/locales/uz.cjs +0 -140
  804. package/node_modules/zod/v4/locales/uz.d.cts +0 -5
  805. package/node_modules/zod/v4/locales/uz.d.ts +0 -4
  806. package/node_modules/zod/v4/locales/uz.js +0 -113
  807. package/node_modules/zod/v4/locales/vi.cjs +0 -140
  808. package/node_modules/zod/v4/locales/vi.d.cts +0 -5
  809. package/node_modules/zod/v4/locales/vi.d.ts +0 -4
  810. package/node_modules/zod/v4/locales/vi.js +0 -113
  811. package/node_modules/zod/v4/locales/yo.cjs +0 -139
  812. package/node_modules/zod/v4/locales/yo.d.cts +0 -5
  813. package/node_modules/zod/v4/locales/yo.d.ts +0 -4
  814. package/node_modules/zod/v4/locales/yo.js +0 -112
  815. package/node_modules/zod/v4/locales/zh-CN.cjs +0 -141
  816. package/node_modules/zod/v4/locales/zh-CN.d.cts +0 -5
  817. package/node_modules/zod/v4/locales/zh-CN.d.ts +0 -4
  818. package/node_modules/zod/v4/locales/zh-CN.js +0 -114
  819. package/node_modules/zod/v4/locales/zh-TW.cjs +0 -139
  820. package/node_modules/zod/v4/locales/zh-TW.d.cts +0 -5
  821. package/node_modules/zod/v4/locales/zh-TW.d.ts +0 -4
  822. package/node_modules/zod/v4/locales/zh-TW.js +0 -112
  823. package/node_modules/zod/v4/mini/checks.cjs +0 -54
  824. package/node_modules/zod/v4/mini/checks.d.cts +0 -1
  825. package/node_modules/zod/v4/mini/checks.d.ts +0 -1
  826. package/node_modules/zod/v4/mini/checks.js +0 -1
  827. package/node_modules/zod/v4/mini/coerce.cjs +0 -71
  828. package/node_modules/zod/v4/mini/coerce.d.cts +0 -7
  829. package/node_modules/zod/v4/mini/coerce.d.ts +0 -7
  830. package/node_modules/zod/v4/mini/coerce.js +0 -22
  831. package/node_modules/zod/v4/mini/deep-partial.cjs +0 -58
  832. package/node_modules/zod/v4/mini/deep-partial.d.cts +0 -14
  833. package/node_modules/zod/v4/mini/deep-partial.d.ts +0 -14
  834. package/node_modules/zod/v4/mini/deep-partial.js +0 -13
  835. package/node_modules/zod/v4/mini/external.cjs +0 -95
  836. package/node_modules/zod/v4/mini/external.d.cts +0 -16
  837. package/node_modules/zod/v4/mini/external.d.ts +0 -16
  838. package/node_modules/zod/v4/mini/external.js +0 -16
  839. package/node_modules/zod/v4/mini/in-out.cjs +0 -82
  840. package/node_modules/zod/v4/mini/in-out.d.cts +0 -8
  841. package/node_modules/zod/v4/mini/in-out.d.ts +0 -8
  842. package/node_modules/zod/v4/mini/in-out.js +0 -36
  843. package/node_modules/zod/v4/mini/index.cjs +0 -51
  844. package/node_modules/zod/v4/mini/index.d.cts +0 -3
  845. package/node_modules/zod/v4/mini/index.d.ts +0 -3
  846. package/node_modules/zod/v4/mini/index.js +0 -3
  847. package/node_modules/zod/v4/mini/iso.cjs +0 -83
  848. package/node_modules/zod/v4/mini/iso.d.cts +0 -22
  849. package/node_modules/zod/v4/mini/iso.d.ts +0 -22
  850. package/node_modules/zod/v4/mini/iso.js +0 -34
  851. package/node_modules/zod/v4/mini/package.json +0 -7
  852. package/node_modules/zod/v4/mini/parse.cjs +0 -37
  853. package/node_modules/zod/v4/mini/parse.d.cts +0 -1
  854. package/node_modules/zod/v4/mini/parse.d.ts +0 -1
  855. package/node_modules/zod/v4/mini/parse.js +0 -1
  856. package/node_modules/zod/v4/mini/schemas.cjs +0 -1147
  857. package/node_modules/zod/v4/mini/schemas.d.cts +0 -480
  858. package/node_modules/zod/v4/mini/schemas.d.ts +0 -480
  859. package/node_modules/zod/v4/mini/schemas.js +0 -1002
  860. package/node_modules/zod/v4/package.json +0 -7
  861. package/node_modules/zod/v4-mini/index.cjs +0 -51
  862. package/node_modules/zod/v4-mini/index.d.cts +0 -3
  863. package/node_modules/zod/v4-mini/index.d.ts +0 -3
  864. package/node_modules/zod/v4-mini/index.js +0 -3
  865. package/node_modules/zod/v4-mini/package.json +0 -7
@@ -1,985 +0,0 @@
1
- import v8 from "node:v8";
2
- import vm from "node:vm";
3
- import { expect, test } from "vitest";
4
- import * as z from "zod/v4";
5
-
6
- test("parses a self-referential object and preserves identity", () => {
7
- const Node: any = z.object({
8
- id: z.number(),
9
- get self() {
10
- return Node;
11
- },
12
- });
13
-
14
- const input: any = { id: 1 };
15
- input.self = input;
16
-
17
- const result = Node.parse(input);
18
- expect(result.id).toBe(1);
19
- expect(result.self).toBe(result);
20
- expect(result).not.toBe(input);
21
- });
22
-
23
- test("validates a node against every schema that reaches it", () => {
24
- const A: any = z.object({
25
- x: z.string(),
26
- get b() {
27
- return B;
28
- },
29
- });
30
- const B: any = z.object({
31
- y: z.number(),
32
- get a() {
33
- return A;
34
- },
35
- });
36
-
37
- const input: any = { x: "s", y: 1 };
38
- input.b = input;
39
- input.a = input;
40
-
41
- const result = A.parse(input);
42
- expect(Object.keys(result).sort()).toEqual(["b", "x"]);
43
- expect(Object.keys(result.b).sort()).toEqual(["a", "y"]);
44
- expect(result.b.y).toBe(1);
45
- expect(result.b.a).toBe(result);
46
-
47
- const bad: any = { x: "s", y: "not a number" };
48
- bad.b = bad;
49
- bad.a = bad;
50
- expect(A.safeParse(bad).success).toBe(false);
51
- });
52
-
53
- test("breaks cycles through every container", () => {
54
- const cases: [string, () => { schema: any; input: any }][] = [
55
- [
56
- "array",
57
- () => {
58
- const S: any = z.object({
59
- id: z.number(),
60
- get kids() {
61
- return z.array(S);
62
- },
63
- });
64
- const a: any = { id: 1, kids: [] };
65
- a.kids.push(a);
66
- return { schema: S, input: a };
67
- },
68
- ],
69
- [
70
- "record",
71
- () => {
72
- const S: any = z.object({
73
- id: z.number(),
74
- get kids() {
75
- return z.record(z.string(), S);
76
- },
77
- });
78
- const a: any = { id: 1, kids: {} };
79
- a.kids.self = a;
80
- return { schema: S, input: a };
81
- },
82
- ],
83
- [
84
- "tuple",
85
- () => {
86
- const S: any = z.object({
87
- id: z.number(),
88
- get pair() {
89
- return z.tuple([z.number(), S]);
90
- },
91
- });
92
- const a: any = { id: 1 };
93
- a.pair = [1, a];
94
- return { schema: S, input: a };
95
- },
96
- ],
97
- [
98
- "set",
99
- () => {
100
- const S: any = z.object({
101
- id: z.number(),
102
- get peers() {
103
- return z.set(S);
104
- },
105
- });
106
- const a: any = { id: 1, peers: new Set() };
107
- a.peers.add(a);
108
- return { schema: S, input: a };
109
- },
110
- ],
111
- [
112
- "map",
113
- () => {
114
- const S: any = z.object({
115
- id: z.number(),
116
- get links() {
117
- return z.map(z.string(), S);
118
- },
119
- });
120
- const a: any = { id: 1, links: new Map() };
121
- a.links.set("s", a);
122
- return { schema: S, input: a };
123
- },
124
- ],
125
- [
126
- "union",
127
- () => {
128
- const S: any = z.object({
129
- id: z.number(),
130
- get self() {
131
- return z.union([z.string(), S]);
132
- },
133
- });
134
- const a: any = { id: 1 };
135
- a.self = a;
136
- return { schema: S, input: a };
137
- },
138
- ],
139
- [
140
- "discriminated union",
141
- () => {
142
- const S: any = z.discriminatedUnion("kind", [
143
- z.object({ kind: z.literal("leaf"), v: z.number() }),
144
- z.object({
145
- kind: z.literal("branch"),
146
- get next() {
147
- return S;
148
- },
149
- }),
150
- ]);
151
- const a: any = { kind: "branch" };
152
- a.next = a;
153
- return { schema: S, input: a };
154
- },
155
- ],
156
- [
157
- "lazy",
158
- () => {
159
- const S: any = z.object({ id: z.number(), self: z.lazy(() => S) });
160
- const a: any = { id: 1 };
161
- a.self = a;
162
- return { schema: S, input: a };
163
- },
164
- ],
165
- [
166
- "mutual recursion five hops apart",
167
- () => {
168
- const A: any = z.object({
169
- get b() {
170
- return B;
171
- },
172
- });
173
- const B: any = z.object({
174
- get c() {
175
- return C;
176
- },
177
- });
178
- const C: any = z.object({
179
- get d() {
180
- return D;
181
- },
182
- });
183
- const D: any = z.object({
184
- get e() {
185
- return E;
186
- },
187
- });
188
- const E: any = z.object({
189
- get a() {
190
- return A;
191
- },
192
- });
193
- const a: any = {};
194
- a.b = { c: { d: { e: { a } } } };
195
- return { schema: A, input: a };
196
- },
197
- ],
198
- ];
199
-
200
- for (const [name, build] of cases) {
201
- for (const jitless of [false, true]) {
202
- const { schema, input } = build();
203
- expect(() => schema.parse(input, { jitless }), `${name} (jitless: ${jitless})`).not.toThrow();
204
- }
205
- }
206
- });
207
-
208
- test("checks run once per node and never against a half-built object", () => {
209
- const seen: number[] = [];
210
- const Node: any = z
211
- .object({
212
- id: z.number(),
213
- get self() {
214
- return Node;
215
- },
216
- })
217
- .refine((value: any) => {
218
- seen.push(Object.keys(value).length);
219
- return true;
220
- });
221
-
222
- const input: any = { id: 1 };
223
- input.self = input;
224
- Node.parse(input);
225
-
226
- expect(seen).toEqual([2]);
227
- });
228
-
229
- test("reports a failing check inside a cycle", () => {
230
- const Node: any = z
231
- .object({
232
- id: z.number(),
233
- get self() {
234
- return Node;
235
- },
236
- })
237
- .refine((value: any) => value.id > 100, "too small");
238
-
239
- const input: any = { id: 1 };
240
- input.self = input;
241
- expect(Node.safeParse(input).success).toBe(false);
242
- });
243
-
244
- test("reports an invalid value inside a cycle once, at its own path", () => {
245
- const Node: any = z.object({
246
- id: z.number(),
247
- get self() {
248
- return Node;
249
- },
250
- });
251
-
252
- const input: any = { id: "nope" };
253
- input.self = input;
254
-
255
- const result = Node.safeParse(input);
256
- expect(result.success).toBe(false);
257
- expect(result.error!.issues).toHaveLength(1);
258
- expect(result.error!.issues[0].path).toEqual(["id"]);
259
- });
260
-
261
- test("rejects a cycle that closes through a transform", () => {
262
- const Inner: any = z.object({
263
- name: z.string(),
264
- get self() {
265
- return Wrapped;
266
- },
267
- });
268
- const Wrapped: any = Inner.transform((value: any) => ({ wrapped: value }));
269
-
270
- const input: any = { name: "x" };
271
- input.self = input;
272
-
273
- expect(() => Wrapped.parse(input)).toThrow(/reference cycle/);
274
- });
275
-
276
- test("leaves a transform that is not on the cycle alone", () => {
277
- const Node: any = z.object({
278
- n: z.number().transform((value: number) => value * 2),
279
- get self() {
280
- return Node;
281
- },
282
- });
283
-
284
- const input: any = { n: 21 };
285
- input.self = input;
286
-
287
- const result = Node.parse(input);
288
- expect(result.n).toBe(42);
289
- expect(result.self).toBe(result);
290
- });
291
-
292
- test("encodes through a cycle", () => {
293
- const Stringified = z.codec(z.string(), z.number(), {
294
- decode: (value) => Number(value),
295
- encode: (value) => String(value),
296
- });
297
- const Node: any = z.object({
298
- n: Stringified,
299
- get self() {
300
- return Node;
301
- },
302
- });
303
-
304
- const input: any = { n: 5 };
305
- input.self = input;
306
-
307
- const result: any = z.encode(Node, input);
308
- expect(result.n).toBe("5");
309
- expect(result.self).toBe(result);
310
- });
311
-
312
- test("keeps separate parses independent", () => {
313
- const Node: any = z.object({
314
- id: z.number(),
315
- get self() {
316
- return Node;
317
- },
318
- });
319
-
320
- const input: any = { id: 1 };
321
- input.self = input;
322
-
323
- const first = Node.parse(input);
324
- const second = Node.parse(input);
325
- expect(first).not.toBe(second);
326
- expect(first.self).toBe(first);
327
- expect(second.self).toBe(second);
328
-
329
- const bad: any = { id: "x" };
330
- bad.self = bad;
331
- expect(Node.safeParse(bad).success).toBe(false);
332
- expect(Node.safeParse(input).success).toBe(true);
333
- });
334
-
335
- test("parses a cycle asynchronously", async () => {
336
- const Node: any = z.object({
337
- id: z.number().refine(async (value: number) => value > 0),
338
- get self() {
339
- return Node;
340
- },
341
- });
342
-
343
- const input: any = { id: 1 };
344
- input.self = input;
345
-
346
- const result = await Node.parseAsync(input);
347
- expect(result.self).toBe(result);
348
-
349
- const bad: any = { id: -1 };
350
- bad.self = bad;
351
- expect((await Node.safeParseAsync(bad)).success).toBe(false);
352
- });
353
-
354
- test("a non-recursive schema still copies a shared reference twice", () => {
355
- const Leaf = z.object({ v: z.number() });
356
- const Pair = z.object({ a: Leaf, b: Leaf });
357
-
358
- const shared = { v: 1 };
359
- const result = Pair.parse({ a: shared, b: shared });
360
-
361
- expect(result.a).not.toBe(result.b);
362
- expect(result.a.v).toBe(1);
363
- expect(result.b.v).toBe(1);
364
- });
365
-
366
- test("a recursive schema shares one output node per input node", () => {
367
- const Node: any = z.object({
368
- v: z.number(),
369
- get kids() {
370
- return z.array(Node);
371
- },
372
- });
373
-
374
- const shared: any = { v: 1, kids: [] };
375
- const result = Node.parse({ v: 0, kids: [shared, shared] });
376
-
377
- expect(result.kids[0]).toBe(result.kids[1]);
378
- });
379
-
380
- test("sync and async agree on a shared reference", async () => {
381
- const build = (asyncCheck: boolean) => {
382
- const Node: any = z.object({
383
- v: asyncCheck ? z.number().refine(async (n: number) => n >= 0) : z.number(),
384
- get kids() {
385
- return z.array(Node);
386
- },
387
- });
388
- return Node;
389
- };
390
-
391
- const shared: any = { v: 1, kids: [] };
392
- const input = { v: 0, kids: [shared, shared] };
393
-
394
- const syncResult = build(false).parse(input);
395
- const asyncResult = await build(true).parseAsync(input);
396
-
397
- expect(syncResult.kids[0]).toBe(syncResult.kids[1]);
398
- expect(asyncResult.kids[0]).toBe(asyncResult.kids[1]);
399
- });
400
-
401
- test("a cycle through .readonly() keeps the node intact", () => {
402
- const Node: any = z.object({
403
- id: z.number(),
404
- get self() {
405
- return Node.readonly();
406
- },
407
- });
408
-
409
- const input: any = { id: 1 };
410
- input.self = input;
411
-
412
- // Freezing a node that is still being built would make its remaining keys fail to assign, silently, because generated code is not strict mode.
413
- const result = Node.parse(input);
414
- expect(Object.keys(result).sort()).toEqual(["id", "self"]);
415
- expect(result.self).toBe(result);
416
- });
417
-
418
- test("a cycle through z.intersection validates but does not mirror the graph", () => {
419
- const Node: any = z.object({
420
- id: z.number(),
421
- get self() {
422
- return z.intersection(Node, z.object({ id: z.number() }));
423
- },
424
- });
425
-
426
- const input: any = { id: 7 };
427
- input.self = input;
428
-
429
- // The merged value is built after both sides are parsed, so it cannot be the object a back-edge already resolved to. Values are right, the graph is not.
430
- const result = Node.parse(input);
431
- expect(result.id).toBe(7);
432
- expect(result.self.id).toBe(7);
433
- expect(result.self).not.toBe(result);
434
- expect(result.self.self).toBeUndefined();
435
-
436
- const bad: any = { id: "nope" };
437
- bad.self = bad;
438
- expect(Node.safeParse(bad).success).toBe(false);
439
- });
440
-
441
- test("keeps two cycles and a shared node distinct in one input", () => {
442
- const Node: any = z.object({
443
- id: z.number(),
444
- get kids() {
445
- return z.array(Node);
446
- },
447
- });
448
-
449
- const shared: any = { id: 9, kids: [] };
450
- const root: any = { id: 0, kids: [shared, shared] };
451
- root.kids.push(root);
452
-
453
- const result = Node.parse(root);
454
- expect(result.kids[0]).toBe(result.kids[1]);
455
- expect(result.kids[2]).toBe(result);
456
- });
457
-
458
- test("closes a cycle through a Map key and a Set member", () => {
459
- const Keyed: any = z.object({
460
- id: z.number(),
461
- get keyed() {
462
- return z.map(Keyed, z.string());
463
- },
464
- });
465
- const k: any = { id: 1, keyed: new Map() };
466
- k.keyed.set(k, "v");
467
- const keyedOut = Keyed.parse(k);
468
- expect([...keyedOut.keyed.keys()][0]).toBe(keyedOut);
469
-
470
- const Peered: any = z.object({
471
- id: z.number(),
472
- get peers() {
473
- return z.set(Peered);
474
- },
475
- });
476
- const p: any = { id: 1, peers: new Set() };
477
- p.peers.add(p);
478
- const peeredOut = Peered.parse(p);
479
- expect([...peeredOut.peers][0]).toBe(peeredOut);
480
- });
481
-
482
- test("does not mutate the input, and tolerates a frozen one", () => {
483
- const Node: any = z.object({
484
- id: z.number(),
485
- get self() {
486
- return Node;
487
- },
488
- });
489
-
490
- const input: any = { id: 1 };
491
- input.self = input;
492
- Object.freeze(input);
493
-
494
- const result = Node.parse(input);
495
- expect(result).not.toBe(input);
496
- expect(result.self).toBe(result);
497
- expect(Reflect.ownKeys(input)).toEqual(["id", "self"]);
498
- });
499
-
500
- test("keys identity on the schema, not just the input", () => {
501
- const Node: any = z.object({
502
- id: z.number(),
503
- get self() {
504
- return Node.optional();
505
- },
506
- });
507
- const Partial: any = Node.partial();
508
-
509
- const input: any = { id: 1 };
510
- input.self = input;
511
-
512
- // `Partial` and `Node` are different schemas, so the root and the node its cycle points back to are different output objects. Same rule that lets one input node be validated against two schemas in mutual recursion.
513
- const result = Partial.parse(input);
514
- expect(result.self).not.toBe(result);
515
- expect(result.self.self).toBe(result.self);
516
- expect(result.id).toBe(1);
517
- expect(result.self.id).toBe(1);
518
- });
519
-
520
- test("keeps concurrent async parses of one schema independent", async () => {
521
- const Node: any = z.object({
522
- id: z.number().refine(async (n: number) => {
523
- await new Promise((r) => setTimeout(r, 5 + (n % 3)));
524
- return true;
525
- }),
526
- get self() {
527
- return Node;
528
- },
529
- });
530
-
531
- const make = (id: number) => {
532
- const o: any = { id };
533
- o.self = o;
534
- return o;
535
- };
536
-
537
- const [a, b, c] = await Promise.all([Node.parseAsync(make(1)), Node.parseAsync(make(2)), Node.parseAsync(make(3))]);
538
-
539
- expect([a.id, b.id, c.id]).toEqual([1, 2, 3]);
540
- expect(a.self).toBe(a);
541
- expect(b.self).toBe(b);
542
- expect(c.self).toBe(c);
543
- });
544
-
545
- test("runs checks once per reference, as it does without a cycle", () => {
546
- let calls = 0;
547
- const Node: any = z
548
- .object({
549
- id: z.number(),
550
- get kids() {
551
- return z.array(Node);
552
- },
553
- })
554
- .refine(() => {
555
- calls++;
556
- return true;
557
- });
558
-
559
- const shared: any = { id: 1, kids: [] };
560
- Node.parse({ id: 0, kids: [shared, shared] });
561
-
562
- // Memoization skips the container's parse, not the checks layered on it.
563
- expect(calls).toBe(3);
564
- });
565
-
566
- test("a schema wrapped at the root adds one node and no more", () => {
567
- const Node: any = z.object({
568
- id: z.number(),
569
- get self() {
570
- return Node.optional();
571
- },
572
- });
573
-
574
- const input: any = { id: 1 };
575
- input.self = input;
576
-
577
- // The root is keyed on the wrapper, everything under it on `Node`, so the graph closes one level down rather than at the root. It does not compound: stacking wrappers still yields exactly two nodes.
578
- const count = (root: any) => {
579
- const seen: any[] = [];
580
- let n = root;
581
- while (n && !seen.includes(n)) {
582
- seen.push(n);
583
- n = n.self;
584
- }
585
- return seen.length;
586
- };
587
-
588
- expect(count(Node.parse(input))).toBe(1);
589
- expect(count(Node.partial().parse(input))).toBe(2);
590
- expect(count(Node.partial().partial().parse(input))).toBe(2);
591
- expect(count(Node.extend({ extra: z.string().optional() }).parse(input))).toBe(2);
592
- });
593
-
594
- test("resolves a recursive reference once, however it is written", () => {
595
- // This is what bounds the above: core caches a shape getter and a lazy getter, so a getter returning a fresh clone still yields a finite schema graph rather than a new schema per node.
596
- let getterCalls = 0;
597
- const ViaGetter: any = z.object({
598
- id: z.number(),
599
- get self() {
600
- getterCalls++;
601
- return ViaGetter.partial();
602
- },
603
- });
604
-
605
- let lazyCalls = 0;
606
- const ViaLazy: any = z.object({
607
- id: z.number(),
608
- self: z.lazy(() => {
609
- lazyCalls++;
610
- return ViaLazy.partial();
611
- }),
612
- });
613
-
614
- const input: any = { id: 1 };
615
- input.self = input;
616
-
617
- expect(() => ViaGetter.parse(input)).not.toThrow();
618
- expect(() => ViaLazy.parse(input)).not.toThrow();
619
- expect(getterCalls).toBe(1);
620
- expect(lazyCalls).toBe(1);
621
- });
622
-
623
- // The second visitor of a shared node must not prefix onto the first visitor's path.
624
- test.each([false, true])("prefixes a shared node's issues once per reference (jitless: %s)", (jitless) => {
625
- z.config({ jitless });
626
- try {
627
- const Node: any = z.object({
628
- name: z.string(),
629
- get left() {
630
- return z.optional(Node);
631
- },
632
- get right() {
633
- return z.optional(Node);
634
- },
635
- });
636
-
637
- const shared: any = { name: 123 };
638
- const result = Node.safeParse({ name: "root", left: shared, right: shared });
639
-
640
- expect(result.success).toBe(false);
641
- expect(result.error.issues.map((iss: any) => iss.path)).toEqual([
642
- ["left", "name"],
643
- ["right", "name"],
644
- ]);
645
- } finally {
646
- z.config({ jitless: false });
647
- }
648
- });
649
-
650
- test("the default memoizer is installed before the first container reads it", () => {
651
- // the delete manufactures the fresh-process state; a container with only getter keys then constructs no leaf before the config read
652
- delete z.config().memoizer;
653
- const Node: any = z.object({
654
- get self() {
655
- return Node;
656
- },
657
- });
658
- const input: any = {};
659
- input.self = input;
660
- const out = Node.parse(input);
661
- expect(out.self).toBe(out);
662
- });
663
-
664
- test("guards a transform built before any container", () => {
665
- // the guard attaches at construction, so a transform predating the first container must still get the default
666
- delete z.config().memoizer;
667
- const wrap = z.transform((value: any) => ({ wrapped: value }));
668
- const Inner: any = z.object({
669
- name: z.string(),
670
- get self() {
671
- return Wrapped;
672
- },
673
- });
674
- const Wrapped: any = z.pipe(Inner, wrap);
675
-
676
- const input: any = { name: "x" };
677
- input.self = input;
678
-
679
- expect(() => Wrapped.parse(input)).toThrow(/reference cycle/);
680
- });
681
-
682
- test("detects a cycle reachable only through a merged catchall", () => {
683
- const Cyclic: any = z.object({
684
- id: z.string(),
685
- get next() {
686
- return z.optional(Root);
687
- },
688
- });
689
- const Root: any = z.object({ tag: z.string() }).merge(z.object({}).catchall(Cyclic));
690
-
691
- const input: any = { tag: "root" };
692
- input.child = { id: "1", next: input };
693
-
694
- const out: any = Root.parse(input);
695
- expect(out.child.next).toBe(out);
696
- });
697
-
698
- // the per-type switch can only enumerate kinds Zod ships, so an unknown `def.type` falls back to scanning the def; without it a cycle through a third-party container overflows the stack
699
- test("detects a cycle through a user-defined container type", () => {
700
- const MyBox: any = z.core.$constructor("MyBox", (inst: any, def: any) => {
701
- z.core.$ZodType.init(inst, def);
702
- inst._zod.parse = (payload: any, ctx: any) => {
703
- if (payload.value === null || typeof payload.value !== "object") return payload;
704
- const inner = def.inner._zod.run({ value: payload.value.v, issues: [] }, ctx);
705
- payload.value = { v: inner.value };
706
- return payload;
707
- };
708
- });
709
-
710
- const Node: any = z.object({
711
- id: z.string(),
712
- get boxed() {
713
- return z.optional(new MyBox({ type: "mybox", inner: z.lazy(() => Node) }));
714
- },
715
- });
716
-
717
- const input: any = { id: "1" };
718
- input.boxed = { v: input };
719
-
720
- const out: any = Node.parse(input);
721
- expect(out.boxed.v).toBe(out);
722
- });
723
-
724
- // #6526: a factory returns fresh instances, so the identity walk never revisits a node; it descends until the stack overflows unless it stops at the deferred edge
725
- test("parses a factory-built recursive schema", () => {
726
- const Node = (): any =>
727
- z.object({
728
- id: z.number(),
729
- get kids() {
730
- return z.array(Node());
731
- },
732
- });
733
-
734
- const S = z.object({ root: Node() });
735
- const out = S.parse({ root: { id: 1, kids: [{ id: 2, kids: [] }] } });
736
- expect(out.root.kids[0].id).toBe(2);
737
- expect(S.safeParse({ root: { id: 1, kids: [{ id: "x", kids: [] }] } }).success).toBe(false);
738
- });
739
-
740
- test("parses a factory-built recursive discriminated union at the root and nested", () => {
741
- const Geometry = (): any =>
742
- z.discriminatedUnion("type", [
743
- z.object({ type: z.literal("Point"), coordinates: z.array(z.number()) }),
744
- z.looseObject({
745
- type: z.literal("GeometryCollection"),
746
- get geometries() {
747
- return z.array(Geometry());
748
- },
749
- }),
750
- ]);
751
-
752
- const collection = { type: "GeometryCollection", geometries: [{ type: "Point", coordinates: [1, 2] }] };
753
- expect(Geometry().parse(collection).geometries[0].coordinates).toEqual([1, 2]);
754
- expect(z.object({ g: Geometry() }).parse({ g: collection }).g.type).toBe("GeometryCollection");
755
- });
756
-
757
- test("the walk reports a cycle for a deferred edge instead of resolving it", () => {
758
- const Node = (): any =>
759
- z.object({
760
- get self() {
761
- return Node();
762
- },
763
- });
764
- expect(z.core.isRecursiveSchema(Node())).toBe(true);
765
-
766
- // conservative by design: a getter that closes no cycle is reported too, and pays only the memoizer it keeps
767
- const Leaf = z.object({ id: z.string() });
768
- const forward: any = z.object({
769
- get leaf() {
770
- return Leaf;
771
- },
772
- });
773
- expect(z.core.isRecursiveSchema(forward)).toBe(true);
774
-
775
- // a lazy is followed one hop, which is what lets z.compile see past it; past that hop it is deferred like any other edge
776
- expect(z.core.isRecursiveSchema(z.lazy(() => Leaf) as any)).toBe(false);
777
- expect(z.core.isRecursiveSchema(z.lazy(() => z.lazy(() => Leaf)) as any)).toBe(true);
778
- });
779
-
780
- // the builders answer `shape` from an accessor that resolves the source's getters, so the walk has to reach the source schema itself
781
- test("parses a factory-built recursive schema through every object builder", () => {
782
- const wraps: [string, (base: () => any) => any][] = [
783
- ["extend", (b) => b().extend({ x: z.string() })],
784
- ["safeExtend", (b) => b().safeExtend({ x: z.string() })],
785
- ["merge", (b) => z.object({ x: z.string() }).merge(b())],
786
- ["partial", (b) => b().partial()],
787
- ["required", (b) => b().required()],
788
- ["pick", (b) => b().pick({ self: true })],
789
- ["omit", (b) => b().omit({ y: true })],
790
- ["chained", (b) => b().extend({ x: z.string() }).partial()],
791
- // rebuilds the def without touching the shape, so the clone carries the source's accessor rather than a shape of its own
792
- ["strict", (b) => b().extend({ x: z.string() }).strict()],
793
- ["catchall", (b) => b().extend({ x: z.string() }).catchall(z.unknown())],
794
- ["meta", (b) => b().extend({ x: z.string() }).meta({ id: "node" })],
795
- ];
796
-
797
- for (const [name, wrap] of wraps) {
798
- const Node = (): any =>
799
- wrap(() =>
800
- z.object({
801
- y: z.string(),
802
- get self() {
803
- return z.optional(Node());
804
- },
805
- })
806
- );
807
- const S = z.object({ r: Node() });
808
- for (const attempt of ["first", "second"]) {
809
- expect(() => S.safeParse({ r: { y: "s", x: "s" } }), `${name} (${attempt} parse)`).not.toThrow();
810
- }
811
- }
812
- });
813
-
814
- test("an ordinary builder stays exact, so it still compiles", () => {
815
- const plain = z.object({ a: z.string(), b: z.number() });
816
- const derived: [string, any][] = [
817
- ["extend", plain.extend({ c: z.boolean() })],
818
- ["merge", plain.merge(z.object({ d: z.string() }))],
819
- ["partial", plain.partial()],
820
- ["required", plain.partial().required()],
821
- ["pick", plain.pick({ a: true })],
822
- ["omit", plain.omit({ a: true })],
823
- ["strict", plain.extend({ c: z.boolean() }).strict()],
824
- ["catchall", plain.extend({ c: z.boolean() }).catchall(z.unknown())],
825
- ["meta", plain.extend({ c: z.boolean() }).meta({ id: "plain" })],
826
- ];
827
- for (const [name, schema] of derived) {
828
- expect(z.core.isRecursiveSchema(schema), name).toBe(false);
829
- expect(() => z.compile(schema, { strict: true }), name).not.toThrow();
830
- }
831
- });
832
-
833
- // a derived shape mirrors its source's descriptors, so dropping or overwriting the key that carries the cycle leaves nothing deferred and the walk is exact before anything parses
834
- test("a builder that drops the recursive key ends up exact", () => {
835
- const Node: any = z.object({
836
- id: z.number(),
837
- get self() {
838
- return z.optional(Node);
839
- },
840
- });
841
-
842
- const derived: [string, any, any][] = [
843
- ["omit", Node.omit({ self: true }), { id: 1 }],
844
- ["pick", Node.pick({ id: true }), { id: 1 }],
845
- ["extend overwrites it", Node.extend({ self: z.string() }), { id: 1, self: "x" }],
846
- ];
847
- for (const [name, schema, input] of derived) {
848
- expect(z.core.isRecursiveSchema(schema), name).toBe(false);
849
- expect(() => z.compile(schema, { strict: true }), name).not.toThrow();
850
- expect(schema.parse(input), name).toEqual(input);
851
- }
852
-
853
- // the branch that stays is still found
854
- const kept = Node.extend({ x: z.string() });
855
- expect(z.core.isRecursiveSchema(kept)).toBe(true);
856
- });
857
-
858
- // resolving a lazy runs user code, which can re-enter the walk; a walk that kept its certainty outside its own frames would have the inner one clobber the outer
859
- test("a nested walk can't corrupt the one that resolved into it", () => {
860
- const Node: any = z.object({
861
- id: z.number(),
862
- self: z.lazy(() => {
863
- z.compile(z.string(), { strict: true });
864
- return z.optional(Node);
865
- }),
866
- });
867
-
868
- const omitted = Node.omit({ self: true });
869
- // exact before anything parses: the mirrored shape kept only `id`, so nothing here is deferred
870
- expect(z.core.isRecursiveSchema(omitted)).toBe(false);
871
- omitted.parse({ id: 1 });
872
- expect(z.core.isRecursiveSchema(omitted)).toBe(false);
873
- expect(() => z.compile(omitted, { strict: true })).not.toThrow();
874
-
875
- const shared = { id: 1 };
876
- const out: any = z.object({ a: omitted, b: omitted }).parse({ a: shared, b: shared });
877
- expect(out.a).not.toBe(out.b);
878
- expect(z.core.isRecursiveSchema(Node)).toBe(true);
879
- });
880
-
881
- test("detects a cycle that closes through a builder", () => {
882
- const Node: any = z
883
- .object({
884
- id: z.number(),
885
- get self() {
886
- return z.optional(Node);
887
- },
888
- })
889
- .extend({ x: z.string() });
890
-
891
- const input: any = { id: 1, x: "s" };
892
- input.self = input;
893
- const out = Node.parse(input);
894
- expect(out.self).toBe(out);
895
- });
896
-
897
- test("a deferred edge stops being assumed a cycle once the graph resolves", () => {
898
- const Leaf = z.object({ n: z.number() });
899
- const Forward: any = z.object({
900
- get a() {
901
- return Leaf;
902
- },
903
- });
904
- expect(z.core.isRecursiveSchema(Forward)).toBe(true);
905
- Forward.parse({ a: { n: 1 } });
906
- // the parse resolved the getter, so the walk can follow it and drop the assumption
907
- expect(z.core.isRecursiveSchema(Forward)).toBe(false);
908
-
909
- // a factory hands back a fresh subtree every time, so no parse ever resolves it into a finite graph
910
- const Node = (): any =>
911
- z.object({
912
- get kids() {
913
- return z.array(Node());
914
- },
915
- });
916
- const Generated = Node();
917
- expect(z.core.isRecursiveSchema(Generated)).toBe(true);
918
- Generated.parse({ kids: [] });
919
- expect(z.core.isRecursiveSchema(Generated)).toBe(true);
920
-
921
- // a lazy that closes a real cycle stays recursive however often it resolves
922
- const Cyclic: any = z.object({ id: z.number(), self: z.lazy(() => z.optional(Cyclic)) });
923
- Cyclic.parse({ id: 1 });
924
- expect(z.core.isRecursiveSchema(Cyclic)).toBe(true);
925
- });
926
-
927
- // `z.object` resolves its shape by spread, so a non-enumerable key is no part of it
928
- test("a non-enumerable key does not count for z.object", () => {
929
- const object = (enumerable: boolean) => {
930
- const shape: Record<string, any> = { id: z.number() };
931
- const O: any = z.object(shape);
932
- Object.defineProperty(shape, "next", { value: z.lazy(() => z.optional(O)), enumerable, configurable: true });
933
- return O;
934
- };
935
- expect(z.core.isRecursiveSchema(object(true))).toBe(true);
936
- // the spread drops it, so nothing can ever parse it
937
- expect(z.core.isRecursiveSchema(object(false))).toBe(false);
938
- });
939
-
940
- test("the walk stays exact where nothing is deferred", () => {
941
- let deep: any = z.string();
942
- for (let i = 0; i < 300; i++) deep = z.object({ v: deep });
943
- expect(z.core.isRecursiveSchema(deep)).toBe(false);
944
- });
945
-
946
- test("parses a factory-built recursive schema through z.lazy", () => {
947
- const Node = (): any =>
948
- z.object({
949
- id: z.number(),
950
- child: z.lazy(() => z.optional(Node())),
951
- });
952
-
953
- const out = z.object({ root: Node() }).parse({ root: { id: 1, child: { id: 2, child: undefined } } });
954
- expect(out.root.child.id).toBe(2);
955
- });
956
-
957
- test("a finished parse pins nothing on the schema", async () => {
958
- // es2020 is the target, and its lib predates WeakRef
959
- type Weak<T extends object> = { deref(): T | undefined };
960
- const { WeakRef: Weak } = globalThis as unknown as { WeakRef: new <T extends object>(target: T) => Weak<T> };
961
- // vitest carries no --expose-gc, so reach the collector the way node's own tests do
962
- v8.setFlagsFromString("--expose-gc");
963
- const gc = vm.runInNewContext("gc") as () => void;
964
-
965
- const Node: any = z.object({
966
- id: z.number(),
967
- get next() {
968
- return z.optional(Node);
969
- },
970
- });
971
-
972
- const ref = ((): Weak<object> => {
973
- const input = { id: 1, next: { id: 2, next: undefined } };
974
- Node.parse(input);
975
- return new Weak(input);
976
- })();
977
-
978
- for (let attempt = 0; attempt < 10 && ref.deref(); attempt++) {
979
- // the input stays on the stack until a macrotask boundary
980
- await new Promise((resolve) => setTimeout(resolve, 0));
981
- gc();
982
- }
983
-
984
- expect(ref.deref()).toBeUndefined();
985
- });