zod-compiler 1.23.0 → 1.23.2

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 (494) hide show
  1. package/README.md +9 -6
  2. package/dist/cli/commands/check.d.ts +10 -7
  3. package/dist/cli/commands/check.d.ts.map +1 -1
  4. package/dist/cli/commands/check.js +125 -148
  5. package/dist/cli/commands/check.js.map +1 -1
  6. package/dist/cli/commands/generate.d.ts +22 -19
  7. package/dist/cli/commands/generate.d.ts.map +1 -1
  8. package/dist/cli/commands/generate.js +102 -133
  9. package/dist/cli/commands/generate.js.map +1 -1
  10. package/dist/cli/commands/watch.d.ts +17 -15
  11. package/dist/cli/commands/watch.d.ts.map +1 -1
  12. package/dist/cli/commands/watch.js +126 -154
  13. package/dist/cli/commands/watch.js.map +1 -1
  14. package/dist/cli/emitter.d.ts +19 -16
  15. package/dist/cli/emitter.d.ts.map +1 -1
  16. package/dist/cli/emitter.js +55 -71
  17. package/dist/cli/emitter.js.map +1 -1
  18. package/dist/cli/errors.d.ts +4 -1
  19. package/dist/cli/errors.d.ts.map +1 -1
  20. package/dist/cli/errors.js +6 -2
  21. package/dist/cli/errors.js.map +1 -1
  22. package/dist/cli/index.d.ts +1 -3
  23. package/dist/cli/index.js +147 -160
  24. package/dist/cli/index.js.map +1 -1
  25. package/dist/cli/logger.d.ts +18 -15
  26. package/dist/cli/logger.d.ts.map +1 -1
  27. package/dist/cli/logger.js +38 -37
  28. package/dist/cli/logger.js.map +1 -1
  29. package/dist/core/codegen/build-path.d.ts +7 -41
  30. package/dist/core/codegen/build-path.d.ts.map +1 -1
  31. package/dist/core/codegen/build-path.js +481 -570
  32. package/dist/core/codegen/build-path.js.map +1 -1
  33. package/dist/core/codegen/context.d.ts +256 -253
  34. package/dist/core/codegen/context.d.ts.map +1 -1
  35. package/dist/core/codegen/context.js +363 -437
  36. package/dist/core/codegen/context.js.map +1 -1
  37. package/dist/core/codegen/dedupe.d.ts +22 -56
  38. package/dist/core/codegen/dedupe.d.ts.map +1 -1
  39. package/dist/core/codegen/dedupe.js +150 -242
  40. package/dist/core/codegen/dedupe.js.map +1 -1
  41. package/dist/core/codegen/emit-issue.d.ts +44 -68
  42. package/dist/core/codegen/emit-issue.d.ts.map +1 -1
  43. package/dist/core/codegen/emit-issue.js +76 -108
  44. package/dist/core/codegen/emit-issue.js.map +1 -1
  45. package/dist/core/codegen/emit.d.ts +4 -1
  46. package/dist/core/codegen/emit.d.ts.map +1 -1
  47. package/dist/core/codegen/emit.js +16 -13
  48. package/dist/core/codegen/emit.js.map +1 -1
  49. package/dist/core/codegen/fast-path.d.ts +7 -12
  50. package/dist/core/codegen/fast-path.d.ts.map +1 -1
  51. package/dist/core/codegen/fast-path.js +116 -145
  52. package/dist/core/codegen/fast-path.js.map +1 -1
  53. package/dist/core/codegen/fast-size.d.ts +12 -26
  54. package/dist/core/codegen/fast-size.d.ts.map +1 -1
  55. package/dist/core/codegen/fast-size.js +169 -244
  56. package/dist/core/codegen/fast-size.js.map +1 -1
  57. package/dist/core/codegen/index.d.ts +25 -23
  58. package/dist/core/codegen/index.d.ts.map +1 -1
  59. package/dist/core/codegen/index.js +239 -405
  60. package/dist/core/codegen/index.js.map +1 -1
  61. package/dist/core/codegen/issue-decls.d.ts +15 -12
  62. package/dist/core/codegen/issue-decls.d.ts.map +1 -1
  63. package/dist/core/codegen/issue-decls.js +131 -162
  64. package/dist/core/codegen/issue-decls.js.map +1 -1
  65. package/dist/core/codegen/regex-unroll.d.ts +4 -1
  66. package/dist/core/codegen/regex-unroll.d.ts.map +1 -1
  67. package/dist/core/codegen/regex-unroll.js +173 -197
  68. package/dist/core/codegen/regex-unroll.js.map +1 -1
  69. package/dist/core/codegen/schemas/any.d.ts +7 -4
  70. package/dist/core/codegen/schemas/any.d.ts.map +1 -1
  71. package/dist/core/codegen/schemas/any.js +8 -4
  72. package/dist/core/codegen/schemas/any.js.map +1 -1
  73. package/dist/core/codegen/schemas/array.d.ts +8 -5
  74. package/dist/core/codegen/schemas/array.d.ts.map +1 -1
  75. package/dist/core/codegen/schemas/array.js +77 -95
  76. package/dist/core/codegen/schemas/array.js.map +1 -1
  77. package/dist/core/codegen/schemas/bigint.d.ts +7 -4
  78. package/dist/core/codegen/schemas/bigint.d.ts.map +1 -1
  79. package/dist/core/codegen/schemas/bigint.js +44 -56
  80. package/dist/core/codegen/schemas/bigint.js.map +1 -1
  81. package/dist/core/codegen/schemas/boolean.d.ts +7 -4
  82. package/dist/core/codegen/schemas/boolean.d.ts.map +1 -1
  83. package/dist/core/codegen/schemas/boolean.js +12 -11
  84. package/dist/core/codegen/schemas/boolean.js.map +1 -1
  85. package/dist/core/codegen/schemas/catch.d.ts +8 -5
  86. package/dist/core/codegen/schemas/catch.d.ts.map +1 -1
  87. package/dist/core/codegen/schemas/catch.js +23 -23
  88. package/dist/core/codegen/schemas/catch.js.map +1 -1
  89. package/dist/core/codegen/schemas/date.d.ts +7 -4
  90. package/dist/core/codegen/schemas/date.d.ts.map +1 -1
  91. package/dist/core/codegen/schemas/date.js +49 -68
  92. package/dist/core/codegen/schemas/date.js.map +1 -1
  93. package/dist/core/codegen/schemas/default.d.ts +9 -6
  94. package/dist/core/codegen/schemas/default.d.ts.map +1 -1
  95. package/dist/core/codegen/schemas/default.js +29 -27
  96. package/dist/core/codegen/schemas/default.js.map +1 -1
  97. package/dist/core/codegen/schemas/discriminated-union.d.ts +12 -10
  98. package/dist/core/codegen/schemas/discriminated-union.d.ts.map +1 -1
  99. package/dist/core/codegen/schemas/discriminated-union.js +153 -178
  100. package/dist/core/codegen/schemas/discriminated-union.js.map +1 -1
  101. package/dist/core/codegen/schemas/effect.d.ts +9 -6
  102. package/dist/core/codegen/schemas/effect.d.ts.map +1 -1
  103. package/dist/core/codegen/schemas/effect.js +54 -67
  104. package/dist/core/codegen/schemas/effect.js.map +1 -1
  105. package/dist/core/codegen/schemas/enum.d.ts +7 -4
  106. package/dist/core/codegen/schemas/enum.d.ts.map +1 -1
  107. package/dist/core/codegen/schemas/enum.js +15 -21
  108. package/dist/core/codegen/schemas/enum.js.map +1 -1
  109. package/dist/core/codegen/schemas/fallback.d.ts +6 -3
  110. package/dist/core/codegen/schemas/fallback.d.ts.map +1 -1
  111. package/dist/core/codegen/schemas/fallback.js +14 -13
  112. package/dist/core/codegen/schemas/fallback.js.map +1 -1
  113. package/dist/core/codegen/schemas/file.d.ts +7 -4
  114. package/dist/core/codegen/schemas/file.d.ts.map +1 -1
  115. package/dist/core/codegen/schemas/file.js +51 -57
  116. package/dist/core/codegen/schemas/file.js.map +1 -1
  117. package/dist/core/codegen/schemas/intersection.d.ts +8 -5
  118. package/dist/core/codegen/schemas/intersection.d.ts.map +1 -1
  119. package/dist/core/codegen/schemas/intersection.js +16 -13
  120. package/dist/core/codegen/schemas/intersection.js.map +1 -1
  121. package/dist/core/codegen/schemas/literal.d.ts +7 -4
  122. package/dist/core/codegen/schemas/literal.d.ts.map +1 -1
  123. package/dist/core/codegen/schemas/literal.js +20 -23
  124. package/dist/core/codegen/schemas/literal.js.map +1 -1
  125. package/dist/core/codegen/schemas/map.d.ts +8 -5
  126. package/dist/core/codegen/schemas/map.d.ts.map +1 -1
  127. package/dist/core/codegen/schemas/map.js +61 -67
  128. package/dist/core/codegen/schemas/map.js.map +1 -1
  129. package/dist/core/codegen/schemas/nan.d.ts +7 -4
  130. package/dist/core/codegen/schemas/nan.d.ts.map +1 -1
  131. package/dist/core/codegen/schemas/nan.js +8 -4
  132. package/dist/core/codegen/schemas/nan.js.map +1 -1
  133. package/dist/core/codegen/schemas/never.d.ts +7 -4
  134. package/dist/core/codegen/schemas/never.d.ts.map +1 -1
  135. package/dist/core/codegen/schemas/never.js +8 -4
  136. package/dist/core/codegen/schemas/never.js.map +1 -1
  137. package/dist/core/codegen/schemas/null.d.ts +7 -4
  138. package/dist/core/codegen/schemas/null.d.ts.map +1 -1
  139. package/dist/core/codegen/schemas/null.js +8 -4
  140. package/dist/core/codegen/schemas/null.js.map +1 -1
  141. package/dist/core/codegen/schemas/nullable.d.ts +8 -5
  142. package/dist/core/codegen/schemas/nullable.d.ts.map +1 -1
  143. package/dist/core/codegen/schemas/nullable.js +8 -5
  144. package/dist/core/codegen/schemas/nullable.js.map +1 -1
  145. package/dist/core/codegen/schemas/number.d.ts +7 -4
  146. package/dist/core/codegen/schemas/number.d.ts.map +1 -1
  147. package/dist/core/codegen/schemas/number.js +120 -176
  148. package/dist/core/codegen/schemas/number.js.map +1 -1
  149. package/dist/core/codegen/schemas/object.d.ts +8 -5
  150. package/dist/core/codegen/schemas/object.d.ts.map +1 -1
  151. package/dist/core/codegen/schemas/object.js +144 -231
  152. package/dist/core/codegen/schemas/object.js.map +1 -1
  153. package/dist/core/codegen/schemas/optional.d.ts +9 -6
  154. package/dist/core/codegen/schemas/optional.d.ts.map +1 -1
  155. package/dist/core/codegen/schemas/optional.js +23 -31
  156. package/dist/core/codegen/schemas/optional.js.map +1 -1
  157. package/dist/core/codegen/schemas/pipe.d.ts +8 -5
  158. package/dist/core/codegen/schemas/pipe.d.ts.map +1 -1
  159. package/dist/core/codegen/schemas/pipe.js +20 -27
  160. package/dist/core/codegen/schemas/pipe.js.map +1 -1
  161. package/dist/core/codegen/schemas/readonly.d.ts +8 -5
  162. package/dist/core/codegen/schemas/readonly.d.ts.map +1 -1
  163. package/dist/core/codegen/schemas/readonly.js +8 -5
  164. package/dist/core/codegen/schemas/readonly.js.map +1 -1
  165. package/dist/core/codegen/schemas/record.d.ts +8 -5
  166. package/dist/core/codegen/schemas/record.d.ts.map +1 -1
  167. package/dist/core/codegen/schemas/record.js +52 -65
  168. package/dist/core/codegen/schemas/record.js.map +1 -1
  169. package/dist/core/codegen/schemas/recursive-ref.d.ts +9 -6
  170. package/dist/core/codegen/schemas/recursive-ref.d.ts.map +1 -1
  171. package/dist/core/codegen/schemas/recursive-ref.js +44 -44
  172. package/dist/core/codegen/schemas/recursive-ref.js.map +1 -1
  173. package/dist/core/codegen/schemas/set.d.ts +8 -5
  174. package/dist/core/codegen/schemas/set.d.ts.map +1 -1
  175. package/dist/core/codegen/schemas/set.js +61 -73
  176. package/dist/core/codegen/schemas/set.js.map +1 -1
  177. package/dist/core/codegen/schemas/string-bool.d.ts +6 -3
  178. package/dist/core/codegen/schemas/string-bool.d.ts.map +1 -1
  179. package/dist/core/codegen/schemas/string-bool.js +22 -23
  180. package/dist/core/codegen/schemas/string-bool.js.map +1 -1
  181. package/dist/core/codegen/schemas/string.d.ts +8 -5
  182. package/dist/core/codegen/schemas/string.d.ts.map +1 -1
  183. package/dist/core/codegen/schemas/string.js +168 -207
  184. package/dist/core/codegen/schemas/string.js.map +1 -1
  185. package/dist/core/codegen/schemas/symbol.d.ts +7 -4
  186. package/dist/core/codegen/schemas/symbol.d.ts.map +1 -1
  187. package/dist/core/codegen/schemas/symbol.js +8 -4
  188. package/dist/core/codegen/schemas/symbol.js.map +1 -1
  189. package/dist/core/codegen/schemas/template-literal.d.ts +7 -4
  190. package/dist/core/codegen/schemas/template-literal.d.ts.map +1 -1
  191. package/dist/core/codegen/schemas/template-literal.js +12 -13
  192. package/dist/core/codegen/schemas/template-literal.js.map +1 -1
  193. package/dist/core/codegen/schemas/tuple.d.ts +8 -5
  194. package/dist/core/codegen/schemas/tuple.d.ts.map +1 -1
  195. package/dist/core/codegen/schemas/tuple.js +84 -94
  196. package/dist/core/codegen/schemas/tuple.js.map +1 -1
  197. package/dist/core/codegen/schemas/undefined.d.ts +7 -4
  198. package/dist/core/codegen/schemas/undefined.d.ts.map +1 -1
  199. package/dist/core/codegen/schemas/undefined.js +8 -4
  200. package/dist/core/codegen/schemas/undefined.js.map +1 -1
  201. package/dist/core/codegen/schemas/union.d.ts +8 -5
  202. package/dist/core/codegen/schemas/union.d.ts.map +1 -1
  203. package/dist/core/codegen/schemas/union.js +49 -69
  204. package/dist/core/codegen/schemas/union.js.map +1 -1
  205. package/dist/core/codegen/schemas/unknown.d.ts +7 -4
  206. package/dist/core/codegen/schemas/unknown.d.ts.map +1 -1
  207. package/dist/core/codegen/schemas/unknown.js +8 -4
  208. package/dist/core/codegen/schemas/unknown.js.map +1 -1
  209. package/dist/core/codegen/schemas/void.d.ts +7 -4
  210. package/dist/core/codegen/schemas/void.d.ts.map +1 -1
  211. package/dist/core/codegen/schemas/void.js +8 -4
  212. package/dist/core/codegen/schemas/void.js.map +1 -1
  213. package/dist/core/codegen/slow-path.d.ts +7 -4
  214. package/dist/core/codegen/slow-path.d.ts.map +1 -1
  215. package/dist/core/codegen/slow-path.js +71 -96
  216. package/dist/core/codegen/slow-path.js.map +1 -1
  217. package/dist/core/codegen/well-known-regex.d.ts +22 -19
  218. package/dist/core/codegen/well-known-regex.d.ts.map +1 -1
  219. package/dist/core/codegen/well-known-regex.js +127 -96
  220. package/dist/core/codegen/well-known-regex.js.map +1 -1
  221. package/dist/core/compile.d.ts +7 -4
  222. package/dist/core/compile.d.ts.map +1 -1
  223. package/dist/core/compile.js +48 -48
  224. package/dist/core/compile.js.map +1 -1
  225. package/dist/core/diagnostic.d.ts +38 -39
  226. package/dist/core/diagnostic.d.ts.map +1 -1
  227. package/dist/core/diagnostic.js +140 -164
  228. package/dist/core/diagnostic.js.map +1 -1
  229. package/dist/core/extract/checks.d.ts +18 -15
  230. package/dist/core/extract/checks.d.ts.map +1 -1
  231. package/dist/core/extract/checks.js +318 -311
  232. package/dist/core/extract/checks.js.map +1 -1
  233. package/dist/core/extract/effects.d.ts +13 -10
  234. package/dist/core/extract/effects.d.ts.map +1 -1
  235. package/dist/core/extract/effects.js +153 -222
  236. package/dist/core/extract/effects.js.map +1 -1
  237. package/dist/core/extract/extractors/any.d.ts +5 -2
  238. package/dist/core/extract/extractors/any.d.ts.map +1 -1
  239. package/dist/core/extract/extractors/any.js +5 -1
  240. package/dist/core/extract/extractors/any.js.map +1 -1
  241. package/dist/core/extract/extractors/array.d.ts +6 -3
  242. package/dist/core/extract/extractors/array.d.ts.map +1 -1
  243. package/dist/core/extract/extractors/array.js +25 -20
  244. package/dist/core/extract/extractors/array.js.map +1 -1
  245. package/dist/core/extract/extractors/bigint.d.ts +6 -3
  246. package/dist/core/extract/extractors/bigint.d.ts.map +1 -1
  247. package/dist/core/extract/extractors/bigint.js +66 -64
  248. package/dist/core/extract/extractors/bigint.js.map +1 -1
  249. package/dist/core/extract/extractors/boolean.d.ts +5 -2
  250. package/dist/core/extract/extractors/boolean.d.ts.map +1 -1
  251. package/dist/core/extract/extractors/boolean.js +7 -3
  252. package/dist/core/extract/extractors/boolean.js.map +1 -1
  253. package/dist/core/extract/extractors/catch.d.ts +6 -3
  254. package/dist/core/extract/extractors/catch.d.ts.map +1 -1
  255. package/dist/core/extract/extractors/catch.js +26 -17
  256. package/dist/core/extract/extractors/catch.js.map +1 -1
  257. package/dist/core/extract/extractors/date.d.ts +6 -3
  258. package/dist/core/extract/extractors/date.d.ts.map +1 -1
  259. package/dist/core/extract/extractors/date.js +42 -46
  260. package/dist/core/extract/extractors/date.js.map +1 -1
  261. package/dist/core/extract/extractors/default.d.ts +6 -3
  262. package/dist/core/extract/extractors/default.d.ts.map +1 -1
  263. package/dist/core/extract/extractors/default.js +20 -14
  264. package/dist/core/extract/extractors/default.js.map +1 -1
  265. package/dist/core/extract/extractors/enum.d.ts +5 -2
  266. package/dist/core/extract/extractors/enum.d.ts.map +1 -1
  267. package/dist/core/extract/extractors/enum.js +12 -13
  268. package/dist/core/extract/extractors/enum.js.map +1 -1
  269. package/dist/core/extract/extractors/file.d.ts +6 -3
  270. package/dist/core/extract/extractors/file.d.ts.map +1 -1
  271. package/dist/core/extract/extractors/file.js +34 -28
  272. package/dist/core/extract/extractors/file.js.map +1 -1
  273. package/dist/core/extract/extractors/intersection.d.ts +5 -2
  274. package/dist/core/extract/extractors/intersection.d.ts.map +1 -1
  275. package/dist/core/extract/extractors/intersection.js +13 -11
  276. package/dist/core/extract/extractors/intersection.js.map +1 -1
  277. package/dist/core/extract/extractors/lazy.d.ts +6 -3
  278. package/dist/core/extract/extractors/lazy.d.ts.map +1 -1
  279. package/dist/core/extract/extractors/lazy.js +21 -30
  280. package/dist/core/extract/extractors/lazy.js.map +1 -1
  281. package/dist/core/extract/extractors/literal.d.ts +5 -2
  282. package/dist/core/extract/extractors/literal.d.ts.map +1 -1
  283. package/dist/core/extract/extractors/literal.js +8 -1
  284. package/dist/core/extract/extractors/literal.js.map +1 -1
  285. package/dist/core/extract/extractors/map.d.ts +6 -3
  286. package/dist/core/extract/extractors/map.d.ts.map +1 -1
  287. package/dist/core/extract/extractors/map.js +10 -4
  288. package/dist/core/extract/extractors/map.js.map +1 -1
  289. package/dist/core/extract/extractors/nan.d.ts +5 -2
  290. package/dist/core/extract/extractors/nan.d.ts.map +1 -1
  291. package/dist/core/extract/extractors/nan.js +5 -1
  292. package/dist/core/extract/extractors/nan.js.map +1 -1
  293. package/dist/core/extract/extractors/never.d.ts +5 -2
  294. package/dist/core/extract/extractors/never.d.ts.map +1 -1
  295. package/dist/core/extract/extractors/never.js +5 -1
  296. package/dist/core/extract/extractors/never.js.map +1 -1
  297. package/dist/core/extract/extractors/null.d.ts +5 -2
  298. package/dist/core/extract/extractors/null.d.ts.map +1 -1
  299. package/dist/core/extract/extractors/null.js +5 -1
  300. package/dist/core/extract/extractors/null.js.map +1 -1
  301. package/dist/core/extract/extractors/nullable.d.ts +5 -2
  302. package/dist/core/extract/extractors/nullable.d.ts.map +1 -1
  303. package/dist/core/extract/extractors/nullable.js +7 -3
  304. package/dist/core/extract/extractors/nullable.js.map +1 -1
  305. package/dist/core/extract/extractors/number.d.ts +6 -3
  306. package/dist/core/extract/extractors/number.d.ts.map +1 -1
  307. package/dist/core/extract/extractors/number.js +35 -35
  308. package/dist/core/extract/extractors/number.js.map +1 -1
  309. package/dist/core/extract/extractors/object.d.ts +6 -3
  310. package/dist/core/extract/extractors/object.d.ts.map +1 -1
  311. package/dist/core/extract/extractors/object.js +49 -76
  312. package/dist/core/extract/extractors/object.js.map +1 -1
  313. package/dist/core/extract/extractors/optional.d.ts +5 -2
  314. package/dist/core/extract/extractors/optional.d.ts.map +1 -1
  315. package/dist/core/extract/extractors/optional.js +10 -12
  316. package/dist/core/extract/extractors/optional.js.map +1 -1
  317. package/dist/core/extract/extractors/pipe.d.ts +6 -3
  318. package/dist/core/extract/extractors/pipe.d.ts.map +1 -1
  319. package/dist/core/extract/extractors/pipe.js +40 -41
  320. package/dist/core/extract/extractors/pipe.js.map +1 -1
  321. package/dist/core/extract/extractors/readonly.d.ts +5 -2
  322. package/dist/core/extract/extractors/readonly.d.ts.map +1 -1
  323. package/dist/core/extract/extractors/readonly.js +10 -6
  324. package/dist/core/extract/extractors/readonly.js.map +1 -1
  325. package/dist/core/extract/extractors/record.d.ts +6 -3
  326. package/dist/core/extract/extractors/record.d.ts.map +1 -1
  327. package/dist/core/extract/extractors/record.js +24 -35
  328. package/dist/core/extract/extractors/record.js.map +1 -1
  329. package/dist/core/extract/extractors/set.d.ts +6 -3
  330. package/dist/core/extract/extractors/set.d.ts.map +1 -1
  331. package/dist/core/extract/extractors/set.js +36 -30
  332. package/dist/core/extract/extractors/set.js.map +1 -1
  333. package/dist/core/extract/extractors/string-bool.d.ts +7 -4
  334. package/dist/core/extract/extractors/string-bool.d.ts.map +1 -1
  335. package/dist/core/extract/extractors/string-bool.js +66 -84
  336. package/dist/core/extract/extractors/string-bool.js.map +1 -1
  337. package/dist/core/extract/extractors/string.d.ts +6 -3
  338. package/dist/core/extract/extractors/string.d.ts.map +1 -1
  339. package/dist/core/extract/extractors/string.js +34 -37
  340. package/dist/core/extract/extractors/string.js.map +1 -1
  341. package/dist/core/extract/extractors/symbol.d.ts +5 -2
  342. package/dist/core/extract/extractors/symbol.d.ts.map +1 -1
  343. package/dist/core/extract/extractors/symbol.js +5 -1
  344. package/dist/core/extract/extractors/symbol.js.map +1 -1
  345. package/dist/core/extract/extractors/template-literal.d.ts +6 -3
  346. package/dist/core/extract/extractors/template-literal.d.ts.map +1 -1
  347. package/dist/core/extract/extractors/template-literal.js +11 -6
  348. package/dist/core/extract/extractors/template-literal.js.map +1 -1
  349. package/dist/core/extract/extractors/tuple.d.ts +6 -3
  350. package/dist/core/extract/extractors/tuple.d.ts.map +1 -1
  351. package/dist/core/extract/extractors/tuple.js +10 -4
  352. package/dist/core/extract/extractors/tuple.js.map +1 -1
  353. package/dist/core/extract/extractors/undefined.d.ts +5 -2
  354. package/dist/core/extract/extractors/undefined.d.ts.map +1 -1
  355. package/dist/core/extract/extractors/undefined.js +5 -1
  356. package/dist/core/extract/extractors/undefined.js.map +1 -1
  357. package/dist/core/extract/extractors/union.d.ts +6 -3
  358. package/dist/core/extract/extractors/union.d.ts.map +1 -1
  359. package/dist/core/extract/extractors/union.js +38 -64
  360. package/dist/core/extract/extractors/union.js.map +1 -1
  361. package/dist/core/extract/extractors/unknown.d.ts +5 -2
  362. package/dist/core/extract/extractors/unknown.d.ts.map +1 -1
  363. package/dist/core/extract/extractors/unknown.js +5 -1
  364. package/dist/core/extract/extractors/unknown.js.map +1 -1
  365. package/dist/core/extract/extractors/void.d.ts +5 -2
  366. package/dist/core/extract/extractors/void.d.ts.map +1 -1
  367. package/dist/core/extract/extractors/void.js +5 -1
  368. package/dist/core/extract/extractors/void.js.map +1 -1
  369. package/dist/core/extract/fallback.d.ts +6 -3
  370. package/dist/core/extract/fallback.d.ts.map +1 -1
  371. package/dist/core/extract/fallback.js +21 -7
  372. package/dist/core/extract/fallback.js.map +1 -1
  373. package/dist/core/extract/index.d.ts +6 -4
  374. package/dist/core/extract/index.d.ts.map +1 -1
  375. package/dist/core/extract/index.js +15 -15
  376. package/dist/core/extract/index.js.map +1 -1
  377. package/dist/core/extract/registry.d.ts +39 -36
  378. package/dist/core/extract/registry.d.ts.map +1 -1
  379. package/dist/core/extract/registry.js +96 -123
  380. package/dist/core/extract/registry.js.map +1 -1
  381. package/dist/core/extract/types.d.ts +124 -120
  382. package/dist/core/extract/types.d.ts.map +1 -1
  383. package/dist/core/extract/types.js +0 -1
  384. package/dist/core/iife.d.ts +14 -15
  385. package/dist/core/iife.d.ts.map +1 -1
  386. package/dist/core/iife.js +182 -206
  387. package/dist/core/iife.js.map +1 -1
  388. package/dist/core/pipeline.d.ts +33 -30
  389. package/dist/core/pipeline.d.ts.map +1 -1
  390. package/dist/core/pipeline.js +67 -74
  391. package/dist/core/pipeline.js.map +1 -1
  392. package/dist/core/types.d.ts +430 -427
  393. package/dist/core/types.d.ts.map +1 -1
  394. package/dist/core/types.js +0 -5
  395. package/dist/discovery.d.ts +8 -5
  396. package/dist/discovery.d.ts.map +1 -1
  397. package/dist/discovery.js +31 -32
  398. package/dist/discovery.js.map +1 -1
  399. package/dist/index.d.ts +4 -4
  400. package/dist/index.js +2 -2
  401. package/dist/jit.d.ts +15 -42
  402. package/dist/jit.d.ts.map +1 -1
  403. package/dist/jit.js +187 -216
  404. package/dist/jit.js.map +1 -1
  405. package/dist/loader.d.ts +14 -11
  406. package/dist/loader.d.ts.map +1 -1
  407. package/dist/loader.js +226 -258
  408. package/dist/loader.js.map +1 -1
  409. package/dist/static-filter.d.ts +4 -1
  410. package/dist/static-filter.d.ts.map +1 -1
  411. package/dist/static-filter.js +240 -367
  412. package/dist/static-filter.js.map +1 -1
  413. package/dist/swc.d.ts +38 -35
  414. package/dist/swc.d.ts.map +1 -1
  415. package/dist/swc.js +83 -76
  416. package/dist/swc.js.map +1 -1
  417. package/dist/unplugin/bun.d.ts +5 -2
  418. package/dist/unplugin/bun.d.ts.map +1 -1
  419. package/dist/unplugin/bun.js +5 -1
  420. package/dist/unplugin/bun.js.map +1 -1
  421. package/dist/unplugin/dep-graph.d.ts +10 -7
  422. package/dist/unplugin/dep-graph.d.ts.map +1 -1
  423. package/dist/unplugin/dep-graph.js +216 -252
  424. package/dist/unplugin/dep-graph.js.map +1 -1
  425. package/dist/unplugin/disk-cache.d.ts +121 -92
  426. package/dist/unplugin/disk-cache.d.ts.map +1 -1
  427. package/dist/unplugin/disk-cache.js +425 -444
  428. package/dist/unplugin/disk-cache.js.map +1 -1
  429. package/dist/unplugin/edits.d.ts +15 -12
  430. package/dist/unplugin/edits.d.ts.map +1 -1
  431. package/dist/unplugin/edits.js +24 -37
  432. package/dist/unplugin/edits.js.map +1 -1
  433. package/dist/unplugin/esbuild.d.ts +5 -2
  434. package/dist/unplugin/esbuild.d.ts.map +1 -1
  435. package/dist/unplugin/esbuild.js +5 -1
  436. package/dist/unplugin/esbuild.js.map +1 -1
  437. package/dist/unplugin/farm.d.ts +5 -2
  438. package/dist/unplugin/farm.d.ts.map +1 -1
  439. package/dist/unplugin/farm.js +5 -1
  440. package/dist/unplugin/farm.js.map +1 -1
  441. package/dist/unplugin/hoist-compile.d.ts +14 -42
  442. package/dist/unplugin/hoist-compile.d.ts.map +1 -1
  443. package/dist/unplugin/hoist-compile.js +67 -112
  444. package/dist/unplugin/hoist-compile.js.map +1 -1
  445. package/dist/unplugin/hoist.d.ts +56 -54
  446. package/dist/unplugin/hoist.d.ts.map +1 -1
  447. package/dist/unplugin/hoist.js +945 -1170
  448. package/dist/unplugin/hoist.js.map +1 -1
  449. package/dist/unplugin/index.d.ts +5 -3
  450. package/dist/unplugin/index.d.ts.map +1 -1
  451. package/dist/unplugin/index.js +175 -250
  452. package/dist/unplugin/index.js.map +1 -1
  453. package/dist/unplugin/rolldown.d.ts +5 -2
  454. package/dist/unplugin/rolldown.d.ts.map +1 -1
  455. package/dist/unplugin/rolldown.js +5 -1
  456. package/dist/unplugin/rolldown.js.map +1 -1
  457. package/dist/unplugin/rollup.d.ts +5 -2
  458. package/dist/unplugin/rollup.d.ts.map +1 -1
  459. package/dist/unplugin/rollup.js +5 -1
  460. package/dist/unplugin/rollup.js.map +1 -1
  461. package/dist/unplugin/rsbuild.d.ts +6 -3
  462. package/dist/unplugin/rsbuild.d.ts.map +1 -1
  463. package/dist/unplugin/rsbuild.js +15 -11
  464. package/dist/unplugin/rsbuild.js.map +1 -1
  465. package/dist/unplugin/rspack.d.ts +5 -2
  466. package/dist/unplugin/rspack.d.ts.map +1 -1
  467. package/dist/unplugin/rspack.js +5 -1
  468. package/dist/unplugin/rspack.js.map +1 -1
  469. package/dist/unplugin/transform.d.ts +30 -27
  470. package/dist/unplugin/transform.d.ts.map +1 -1
  471. package/dist/unplugin/transform.js +433 -620
  472. package/dist/unplugin/transform.js.map +1 -1
  473. package/dist/unplugin/types.d.ts +189 -184
  474. package/dist/unplugin/types.d.ts.map +1 -1
  475. package/dist/unplugin/types.js +22 -18
  476. package/dist/unplugin/types.js.map +1 -1
  477. package/dist/unplugin/virtual.d.ts +11 -8
  478. package/dist/unplugin/virtual.d.ts.map +1 -1
  479. package/dist/unplugin/virtual.js +65 -83
  480. package/dist/unplugin/virtual.js.map +1 -1
  481. package/dist/unplugin/vite.d.ts +5 -2
  482. package/dist/unplugin/vite.d.ts.map +1 -1
  483. package/dist/unplugin/vite.js +5 -1
  484. package/dist/unplugin/vite.js.map +1 -1
  485. package/dist/unplugin/webpack.d.ts +5 -2
  486. package/dist/unplugin/webpack.d.ts.map +1 -1
  487. package/dist/unplugin/webpack.js +5 -1
  488. package/dist/unplugin/webpack.js.map +1 -1
  489. package/package.json +23 -14
  490. package/dist/cli/index.d.ts.map +0 -1
  491. package/dist/core/extract/types.js.map +0 -1
  492. package/dist/core/types.js.map +0 -1
  493. package/dist/index.d.ts.map +0 -1
  494. package/dist/index.js.map +0 -1
@@ -1,96 +1,97 @@
1
+ //#region src/core/types.d.ts
1
2
  /**
2
3
  * SchemaIR — Intermediate representation for Zod schemas.
3
4
  * Extracted from Zod's `_zod.def` and `_zod.bag` at build time.
4
5
  */
5
6
  /** Shared base: static custom error message extracted from the check's `error` param. */
6
- export interface CheckBase {
7
- /** Static message from e.g. `.min(3, "too short")`. Dynamic error maps force fallback. */
8
- message?: string;
9
- }
10
- export interface CheckMinLength extends CheckBase {
11
- kind: "min_length";
12
- minimum: number;
13
- }
14
- export interface CheckMaxLength extends CheckBase {
15
- kind: "max_length";
16
- maximum: number;
17
- }
18
- export interface CheckLengthEquals extends CheckBase {
19
- kind: "length_equals";
20
- length: number;
21
- }
22
- export interface CheckGreaterThan extends CheckBase {
23
- kind: "greater_than";
24
- value: number;
25
- inclusive: boolean;
26
- }
27
- export interface CheckLessThan extends CheckBase {
28
- kind: "less_than";
29
- value: number;
30
- inclusive: boolean;
31
- }
32
- export interface CheckMultipleOf extends CheckBase {
33
- kind: "multiple_of";
34
- value: number;
35
- }
36
- export interface CheckNumberFormat extends CheckBase {
37
- kind: "number_format";
38
- format: "safeint" | "int32" | "uint32" | "float32" | "float64";
39
- }
40
- export interface CheckStringFormat extends CheckBase {
41
- kind: "string_format";
42
- format: string;
43
- pattern?: string;
44
- /** RegExp flags of the source pattern (e.g. "u" for z.emoji()). */
45
- patternFlags?: string;
46
- /** url-only: hostname constraint regex source (z.httpUrl()). */
47
- hostname?: string;
48
- hostnameFlags?: string;
49
- /** url-only: protocol constraint regex source (z.httpUrl()). */
50
- protocol?: string;
51
- protocolFlags?: string;
52
- /** url-only: output url.href instead of the trimmed input. */
53
- normalize?: boolean;
54
- }
55
- export interface CheckIncludes extends CheckBase {
56
- kind: "includes";
57
- includes: string;
58
- position?: number;
59
- }
60
- export interface CheckStartsWith extends CheckBase {
61
- kind: "starts_with";
62
- prefix: string;
63
- }
64
- export interface CheckEndsWith extends CheckBase {
65
- kind: "ends_with";
66
- suffix: string;
67
- }
68
- export type CheckIR = CheckMinLength | CheckMaxLength | CheckLengthEquals | CheckGreaterThan | CheckLessThan | CheckMultipleOf | CheckNumberFormat | CheckStringFormat | CheckIncludes | CheckStartsWith | CheckEndsWith;
69
- export interface RefineEffectCheckIR {
70
- kind: "refine_effect";
71
- /**
72
- * fn.toString() result, e.g. "v => v.includes('@')". Set when the predicate
73
- * is zero-capture and can be inlined into the generated code. Mutually
74
- * exclusive with {@link refIndex}.
75
- */
76
- source?: string;
77
- /**
78
- * `__rf[N]` index of the predicate, used when the callback CAPTURES outer
79
- * variables and so cannot be inlined. The generated code calls the user's
80
- * original function object through the schema reference instead of
81
- * delegating the whole schema to zod — a captured `.refine()` on a root
82
- * object otherwise costs the entire compilation (measured 246.7 ns vs
83
- * 10.4 ns for the same schema with an inlinable predicate).
84
- */
85
- refIndex?: number;
86
- /** Custom error message from .refine(fn, "message") or .refine(fn, { message }) */
87
- message?: string;
88
- /**
89
- * Issue path suffix from `.refine(fn, { path: [...] })`, appended to the
90
- * node's own path — zod reports the failure against that member rather than
91
- * the refined value itself.
92
- */
93
- path?: (string | number)[];
7
+ interface CheckBase {
8
+ /** Static message from e.g. `.min(3, "too short")`. Dynamic error maps force fallback. */
9
+ message?: string;
10
+ }
11
+ interface CheckMinLength extends CheckBase {
12
+ kind: "min_length";
13
+ minimum: number;
14
+ }
15
+ interface CheckMaxLength extends CheckBase {
16
+ kind: "max_length";
17
+ maximum: number;
18
+ }
19
+ interface CheckLengthEquals extends CheckBase {
20
+ kind: "length_equals";
21
+ length: number;
22
+ }
23
+ interface CheckGreaterThan extends CheckBase {
24
+ kind: "greater_than";
25
+ value: number;
26
+ inclusive: boolean;
27
+ }
28
+ interface CheckLessThan extends CheckBase {
29
+ kind: "less_than";
30
+ value: number;
31
+ inclusive: boolean;
32
+ }
33
+ interface CheckMultipleOf extends CheckBase {
34
+ kind: "multiple_of";
35
+ value: number;
36
+ }
37
+ interface CheckNumberFormat extends CheckBase {
38
+ kind: "number_format";
39
+ format: "safeint" | "int32" | "uint32" | "float32" | "float64";
40
+ }
41
+ interface CheckStringFormat extends CheckBase {
42
+ kind: "string_format";
43
+ format: string;
44
+ pattern?: string;
45
+ /** RegExp flags of the source pattern (e.g. "u" for z.emoji()). */
46
+ patternFlags?: string;
47
+ /** url-only: hostname constraint regex source (z.httpUrl()). */
48
+ hostname?: string;
49
+ hostnameFlags?: string;
50
+ /** url-only: protocol constraint regex source (z.httpUrl()). */
51
+ protocol?: string;
52
+ protocolFlags?: string;
53
+ /** url-only: output url.href instead of the trimmed input. */
54
+ normalize?: boolean;
55
+ }
56
+ interface CheckIncludes extends CheckBase {
57
+ kind: "includes";
58
+ includes: string;
59
+ position?: number;
60
+ }
61
+ interface CheckStartsWith extends CheckBase {
62
+ kind: "starts_with";
63
+ prefix: string;
64
+ }
65
+ interface CheckEndsWith extends CheckBase {
66
+ kind: "ends_with";
67
+ suffix: string;
68
+ }
69
+ type CheckIR = CheckMinLength | CheckMaxLength | CheckLengthEquals | CheckGreaterThan | CheckLessThan | CheckMultipleOf | CheckNumberFormat | CheckStringFormat | CheckIncludes | CheckStartsWith | CheckEndsWith;
70
+ interface RefineEffectCheckIR {
71
+ kind: "refine_effect";
72
+ /**
73
+ * fn.toString() result, e.g. "v => v.includes('@')". Set when the predicate
74
+ * is zero-capture and can be inlined into the generated code. Mutually
75
+ * exclusive with {@link refIndex}.
76
+ */
77
+ source?: string;
78
+ /**
79
+ * `__rf[N]` index of the predicate, used when the callback CAPTURES outer
80
+ * variables and so cannot be inlined. The generated code calls the user's
81
+ * original function object through the schema reference instead of
82
+ * delegating the whole schema to zod — a captured `.refine()` on a root
83
+ * object otherwise costs the entire compilation (measured 246.7 ns vs
84
+ * 10.4 ns for the same schema with an inlinable predicate).
85
+ */
86
+ refIndex?: number;
87
+ /** Custom error message from .refine(fn, "message") or .refine(fn, { message }) */
88
+ message?: string;
89
+ /**
90
+ * Issue path suffix from `.refine(fn, { path: [...] })`, appended to the
91
+ * node's own path — zod reports the failure against that member rather than
92
+ * the refined value itself.
93
+ */
94
+ path?: (string | number)[];
94
95
  }
95
96
  /**
96
97
  * A `superRefine` (or a raw `.check(payloadFn)`): a callback that receives zod's
@@ -103,301 +104,301 @@ export interface RefineEffectCheckIR {
103
104
  * `fatal`/`continue:false` aborts zod's remaining check chain, which compiled
104
105
  * output (running every check) could not reproduce.
105
106
  */
106
- export interface SuperRefineEffectCheckIR {
107
- kind: "super_refine_effect";
108
- /** `__rf[N]` index of the payload-taking callback. */
109
- refIndex: number;
107
+ interface SuperRefineEffectCheckIR {
108
+ kind: "super_refine_effect";
109
+ /** `__rf[N]` index of the payload-taking callback. */
110
+ refIndex: number;
110
111
  }
111
112
  /**
112
113
  * Value-rewriting check compiled from a $ZodCheckOverwrite (.trim(), .toLowerCase(), ...).
113
114
  * Applied at its original position: `value = (source)(value)`. Never produces issues.
114
115
  */
115
- export interface OverwriteEffectCheckIR {
116
- kind: "overwrite_effect";
117
- /** fn.toString() of the overwrite transform, e.g. "(input) => input.trim()" */
118
- source: string;
116
+ interface OverwriteEffectCheckIR {
117
+ kind: "overwrite_effect";
118
+ /** fn.toString() of the overwrite transform, e.g. "(input) => input.trim()" */
119
+ source: string;
119
120
  }
120
121
  /** A check entry that may be a compiled check or an inline effect. */
121
- export type CheckOrEffectIR = CheckIR | RefineEffectCheckIR | SuperRefineEffectCheckIR | OverwriteEffectCheckIR;
122
- export interface CheckDateGreaterThan extends CheckBase {
123
- kind: "date_greater_than";
124
- value: string;
125
- timestamp: number;
126
- inclusive: boolean;
127
- }
128
- export interface CheckDateLessThan extends CheckBase {
129
- kind: "date_less_than";
130
- value: string;
131
- timestamp: number;
132
- inclusive: boolean;
133
- }
134
- export type DateCheckIR = CheckDateGreaterThan | CheckDateLessThan;
135
- export interface CheckBigIntGreaterThan extends CheckBase {
136
- kind: "bigint_greater_than";
137
- /** String representation of the BigInt value (e.g. "10") */
138
- value: string;
139
- inclusive: boolean;
140
- }
141
- export interface CheckBigIntLessThan extends CheckBase {
142
- kind: "bigint_less_than";
143
- /** String representation of the BigInt value (e.g. "100") */
144
- value: string;
145
- inclusive: boolean;
146
- }
147
- export interface CheckBigIntMultipleOf extends CheckBase {
148
- kind: "bigint_multiple_of";
149
- /** String representation of the BigInt value (e.g. "3") */
150
- value: string;
151
- }
152
- export type BigIntCheckIR = CheckBigIntGreaterThan | CheckBigIntLessThan | CheckBigIntMultipleOf;
153
- export interface CheckMinSize extends CheckBase {
154
- kind: "min_size";
155
- minimum: number;
156
- }
157
- export interface CheckMaxSize extends CheckBase {
158
- kind: "max_size";
159
- maximum: number;
160
- }
161
- export interface CheckSizeEquals extends CheckBase {
162
- kind: "size_equals";
163
- size: number;
164
- }
165
- export type SetCheckIR = CheckMinSize | CheckMaxSize | CheckSizeEquals;
166
- export interface CheckMimeType extends CheckBase {
167
- kind: "mime_type";
168
- mime: string[];
169
- }
170
- export type FileCheckIR = CheckMinSize | CheckMaxSize | CheckMimeType;
171
- export interface StringIR {
172
- type: "string";
173
- checks: CheckOrEffectIR[];
174
- coerce?: boolean;
175
- }
176
- export interface NumberIR {
177
- type: "number";
178
- checks: CheckOrEffectIR[];
179
- coerce?: boolean;
180
- }
181
- export interface BooleanIR {
182
- type: "boolean";
183
- coerce?: boolean;
184
- }
185
- export interface BigIntIR {
186
- type: "bigint";
187
- checks: BigIntCheckIR[];
188
- coerce?: boolean;
189
- }
190
- export interface DateIR {
191
- type: "date";
192
- checks: DateCheckIR[];
193
- coerce?: boolean;
194
- }
195
- export interface SymbolIR {
196
- type: "symbol";
197
- }
198
- export interface NullIR {
199
- type: "null";
200
- }
201
- export interface UndefinedIR {
202
- type: "undefined";
203
- }
204
- export interface VoidIR {
205
- type: "void";
206
- }
207
- export interface NanIR {
208
- type: "nan";
209
- }
210
- export interface NeverIR {
211
- type: "never";
212
- }
213
- export interface AnyIR {
214
- type: "any";
215
- }
216
- export interface UnknownIR {
217
- type: "unknown";
218
- }
219
- export interface LiteralIR {
220
- type: "literal";
221
- values: (string | number | boolean | null | bigint | undefined)[];
222
- }
223
- export interface EnumIR {
224
- type: "enum";
225
- /** Accepted values — z.nativeEnum() can contribute numbers. */
226
- values: (string | number)[];
227
- }
228
- export interface ObjectIR {
229
- type: "object";
230
- properties: Record<string, SchemaIR>;
231
- /**
232
- * Reject unknown keys (z.strictObject / .strict() / .catchall(z.never())).
233
- * Compiled as a for-in membership pass after the property checks, mirroring
234
- * zod's handleCatchall exactly: `for (const key in input)` (inherited
235
- * enumerable keys count, no hasOwnProperty filter) collecting ALL unknown
236
- * keys into ONE `unrecognized_keys` issue pushed after property issues.
237
- * Pass-through still holds — valid strict data has no extra keys, so
238
- * data === input and the schema stays Fast Path eligible.
239
- */
240
- strict?: boolean;
241
- /**
242
- * Strip unknown keys from the output (zod's DEFAULT `z.object()` behavior),
243
- * set only when the `stripUnknownKeys` build option is enabled AND this is a
244
- * genuine `z.object()` (no catchall) — never on `z.looseObject()` (keep) or
245
- * `z.strictObject()` (reject). Compiled by rebuilding a fresh object from
246
- * only the declared own keys, mirroring zod's strip exactly. Because the
247
- * output is a fresh value, a strip object counts as a {@link hasMutation}
248
- * node: it never takes the zero-allocation by-reference fast path, and parent
249
- * containers clone before it writes back (so intersections of strip objects
250
- * delegate to zod, matching zod's merge-then-strip semantics). Mutually
251
- * exclusive with `strict`.
252
- */
253
- stripUnknownKeys?: boolean;
254
- /** Object-level refine effects from z.object({...}).refine(fn) */
255
- checks?: (RefineEffectCheckIR | SuperRefineEffectCheckIR)[];
256
- /**
257
- * `.catchall(schema)`: every key not in the shape is validated against this
258
- * schema instead of being ignored (plain object) or rejected (strict).
259
- * Mutually exclusive with `strict` — `.catchall(z.never())` IS strict — and
260
- * with `stripUnknownKeys`, since a catchall exists to KEEP unknown keys.
261
- */
262
- catchall?: SchemaIR;
263
- /**
264
- * Fallback-typed property keys whose zod schema is optional-out: when the
265
- * key is ABSENT from the input, their issues are suppressed (mirrors zod's
266
- * handlePropertyResult). Lets z.exactOptional() and friends fall back at
267
- * the property level without rejecting missing keys.
268
- */
269
- suppressAbsentKeys?: string[];
270
- }
271
- export interface ArrayIR {
272
- type: "array";
273
- element: SchemaIR;
274
- checks: CheckOrEffectIR[];
275
- }
276
- export interface TupleIR {
277
- type: "tuple";
278
- items: SchemaIR[];
279
- rest: SchemaIR | null;
280
- }
281
- export interface RecordIR {
282
- type: "record";
283
- keyType: SchemaIR;
284
- valueType: SchemaIR;
285
- }
286
- export interface SetIR {
287
- type: "set";
288
- valueType: SchemaIR;
289
- checks?: SetCheckIR[];
290
- }
291
- export interface MapIR {
292
- type: "map";
293
- keyType: SchemaIR;
294
- valueType: SchemaIR;
295
- }
296
- export interface FileIR {
297
- type: "file";
298
- checks?: FileCheckIR[];
299
- }
300
- export interface UnionIR {
301
- type: "union";
302
- options: SchemaIR[];
303
- }
304
- export interface DiscriminatedUnionIR {
305
- type: "discriminatedUnion";
306
- discriminator: string;
307
- options: SchemaIR[];
308
- /**
309
- * Typed discriminator-value dispatch table, sourced from zod's
310
- * `_zod.propValues` (covers literal AND enum discriminators, preserving
311
- * value types so numeric/boolean discriminators switch correctly).
312
- */
313
- cases: {
314
- value: string | number | boolean | null | bigint | undefined;
315
- option: number;
316
- }[];
317
- }
318
- export interface IntersectionIR {
319
- type: "intersection";
320
- left: SchemaIR;
321
- right: SchemaIR;
322
- }
323
- export interface OptionalIR {
324
- type: "optional";
325
- inner: SchemaIR;
326
- }
327
- export interface NullableIR {
328
- type: "nullable";
329
- inner: SchemaIR;
330
- }
331
- export interface ReadonlyIR {
332
- type: "readonly";
333
- inner: SchemaIR;
334
- }
335
- export interface DefaultIR {
336
- type: "default";
337
- inner: SchemaIR;
338
- refIndex: number;
339
- /**
340
- * The declared default value is not itself `undefined`, read off the schema at
341
- * extraction time. That makes the node's output ALWAYS defined — the default
342
- * branch yields the declared value, and the inner branch only runs for a
343
- * non-undefined input, which zod's strip test keeps regardless of what the
344
- * inner produced. Lets a defaulted property claim a slot in the output object
345
- * literal instead of a conditional append (see outputAlwaysDefined).
346
- *
347
- * Absent for the degenerate `.default(undefined)`, where zod drops the key.
348
- */
349
- alwaysDefined?: boolean;
350
- }
351
- export interface PipeIR {
352
- type: "pipe";
353
- in: SchemaIR;
354
- out: SchemaIR;
355
- }
356
- export interface TransformEffectIR {
357
- type: "effect";
358
- effectKind: "transform";
359
- /**
360
- * fn.toString() result, e.g. "v => v.toLowerCase()". Set when the callback is
361
- * zero-capture and can be inlined. Mutually exclusive with {@link refIndex}.
362
- */
363
- source?: string;
364
- /**
365
- * `__rf[N]` index of the transform, used when the callback CAPTURES outer
366
- * variables. Calling the user's own function object keeps the schema compiled;
367
- * delegating the whole schema to zod instead measured 163.7 ns against zod's
368
- * own 136.7 ns — the fallback wrapper made it SLOWER than not compiling.
369
- */
370
- refIndex?: number;
371
- /** The input schema to validate before applying the transform */
372
- inner: SchemaIR;
373
- }
374
- export interface FallbackIR {
375
- type: "fallback";
376
- reason: "transform" | "refine" | "superRefine" | "custom" | "lazy" | "unsupported" | "coalesced";
377
- /** Index into the __rf[] fallback schemas array. Present when partial fallback is used. */
378
- refIndex?: number;
379
- }
380
- export interface TemplateLiteralIR {
381
- type: "templateLiteral";
382
- pattern: string;
383
- }
384
- export interface CatchIR {
385
- type: "catch";
386
- inner: SchemaIR;
387
- /** Index into __rf[] — the original z.catch() schema whose catchValue runs per parse. */
388
- refIndex: number;
389
- }
390
- export interface RecursiveRefIR {
391
- type: "recursiveRef";
392
- /**
393
- * Identifies which recursion target this back-edge re-invokes. Absent (or 0)
394
- * means the ROOT schema — the directly self-recursive case, whose validator
395
- * is the schema's own `safeParse_<name>` / hosted fast-check. A value ≥ 1
396
- * targets a non-root sub-schema hosted as a standalone validator (see
397
- * {@link RecursionTargetIR}); used for recursive schemas nested inside a
398
- * larger root, multiple distinct recursive sub-schemas, and mutual recursion.
399
- */
400
- refId?: number;
122
+ type CheckOrEffectIR = CheckIR | RefineEffectCheckIR | SuperRefineEffectCheckIR | OverwriteEffectCheckIR;
123
+ interface CheckDateGreaterThan extends CheckBase {
124
+ kind: "date_greater_than";
125
+ value: string;
126
+ timestamp: number;
127
+ inclusive: boolean;
128
+ }
129
+ interface CheckDateLessThan extends CheckBase {
130
+ kind: "date_less_than";
131
+ value: string;
132
+ timestamp: number;
133
+ inclusive: boolean;
134
+ }
135
+ type DateCheckIR = CheckDateGreaterThan | CheckDateLessThan;
136
+ interface CheckBigIntGreaterThan extends CheckBase {
137
+ kind: "bigint_greater_than";
138
+ /** String representation of the BigInt value (e.g. "10") */
139
+ value: string;
140
+ inclusive: boolean;
141
+ }
142
+ interface CheckBigIntLessThan extends CheckBase {
143
+ kind: "bigint_less_than";
144
+ /** String representation of the BigInt value (e.g. "100") */
145
+ value: string;
146
+ inclusive: boolean;
147
+ }
148
+ interface CheckBigIntMultipleOf extends CheckBase {
149
+ kind: "bigint_multiple_of";
150
+ /** String representation of the BigInt value (e.g. "3") */
151
+ value: string;
152
+ }
153
+ type BigIntCheckIR = CheckBigIntGreaterThan | CheckBigIntLessThan | CheckBigIntMultipleOf;
154
+ interface CheckMinSize extends CheckBase {
155
+ kind: "min_size";
156
+ minimum: number;
157
+ }
158
+ interface CheckMaxSize extends CheckBase {
159
+ kind: "max_size";
160
+ maximum: number;
161
+ }
162
+ interface CheckSizeEquals extends CheckBase {
163
+ kind: "size_equals";
164
+ size: number;
165
+ }
166
+ type SetCheckIR = CheckMinSize | CheckMaxSize | CheckSizeEquals;
167
+ interface CheckMimeType extends CheckBase {
168
+ kind: "mime_type";
169
+ mime: string[];
170
+ }
171
+ type FileCheckIR = CheckMinSize | CheckMaxSize | CheckMimeType;
172
+ interface StringIR {
173
+ type: "string";
174
+ checks: CheckOrEffectIR[];
175
+ coerce?: boolean;
176
+ }
177
+ interface NumberIR {
178
+ type: "number";
179
+ checks: CheckOrEffectIR[];
180
+ coerce?: boolean;
181
+ }
182
+ interface BooleanIR {
183
+ type: "boolean";
184
+ coerce?: boolean;
185
+ }
186
+ interface BigIntIR {
187
+ type: "bigint";
188
+ checks: BigIntCheckIR[];
189
+ coerce?: boolean;
190
+ }
191
+ interface DateIR {
192
+ type: "date";
193
+ checks: DateCheckIR[];
194
+ coerce?: boolean;
195
+ }
196
+ interface SymbolIR {
197
+ type: "symbol";
198
+ }
199
+ interface NullIR {
200
+ type: "null";
201
+ }
202
+ interface UndefinedIR {
203
+ type: "undefined";
204
+ }
205
+ interface VoidIR {
206
+ type: "void";
207
+ }
208
+ interface NanIR {
209
+ type: "nan";
210
+ }
211
+ interface NeverIR {
212
+ type: "never";
213
+ }
214
+ interface AnyIR {
215
+ type: "any";
216
+ }
217
+ interface UnknownIR {
218
+ type: "unknown";
219
+ }
220
+ interface LiteralIR {
221
+ type: "literal";
222
+ values: (string | number | boolean | null | bigint | undefined)[];
223
+ }
224
+ interface EnumIR {
225
+ type: "enum";
226
+ /** Accepted values — z.nativeEnum() can contribute numbers. */
227
+ values: (string | number)[];
228
+ }
229
+ interface ObjectIR {
230
+ type: "object";
231
+ properties: Record<string, SchemaIR>;
232
+ /**
233
+ * Reject unknown keys (z.strictObject / .strict() / .catchall(z.never())).
234
+ * Compiled as a for-in membership pass after the property checks, mirroring
235
+ * zod's handleCatchall exactly: `for (const key in input)` (inherited
236
+ * enumerable keys count, no hasOwnProperty filter) collecting ALL unknown
237
+ * keys into ONE `unrecognized_keys` issue pushed after property issues.
238
+ * Pass-through still holds — valid strict data has no extra keys, so
239
+ * data === input and the schema stays Fast Path eligible.
240
+ */
241
+ strict?: boolean;
242
+ /**
243
+ * Strip unknown keys from the output (zod's DEFAULT `z.object()` behavior),
244
+ * set only when the `stripUnknownKeys` build option is enabled AND this is a
245
+ * genuine `z.object()` (no catchall) — never on `z.looseObject()` (keep) or
246
+ * `z.strictObject()` (reject). Compiled by rebuilding a fresh object from
247
+ * only the declared own keys, mirroring zod's strip exactly. Because the
248
+ * output is a fresh value, a strip object counts as a {@link hasMutation}
249
+ * node: it never takes the zero-allocation by-reference fast path, and parent
250
+ * containers clone before it writes back (so intersections of strip objects
251
+ * delegate to zod, matching zod's merge-then-strip semantics). Mutually
252
+ * exclusive with `strict`.
253
+ */
254
+ stripUnknownKeys?: boolean;
255
+ /** Object-level refine effects from z.object({...}).refine(fn) */
256
+ checks?: (RefineEffectCheckIR | SuperRefineEffectCheckIR)[];
257
+ /**
258
+ * `.catchall(schema)`: every key not in the shape is validated against this
259
+ * schema instead of being ignored (plain object) or rejected (strict).
260
+ * Mutually exclusive with `strict` — `.catchall(z.never())` IS strict — and
261
+ * with `stripUnknownKeys`, since a catchall exists to KEEP unknown keys.
262
+ */
263
+ catchall?: SchemaIR;
264
+ /**
265
+ * Fallback-typed property keys whose zod schema is optional-out: when the
266
+ * key is ABSENT from the input, their issues are suppressed (mirrors zod's
267
+ * handlePropertyResult). Lets z.exactOptional() and friends fall back at
268
+ * the property level without rejecting missing keys.
269
+ */
270
+ suppressAbsentKeys?: string[];
271
+ }
272
+ interface ArrayIR {
273
+ type: "array";
274
+ element: SchemaIR;
275
+ checks: CheckOrEffectIR[];
276
+ }
277
+ interface TupleIR {
278
+ type: "tuple";
279
+ items: SchemaIR[];
280
+ rest: SchemaIR | null;
281
+ }
282
+ interface RecordIR {
283
+ type: "record";
284
+ keyType: SchemaIR;
285
+ valueType: SchemaIR;
286
+ }
287
+ interface SetIR {
288
+ type: "set";
289
+ valueType: SchemaIR;
290
+ checks?: SetCheckIR[];
291
+ }
292
+ interface MapIR {
293
+ type: "map";
294
+ keyType: SchemaIR;
295
+ valueType: SchemaIR;
296
+ }
297
+ interface FileIR {
298
+ type: "file";
299
+ checks?: FileCheckIR[];
300
+ }
301
+ interface UnionIR {
302
+ type: "union";
303
+ options: SchemaIR[];
304
+ }
305
+ interface DiscriminatedUnionIR {
306
+ type: "discriminatedUnion";
307
+ discriminator: string;
308
+ options: SchemaIR[];
309
+ /**
310
+ * Typed discriminator-value dispatch table, sourced from zod's
311
+ * `_zod.propValues` (covers literal AND enum discriminators, preserving
312
+ * value types so numeric/boolean discriminators switch correctly).
313
+ */
314
+ cases: {
315
+ value: string | number | boolean | null | bigint | undefined;
316
+ option: number;
317
+ }[];
318
+ }
319
+ interface IntersectionIR {
320
+ type: "intersection";
321
+ left: SchemaIR;
322
+ right: SchemaIR;
323
+ }
324
+ interface OptionalIR {
325
+ type: "optional";
326
+ inner: SchemaIR;
327
+ }
328
+ interface NullableIR {
329
+ type: "nullable";
330
+ inner: SchemaIR;
331
+ }
332
+ interface ReadonlyIR {
333
+ type: "readonly";
334
+ inner: SchemaIR;
335
+ }
336
+ interface DefaultIR {
337
+ type: "default";
338
+ inner: SchemaIR;
339
+ refIndex: number;
340
+ /**
341
+ * The declared default value is not itself `undefined`, read off the schema at
342
+ * extraction time. That makes the node's output ALWAYS defined — the default
343
+ * branch yields the declared value, and the inner branch only runs for a
344
+ * non-undefined input, which zod's strip test keeps regardless of what the
345
+ * inner produced. Lets a defaulted property claim a slot in the output object
346
+ * literal instead of a conditional append (see outputAlwaysDefined).
347
+ *
348
+ * Absent for the degenerate `.default(undefined)`, where zod drops the key.
349
+ */
350
+ alwaysDefined?: boolean;
351
+ }
352
+ interface PipeIR {
353
+ type: "pipe";
354
+ in: SchemaIR;
355
+ out: SchemaIR;
356
+ }
357
+ interface TransformEffectIR {
358
+ type: "effect";
359
+ effectKind: "transform";
360
+ /**
361
+ * fn.toString() result, e.g. "v => v.toLowerCase()". Set when the callback is
362
+ * zero-capture and can be inlined. Mutually exclusive with {@link refIndex}.
363
+ */
364
+ source?: string;
365
+ /**
366
+ * `__rf[N]` index of the transform, used when the callback CAPTURES outer
367
+ * variables. Calling the user's own function object keeps the schema compiled;
368
+ * delegating the whole schema to zod instead measured 163.7 ns against zod's
369
+ * own 136.7 ns — the fallback wrapper made it SLOWER than not compiling.
370
+ */
371
+ refIndex?: number;
372
+ /** The input schema to validate before applying the transform */
373
+ inner: SchemaIR;
374
+ }
375
+ interface FallbackIR {
376
+ type: "fallback";
377
+ reason: "transform" | "refine" | "superRefine" | "custom" | "lazy" | "unsupported" | "coalesced";
378
+ /** Index into the __rf[] fallback schemas array. Present when partial fallback is used. */
379
+ refIndex?: number;
380
+ }
381
+ interface TemplateLiteralIR {
382
+ type: "templateLiteral";
383
+ pattern: string;
384
+ }
385
+ interface CatchIR {
386
+ type: "catch";
387
+ inner: SchemaIR;
388
+ /** Index into __rf[] — the original z.catch() schema whose catchValue runs per parse. */
389
+ refIndex: number;
390
+ }
391
+ interface RecursiveRefIR {
392
+ type: "recursiveRef";
393
+ /**
394
+ * Identifies which recursion target this back-edge re-invokes. Absent (or 0)
395
+ * means the ROOT schema — the directly self-recursive case, whose validator
396
+ * is the schema's own `safeParse_<name>` / hosted fast-check. A value ≥ 1
397
+ * targets a non-root sub-schema hosted as a standalone validator (see
398
+ * {@link RecursionTargetIR}); used for recursive schemas nested inside a
399
+ * larger root, multiple distinct recursive sub-schemas, and mutual recursion.
400
+ */
401
+ refId?: number;
401
402
  }
402
403
  /**
403
404
  * Marks a sub-schema that is the target of one or more {@link RecursiveRefIR}
@@ -407,16 +408,16 @@ export interface RecursiveRefIR {
407
408
  * the (wrong-shaped) root validator. The root target needs no wrapper: it IS
408
409
  * the root function, so it is never wrapped and uses the implicit refId 0.
409
410
  */
410
- export interface RecursionTargetIR {
411
- type: "recursionTarget";
412
- refId: number;
413
- inner: SchemaIR;
411
+ interface RecursionTargetIR {
412
+ type: "recursionTarget";
413
+ refId: number;
414
+ inner: SchemaIR;
414
415
  }
415
- export interface StringBoolIR {
416
- type: "stringBool";
417
- truthy: string[];
418
- falsy: string[];
419
- caseSensitive: boolean;
416
+ interface StringBoolIR {
417
+ type: "stringBool";
418
+ truthy: string[];
419
+ falsy: string[];
420
+ caseSensitive: boolean;
420
421
  }
421
422
  /**
422
423
  * Optional schema-level static error message (z.string({ error: "..." })).
@@ -425,46 +426,48 @@ export interface StringBoolIR {
425
426
  * error > schema error > locale default). Dynamic schema-level error maps
426
427
  * force fallback instead.
427
428
  */
428
- export interface TypeMessageCarrier {
429
- typeMessage?: string;
430
- }
431
- export type SchemaIR = TypeMessageCarrier & (StringIR | NumberIR | BooleanIR | BigIntIR | DateIR | SymbolIR | NullIR | UndefinedIR | VoidIR | NanIR | NeverIR | AnyIR | UnknownIR | LiteralIR | EnumIR | ObjectIR | ArrayIR | TupleIR | RecordIR | SetIR | MapIR | FileIR | UnionIR | DiscriminatedUnionIR | IntersectionIR | OptionalIR | NullableIR | ReadonlyIR | DefaultIR | PipeIR | TransformEffectIR | TemplateLiteralIR | CatchIR | FallbackIR | RecursiveRefIR | RecursionTargetIR | StringBoolIR);
432
- export interface SafeParseSuccess<T> {
433
- success: true;
434
- data: T;
435
- }
436
- export interface SafeParseError {
437
- success: false;
438
- error: ZodErrorLike;
439
- }
440
- export type SafeParseResult<T> = SafeParseSuccess<T> | SafeParseError;
441
- export interface ZodIssueLike {
442
- code: string;
443
- path: (string | number)[];
444
- message: string;
445
- [key: string]: unknown;
446
- }
447
- export interface ZodErrorLike {
448
- issues: ZodIssueLike[];
449
- }
450
- export interface DiscoveredSchema {
451
- exportName: string;
452
- schema: unknown;
453
- }
454
- export interface CompiledSchema<T> {
455
- parse(input: unknown): T;
456
- parseAsync(input: unknown): Promise<T>;
457
- safeParse(input: unknown): SafeParseResult<T>;
458
- safeParseAsync(input: unknown): Promise<SafeParseResult<T>>;
459
- /**
460
- * Zero-allocation boolean type guard. For schemas with a total Fast Path
461
- * (the common case — objects, primitives, arrays, enums without
462
- * coerce/default/catch/transform), this IS the compiled fast-check function:
463
- * one boolean expression, no result object, no issues array — the cheapest
464
- * possible "does this match?" check, on par with typia's `is<T>()`. Schemas
465
- * without a total Fast Path fall back to `safeParse(input).success`
466
- * (correct, still allocation-light). Narrows `input` to `T` on `true`.
467
- */
468
- is(input: unknown): input is T;
469
- }
429
+ interface TypeMessageCarrier {
430
+ typeMessage?: string;
431
+ }
432
+ type SchemaIR = TypeMessageCarrier & (StringIR | NumberIR | BooleanIR | BigIntIR | DateIR | SymbolIR | NullIR | UndefinedIR | VoidIR | NanIR | NeverIR | AnyIR | UnknownIR | LiteralIR | EnumIR | ObjectIR | ArrayIR | TupleIR | RecordIR | SetIR | MapIR | FileIR | UnionIR | DiscriminatedUnionIR | IntersectionIR | OptionalIR | NullableIR | ReadonlyIR | DefaultIR | PipeIR | TransformEffectIR | TemplateLiteralIR | CatchIR | FallbackIR | RecursiveRefIR | RecursionTargetIR | StringBoolIR);
433
+ interface SafeParseSuccess<T> {
434
+ success: true;
435
+ data: T;
436
+ }
437
+ interface SafeParseError {
438
+ success: false;
439
+ error: ZodErrorLike;
440
+ }
441
+ type SafeParseResult<T> = SafeParseSuccess<T> | SafeParseError;
442
+ interface ZodIssueLike {
443
+ code: string;
444
+ path: (string | number)[];
445
+ message: string;
446
+ [key: string]: unknown;
447
+ }
448
+ interface ZodErrorLike {
449
+ issues: ZodIssueLike[];
450
+ }
451
+ interface DiscoveredSchema {
452
+ exportName: string;
453
+ schema: unknown;
454
+ }
455
+ interface CompiledSchema<T> {
456
+ parse(input: unknown): T;
457
+ parseAsync(input: unknown): Promise<T>;
458
+ safeParse(input: unknown): SafeParseResult<T>;
459
+ safeParseAsync(input: unknown): Promise<SafeParseResult<T>>;
460
+ /**
461
+ * Zero-allocation boolean type guard. For schemas with a total Fast Path
462
+ * (the common case — objects, primitives, arrays, enums without
463
+ * coerce/default/catch/transform), this IS the compiled fast-check function:
464
+ * one boolean expression, no result object, no issues array — the cheapest
465
+ * possible "does this match?" check, on par with typia's `is<T>()`. Schemas
466
+ * without a total Fast Path fall back to `safeParse(input).success`
467
+ * (correct, still allocation-light). Narrows `input` to `T` on `true`.
468
+ */
469
+ is(input: unknown): input is T;
470
+ }
471
+ //#endregion
472
+ export { AnyIR, ArrayIR, BigIntCheckIR, BigIntIR, BooleanIR, CatchIR, CheckBase, CheckBigIntGreaterThan, CheckBigIntLessThan, CheckBigIntMultipleOf, CheckDateGreaterThan, CheckDateLessThan, CheckEndsWith, CheckGreaterThan, CheckIR, CheckIncludes, CheckLengthEquals, CheckLessThan, CheckMaxLength, CheckMaxSize, CheckMimeType, CheckMinLength, CheckMinSize, CheckMultipleOf, CheckNumberFormat, CheckOrEffectIR, CheckSizeEquals, CheckStartsWith, CheckStringFormat, CompiledSchema, DateCheckIR, DateIR, DefaultIR, DiscoveredSchema, DiscriminatedUnionIR, EnumIR, FallbackIR, FileCheckIR, FileIR, IntersectionIR, LiteralIR, MapIR, NanIR, NeverIR, NullIR, NullableIR, NumberIR, ObjectIR, OptionalIR, OverwriteEffectCheckIR, PipeIR, ReadonlyIR, RecordIR, RecursionTargetIR, RecursiveRefIR, RefineEffectCheckIR, SafeParseError, SafeParseResult, SafeParseSuccess, SchemaIR, SetCheckIR, SetIR, StringBoolIR, StringIR, SuperRefineEffectCheckIR, SymbolIR, TemplateLiteralIR, TransformEffectIR, TupleIR, TypeMessageCarrier, UndefinedIR, UnionIR, UnknownIR, VoidIR, ZodErrorLike, ZodIssueLike };
470
473
  //# sourceMappingURL=types.d.ts.map