@psnext/slingcli 3.0.20260827-1 → 3.3.20260911-1

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 (976) hide show
  1. package/node_modules/@aws-sdk/core/dist-cjs/submodules/util/index.js +5 -0
  2. package/node_modules/@aws-sdk/core/dist-es/submodules/util/hasOwn.js +3 -0
  3. package/node_modules/@aws-sdk/core/dist-es/submodules/util/index.js +1 -0
  4. package/node_modules/@aws-sdk/core/dist-types/submodules/util/hasOwn.d.ts +4 -0
  5. package/node_modules/@aws-sdk/core/dist-types/submodules/util/index.d.ts +1 -0
  6. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/util/hasOwn.d.ts +1 -0
  7. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/util/index.d.ts +1 -0
  8. package/node_modules/@aws-sdk/core/package.json +1 -1
  9. package/node_modules/@aws-sdk/credential-provider-env/package.json +2 -2
  10. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-cjs/index.js +11 -4
  11. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/http2/ClientHttp2SessionRef.js +1 -0
  12. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-manager.js +2 -3
  13. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js +8 -1
  14. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/package.json +2 -2
  15. package/node_modules/@aws-sdk/credential-provider-http/package.json +2 -2
  16. package/node_modules/@aws-sdk/credential-provider-ini/package.json +9 -9
  17. package/node_modules/@aws-sdk/credential-provider-login/package.json +3 -3
  18. package/node_modules/@aws-sdk/credential-provider-node/dist-cjs/index.js +2 -0
  19. package/node_modules/@aws-sdk/credential-provider-node/dist-es/runtime/memoize-chain.js +2 -0
  20. package/node_modules/@aws-sdk/credential-provider-node/package.json +7 -7
  21. package/node_modules/@aws-sdk/credential-provider-process/package.json +2 -2
  22. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/package.json +3 -3
  23. package/node_modules/@aws-sdk/credential-provider-sso/package.json +4 -4
  24. package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +3 -3
  25. package/node_modules/@aws-sdk/middleware-websocket/package.json +2 -2
  26. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +1 -1
  27. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +1 -1
  28. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +1 -1
  29. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +1 -1
  30. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +1 -1
  31. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-cjs/index.js +11 -4
  32. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/http2/ClientHttp2SessionRef.js +1 -0
  33. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-manager.js +2 -3
  34. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js +8 -1
  35. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/package.json +2 -2
  36. package/node_modules/@aws-sdk/nested-clients/package.json +2 -2
  37. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-PBNSMEG7.js → chunk-VDBOM5UG.js} +9 -9
  38. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/cli.js +1 -1
  39. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/index.js +1 -1
  40. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/rpc-entry.js +1 -1
  41. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/Client.md +25 -8
  42. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/EnvHttpProxyAgent.md +3 -2
  43. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/EventSource.md +4 -0
  44. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/Interceptors.md +7 -3
  45. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/Socks5ProxyAgent.md +7 -1
  46. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/api/readable.js +33 -43
  47. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/cache/memory-cache-store.js +2 -2
  48. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/core/connect.js +16 -2
  49. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/core/symbols.js +3 -0
  50. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/agent.js +7 -2
  51. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/balanced-pool.js +7 -4
  52. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/client-h1.js +9 -1
  53. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/client-h2.js +221 -12
  54. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/client.js +76 -30
  55. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/dispatcher-base.js +13 -1
  56. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/dispatcher.js +15 -1
  57. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/dispatcher1-wrapper.js +3 -0
  58. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +37 -8
  59. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/proxy-agent.js +18 -1
  60. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/retry-agent.js +3 -0
  61. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/round-robin-pool.js +1 -1
  62. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/socks5-proxy-agent.js +106 -22
  63. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/handler/cache-handler.js +29 -5
  64. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/handler/decorator-handler.js +7 -1
  65. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/handler/deduplication-handler.js +12 -6
  66. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/handler/redirect-handler.js +21 -4
  67. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/handler/retry-handler.js +155 -32
  68. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/interceptor/cache.js +65 -9
  69. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/interceptor/decompress.js +115 -13
  70. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/interceptor/deduplicate.js +5 -4
  71. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/interceptor/dns.js +7 -0
  72. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/interceptor/dump.js +10 -23
  73. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/mock/mock-agent.js +13 -1
  74. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/mock/mock-utils.js +217 -27
  75. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/util/cache.js +43 -3
  76. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/cookies/parse.js +150 -147
  77. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/eventsource/eventsource-stream.js +28 -1
  78. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/eventsource/eventsource.js +13 -3
  79. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/fetch/index.js +6 -0
  80. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/fetch/request.js +2 -3
  81. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/fetch/util.js +6 -1
  82. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/webidl/index.js +3 -3
  83. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/websocket/connection.js +1 -1
  84. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/websocket/permessage-deflate.js +5 -0
  85. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/websocket/stream/websocketstream.js +8 -10
  86. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/websocket/websocket.js +22 -0
  87. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/package.json +3 -3
  88. package/node_modules/@earendil-works/pi-coding-agent/npm-shrinkwrap.json +4 -4
  89. package/node_modules/@earendil-works/pi-coding-agent/package.json +1 -1
  90. package/node_modules/@earendil-works/pi-telemetry/package.json +1 -1
  91. package/node_modules/@smithy/core/dist-cjs/submodules/errors/index.js +20 -0
  92. package/node_modules/@smithy/core/dist-cjs/submodules/retry/index.browser.js +11 -10
  93. package/node_modules/@smithy/core/dist-cjs/submodules/retry/index.js +11 -10
  94. package/node_modules/@smithy/core/dist-es/submodules/errors/errors.js +18 -0
  95. package/node_modules/@smithy/core/dist-es/submodules/errors/index.js +1 -0
  96. package/node_modules/@smithy/core/dist-es/submodules/retry/service-error-classification/service-error-classification.js +11 -10
  97. package/node_modules/@smithy/core/dist-types/submodules/errors/errors.d.ts +44 -0
  98. package/node_modules/@smithy/core/dist-types/submodules/errors/index.d.ts +1 -0
  99. package/node_modules/@smithy/core/dist-types/submodules/retry/service-error-classification/service-error-classification.d.ts +4 -0
  100. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/errors/errors.d.ts +44 -0
  101. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/errors/index.d.ts +1 -0
  102. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/retry/service-error-classification/service-error-classification.d.ts +4 -0
  103. package/node_modules/@smithy/core/errors.d.ts +5 -0
  104. package/node_modules/@smithy/core/errors.js +5 -0
  105. package/node_modules/@smithy/core/package.json +11 -2
  106. package/node_modules/@smithy/fetch-http-handler/dist-cjs/index.js +2 -1
  107. package/node_modules/@smithy/fetch-http-handler/dist-es/fetch-http-handler.js +2 -1
  108. package/node_modules/@smithy/fetch-http-handler/package.json +3 -3
  109. package/node_modules/@smithy/types/dist-types/http/httpHandlerInitialization.d.ts +14 -0
  110. package/node_modules/@smithy/types/dist-types/ts3.4/http/httpHandlerInitialization.d.ts +14 -0
  111. package/node_modules/@smithy/types/package.json +1 -1
  112. package/node_modules/@types/node/README.md +3 -3
  113. package/node_modules/@types/node/assert/strict.d.ts +56 -13
  114. package/node_modules/@types/node/assert.d.ts +190 -189
  115. package/node_modules/@types/node/async_hooks.d.ts +43 -151
  116. package/node_modules/@types/node/buffer.buffer.d.ts +13 -12
  117. package/node_modules/@types/node/buffer.d.ts +237 -102
  118. package/node_modules/@types/node/child_process.d.ts +154 -39
  119. package/node_modules/@types/node/cluster.d.ts +384 -238
  120. package/node_modules/@types/node/compatibility/disposable.d.ts +14 -0
  121. package/node_modules/@types/node/compatibility/index.d.ts +9 -0
  122. package/node_modules/@types/node/compatibility/indexable.d.ts +20 -0
  123. package/node_modules/@types/node/compatibility/iterators.d.ts +20 -0
  124. package/node_modules/@types/node/console.d.ts +404 -45
  125. package/node_modules/@types/node/constants.d.ts +10 -3
  126. package/node_modules/@types/node/crypto.d.ts +1600 -1007
  127. package/node_modules/@types/node/dgram.d.ts +81 -133
  128. package/node_modules/@types/node/diagnostics_channel.d.ts +59 -277
  129. package/node_modules/@types/node/dns/promises.d.ts +15 -9
  130. package/node_modules/@types/node/dns.d.ts +183 -136
  131. package/node_modules/@types/node/domain.d.ts +32 -12
  132. package/node_modules/@types/node/events.d.ts +696 -728
  133. package/node_modules/@types/node/fs/promises.d.ts +85 -256
  134. package/node_modules/@types/node/fs.d.ts +525 -865
  135. package/node_modules/@types/node/globals.d.ts +34 -12
  136. package/node_modules/@types/node/globals.typedarray.d.ts +0 -63
  137. package/node_modules/@types/node/http.d.ts +311 -432
  138. package/node_modules/@types/node/http2.d.ts +891 -545
  139. package/node_modules/@types/node/https.d.ts +243 -64
  140. package/node_modules/@types/node/index.d.ts +7 -25
  141. package/node_modules/@types/node/inspector.d.ts +58 -70
  142. package/node_modules/@types/node/inspector.generated.d.ts +411 -765
  143. package/node_modules/@types/node/module.d.ts +219 -54
  144. package/node_modules/@types/node/net.d.ts +222 -208
  145. package/node_modules/@types/node/os.d.ts +49 -41
  146. package/node_modules/@types/node/package.json +3 -13
  147. package/node_modules/@types/node/path.d.ts +141 -119
  148. package/node_modules/@types/node/perf_hooks.d.ts +673 -310
  149. package/node_modules/@types/node/process.d.ts +205 -389
  150. package/node_modules/@types/node/punycode.d.ts +31 -3
  151. package/node_modules/@types/node/querystring.d.ts +16 -3
  152. package/node_modules/@types/node/readline/promises.d.ts +6 -3
  153. package/node_modules/@types/node/readline.d.ts +152 -66
  154. package/node_modules/@types/node/repl.d.ts +109 -101
  155. package/node_modules/@types/node/sea.d.ts +116 -1
  156. package/node_modules/@types/node/sqlite.d.ts +68 -486
  157. package/node_modules/@types/node/stream/consumers.d.ts +15 -91
  158. package/node_modules/@types/node/stream/promises.d.ts +15 -136
  159. package/node_modules/@types/node/stream/web.d.ts +456 -179
  160. package/node_modules/@types/node/stream.d.ts +491 -603
  161. package/node_modules/@types/node/string_decoder.d.ts +43 -3
  162. package/node_modules/@types/node/test.d.ts +292 -513
  163. package/node_modules/@types/node/timers/promises.d.ts +18 -3
  164. package/node_modules/@types/node/timers.d.ts +141 -3
  165. package/node_modules/@types/node/tls.d.ts +242 -140
  166. package/node_modules/@types/node/trace_events.d.ts +97 -3
  167. package/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +8 -7
  168. package/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +0 -2
  169. package/node_modules/@types/node/ts5.6/index.d.ts +6 -26
  170. package/node_modules/@types/node/tty.d.ts +43 -61
  171. package/node_modules/@types/node/url.d.ts +584 -156
  172. package/node_modules/@types/node/util.d.ts +1110 -181
  173. package/node_modules/@types/node/v8.d.ts +36 -175
  174. package/node_modules/@types/node/vm.d.ts +209 -292
  175. package/node_modules/@types/node/wasi.d.ts +74 -24
  176. package/node_modules/@types/node/web-globals/abortcontroller.d.ts +2 -27
  177. package/node_modules/@types/node/web-globals/domexception.d.ts +0 -15
  178. package/node_modules/@types/node/web-globals/events.d.ts +0 -9
  179. package/node_modules/@types/node/web-globals/fetch.d.ts +0 -14
  180. package/node_modules/@types/node/web-globals/navigator.d.ts +0 -3
  181. package/node_modules/@types/node/web-globals/streams.d.ts +0 -93
  182. package/node_modules/@types/node/worker_threads.d.ts +407 -257
  183. package/node_modules/@types/node/zlib.d.ts +165 -7
  184. package/node_modules/express-rate-limit/dist/index.cjs +6 -3
  185. package/node_modules/express-rate-limit/dist/index.d.cts +11 -0
  186. package/node_modules/express-rate-limit/dist/index.d.mts +11 -0
  187. package/node_modules/express-rate-limit/dist/index.d.ts +11 -0
  188. package/node_modules/express-rate-limit/dist/index.mjs +6 -3
  189. package/node_modules/express-rate-limit/{license.md → license} +7 -6
  190. package/node_modules/express-rate-limit/package.json +5 -5
  191. package/node_modules/express-rate-limit/readme.md +1 -0
  192. package/node_modules/fast-uri/index.js +20 -5
  193. package/node_modules/fast-uri/lib/utils.js +8 -1
  194. package/node_modules/fast-uri/package.json +1 -1
  195. package/node_modules/fast-uri/test/component-safe-serialization.test.js +58 -0
  196. package/node_modules/fast-uri/test/ipv6-validation.test.js +34 -0
  197. package/node_modules/hono/dist/cjs/client/client.js +4 -4
  198. package/node_modules/hono/dist/cjs/hono-base.js +7 -6
  199. package/node_modules/hono/dist/cjs/jsx/base.js +18 -1
  200. package/node_modules/hono/dist/cjs/jsx/components.js +25 -26
  201. package/node_modules/hono/dist/cjs/jsx/context.js +5 -5
  202. package/node_modules/hono/dist/cjs/jsx/dom/server.js +5 -1
  203. package/node_modules/hono/dist/cjs/jsx/intrinsic-element/components.js +2 -2
  204. package/node_modules/hono/dist/cjs/jsx/streaming.js +4 -5
  205. package/node_modules/hono/dist/client/client.js +4 -4
  206. package/node_modules/hono/dist/hono-base.js +7 -6
  207. package/node_modules/hono/dist/jsx/base.js +15 -1
  208. package/node_modules/hono/dist/jsx/components.js +26 -27
  209. package/node_modules/hono/dist/jsx/context.js +6 -6
  210. package/node_modules/hono/dist/jsx/dom/server.js +5 -1
  211. package/node_modules/hono/dist/jsx/intrinsic-element/components.js +3 -3
  212. package/node_modules/hono/dist/jsx/streaming.js +5 -6
  213. package/node_modules/hono/dist/types/context.d.ts +2 -2
  214. package/node_modules/hono/dist/types/jsx/base.d.ts +3 -0
  215. package/node_modules/hono/package.json +2 -2
  216. package/node_modules/ip-address/README.md +92 -82
  217. package/node_modules/ip-address/dist/common.d.ts +20 -0
  218. package/node_modules/ip-address/dist/common.js +36 -0
  219. package/node_modules/ip-address/dist/common.js.map +1 -1
  220. package/node_modules/ip-address/dist/ipv4.d.ts +50 -0
  221. package/node_modules/ip-address/dist/ipv4.js +75 -0
  222. package/node_modules/ip-address/dist/ipv4.js.map +1 -1
  223. package/node_modules/ip-address/dist/ipv6.d.ts +79 -10
  224. package/node_modules/ip-address/dist/ipv6.js +120 -30
  225. package/node_modules/ip-address/dist/ipv6.js.map +1 -1
  226. package/node_modules/ip-address/dist/v4/constants.d.ts +12 -0
  227. package/node_modules/ip-address/dist/v4/constants.js +40 -1
  228. package/node_modules/ip-address/dist/v4/constants.js.map +1 -1
  229. package/node_modules/ip-address/dist/v6/constants.d.ts +14 -0
  230. package/node_modules/ip-address/dist/v6/constants.js +47 -1
  231. package/node_modules/ip-address/dist/v6/constants.js.map +1 -1
  232. package/node_modules/ip-address/package.json +1 -1
  233. package/node_modules/jose/dist/types/index.d.ts +1 -2
  234. package/node_modules/jose/dist/types/jwe/compact/decrypt.d.ts +12 -25
  235. package/node_modules/jose/dist/types/jwe/compact/encrypt.d.ts +18 -32
  236. package/node_modules/jose/dist/types/jwe/flattened/decrypt.d.ts +12 -25
  237. package/node_modules/jose/dist/types/jwe/flattened/encrypt.d.ts +24 -50
  238. package/node_modules/jose/dist/types/jwe/general/decrypt.d.ts +15 -30
  239. package/node_modules/jose/dist/types/jwe/general/encrypt.d.ts +29 -52
  240. package/node_modules/jose/dist/types/jwk/embedded.d.ts +5 -8
  241. package/node_modules/jose/dist/types/jwk/thumbprint.d.ts +7 -9
  242. package/node_modules/jose/dist/types/jwks/local.d.ts +10 -13
  243. package/node_modules/jose/dist/types/jwks/remote.d.ts +29 -41
  244. package/node_modules/jose/dist/types/jws/compact/sign.d.ts +8 -13
  245. package/node_modules/jose/dist/types/jws/compact/verify.d.ts +14 -26
  246. package/node_modules/jose/dist/types/jws/flattened/sign.d.ts +10 -19
  247. package/node_modules/jose/dist/types/jws/flattened/verify.d.ts +14 -26
  248. package/node_modules/jose/dist/types/jws/general/sign.d.ts +19 -33
  249. package/node_modules/jose/dist/types/jws/general/verify.d.ts +17 -32
  250. package/node_modules/jose/dist/types/jwt/decrypt.d.ts +20 -27
  251. package/node_modules/jose/dist/types/jwt/encrypt.d.ts +30 -35
  252. package/node_modules/jose/dist/types/jwt/sign.d.ts +8 -13
  253. package/node_modules/jose/dist/types/jwt/unsecured.d.ts +10 -19
  254. package/node_modules/jose/dist/types/jwt/verify.d.ts +19 -22
  255. package/node_modules/jose/dist/types/key/export.d.ts +10 -10
  256. package/node_modules/jose/dist/types/key/generate_key_pair.d.ts +15 -22
  257. package/node_modules/jose/dist/types/key/generate_secret.d.ts +12 -19
  258. package/node_modules/jose/dist/types/key/import.d.ts +25 -31
  259. package/node_modules/jose/dist/types/types.d.ts +184 -319
  260. package/node_modules/jose/dist/types/util/base64url.d.ts +7 -7
  261. package/node_modules/jose/dist/types/util/decode_jwt.d.ts +5 -7
  262. package/node_modules/jose/dist/types/util/decode_protected_header.d.ts +6 -5
  263. package/node_modules/jose/dist/types/util/errors.d.ts +50 -88
  264. package/node_modules/jose/dist/webapi/index.js +70 -32
  265. package/node_modules/jose/dist/webapi/jwe/compact/decrypt.js +6 -8
  266. package/node_modules/jose/dist/webapi/jwe/compact/encrypt.js +25 -48
  267. package/node_modules/jose/dist/webapi/jwe/flattened/decrypt.js +14 -14
  268. package/node_modules/jose/dist/webapi/jwe/flattened/encrypt.js +34 -64
  269. package/node_modules/jose/dist/webapi/jwe/general/decrypt.js +38 -49
  270. package/node_modules/jose/dist/webapi/jwe/general/encrypt.js +100 -172
  271. package/node_modules/jose/dist/webapi/jwk/embedded.js +29 -32
  272. package/node_modules/jose/dist/webapi/jwk/thumbprint.js +51 -70
  273. package/node_modules/jose/dist/webapi/jwks/local.js +53 -64
  274. package/node_modules/jose/dist/webapi/jwks/remote.js +88 -136
  275. package/node_modules/jose/dist/webapi/jws/compact/sign.js +19 -21
  276. package/node_modules/jose/dist/webapi/jws/compact/verify.js +7 -8
  277. package/node_modules/jose/dist/webapi/jws/flattened/sign.js +22 -31
  278. package/node_modules/jose/dist/webapi/jws/flattened/verify.js +11 -24
  279. package/node_modules/jose/dist/webapi/jws/general/sign.js +55 -73
  280. package/node_modules/jose/dist/webapi/jws/general/verify.js +43 -69
  281. package/node_modules/jose/dist/webapi/jwt/decrypt.js +12 -20
  282. package/node_modules/jose/dist/webapi/jwt/encrypt.js +43 -70
  283. package/node_modules/jose/dist/webapi/jwt/sign.js +17 -16
  284. package/node_modules/jose/dist/webapi/jwt/unsecured.js +31 -40
  285. package/node_modules/jose/dist/webapi/jwt/verify.js +12 -14
  286. package/node_modules/jose/dist/webapi/key/export.js +32 -41
  287. package/node_modules/jose/dist/webapi/key/generate_key_pair.js +32 -49
  288. package/node_modules/jose/dist/webapi/key/generate_secret.js +35 -40
  289. package/node_modules/jose/dist/webapi/key/import.js +48 -56
  290. package/node_modules/jose/dist/webapi/lib/asn1.js +128 -169
  291. package/node_modules/jose/dist/webapi/lib/buffer_utils.js +72 -41
  292. package/node_modules/jose/dist/webapi/lib/content_encryption.js +75 -119
  293. package/node_modules/jose/dist/webapi/lib/deflate.js +35 -47
  294. package/node_modules/jose/dist/webapi/lib/jwe_algorithms.js +102 -93
  295. package/node_modules/jose/dist/webapi/lib/jwe_decrypt.js +178 -234
  296. package/node_modules/jose/dist/webapi/lib/jwe_encrypt.js +71 -138
  297. package/node_modules/jose/dist/webapi/lib/jws_algorithms.js +62 -61
  298. package/node_modules/jose/dist/webapi/lib/jws_sign.js +43 -82
  299. package/node_modules/jose/dist/webapi/lib/jws_verify.js +78 -131
  300. package/node_modules/jose/dist/webapi/lib/jwt_claims_set.js +123 -209
  301. package/node_modules/jose/dist/webapi/lib/key.js +147 -139
  302. package/node_modules/jose/dist/webapi/lib/key_algorithm.js +13 -8
  303. package/node_modules/jose/dist/webapi/lib/key_descriptor.js +8 -6
  304. package/node_modules/jose/dist/webapi/lib/key_management.js +169 -235
  305. package/node_modules/jose/dist/webapi/lib/validate.js +122 -0
  306. package/node_modules/jose/dist/webapi/util/base64url.js +14 -37
  307. package/node_modules/jose/dist/webapi/util/decode_jwt.js +32 -31
  308. package/node_modules/jose/dist/webapi/util/decode_protected_header.js +18 -23
  309. package/node_modules/jose/dist/webapi/util/errors.js +94 -84
  310. package/node_modules/jose/package.json +17 -81
  311. package/node_modules/protobufjs/dist/light/protobuf.js +59 -6
  312. package/node_modules/protobufjs/dist/light/protobuf.js.map +1 -1
  313. package/node_modules/protobufjs/dist/light/protobuf.min.js +3 -3
  314. package/node_modules/protobufjs/dist/light/protobuf.min.js.map +1 -1
  315. package/node_modules/protobufjs/dist/minimal/protobuf.js +22 -2
  316. package/node_modules/protobufjs/dist/minimal/protobuf.js.map +1 -1
  317. package/node_modules/protobufjs/dist/minimal/protobuf.min.js +3 -3
  318. package/node_modules/protobufjs/dist/minimal/protobuf.min.js.map +1 -1
  319. package/node_modules/protobufjs/dist/protobuf.js +59 -6
  320. package/node_modules/protobufjs/dist/protobuf.js.map +1 -1
  321. package/node_modules/protobufjs/dist/protobuf.min.js +3 -3
  322. package/node_modules/protobufjs/dist/protobuf.min.js.map +1 -1
  323. package/node_modules/protobufjs/package.json +1 -1
  324. package/node_modules/protobufjs/src/decoder.js +32 -3
  325. package/node_modules/protobufjs/src/reader.js +20 -0
  326. package/node_modules/protobufjs/src/wrappers.js +5 -1
  327. package/node_modules/qs/.github/THREAT_MODEL.md +3 -3
  328. package/node_modules/qs/CHANGELOG.md +15 -0
  329. package/node_modules/qs/README.md +19 -1
  330. package/node_modules/qs/dist/qs.js +21 -21
  331. package/node_modules/qs/eslint.config.mjs +1 -1
  332. package/node_modules/qs/lib/parse.js +3 -4
  333. package/node_modules/qs/lib/stringify.js +23 -8
  334. package/node_modules/qs/lib/utils.js +10 -3
  335. package/node_modules/qs/package.json +4 -4
  336. package/node_modules/qs/test/parse.js +192 -3
  337. package/node_modules/qs/test/stringify.js +317 -0
  338. package/node_modules/qs/test/utils.js +12 -0
  339. package/node_modules/undici/lib/dispatcher/balanced-pool.js +4 -2
  340. package/node_modules/undici/lib/dispatcher/client-h1.js +12 -4
  341. package/node_modules/undici/lib/dispatcher/client-h2.js +70 -14
  342. package/node_modules/undici/lib/dispatcher/client.js +6 -2
  343. package/node_modules/undici/lib/handler/cache-handler.js +21 -5
  344. package/node_modules/undici/lib/handler/retry-handler.js +42 -7
  345. package/node_modules/undici/lib/interceptor/cache.js +20 -1
  346. package/node_modules/undici/lib/interceptor/decompress.js +146 -14
  347. package/node_modules/undici/lib/interceptor/dump.js +10 -23
  348. package/node_modules/undici/lib/web/eventsource/eventsource-stream.js +245 -150
  349. package/node_modules/undici/lib/web/websocket/connection.js +1 -1
  350. package/node_modules/undici/lib/web/websocket/permessage-deflate.js +5 -0
  351. package/node_modules/undici/lib/web/websocket/stream/websocketstream.js +8 -10
  352. package/node_modules/undici/package.json +1 -1
  353. package/node_modules/undici/types/interceptors.d.ts +2 -0
  354. package/node_modules/undici-types/agent.d.ts +13 -12
  355. package/node_modules/undici-types/api.d.ts +26 -26
  356. package/node_modules/undici-types/balanced-pool.d.ts +12 -13
  357. package/node_modules/undici-types/client.d.ts +34 -55
  358. package/node_modules/undici-types/connector.d.ts +2 -4
  359. package/node_modules/undici-types/cookies.d.ts +0 -2
  360. package/node_modules/undici-types/diagnostics-channel.d.ts +10 -18
  361. package/node_modules/undici-types/dispatcher.d.ts +137 -134
  362. package/node_modules/undici-types/env-http-proxy-agent.d.ts +3 -4
  363. package/node_modules/undici-types/errors.d.ts +54 -82
  364. package/node_modules/undici-types/eventsource.d.ts +4 -9
  365. package/node_modules/undici-types/fetch.d.ts +24 -46
  366. package/node_modules/undici-types/file.d.ts +39 -0
  367. package/node_modules/undici-types/filereader.d.ts +54 -0
  368. package/node_modules/undici-types/formdata.d.ts +7 -7
  369. package/node_modules/undici-types/global-dispatcher.d.ts +4 -4
  370. package/node_modules/undici-types/global-origin.d.ts +5 -5
  371. package/node_modules/undici-types/handlers.d.ts +9 -8
  372. package/node_modules/undici-types/header.d.ts +1 -162
  373. package/node_modules/undici-types/index.d.ts +47 -69
  374. package/node_modules/undici-types/interceptors.d.ts +9 -72
  375. package/node_modules/undici-types/mock-agent.d.ts +18 -36
  376. package/node_modules/undici-types/mock-client.d.ts +4 -6
  377. package/node_modules/undici-types/mock-errors.d.ts +3 -3
  378. package/node_modules/undici-types/mock-interceptor.d.ts +20 -21
  379. package/node_modules/undici-types/mock-pool.d.ts +4 -6
  380. package/node_modules/undici-types/package.json +1 -1
  381. package/node_modules/undici-types/patch.d.ts +4 -0
  382. package/node_modules/undici-types/pool-stats.d.ts +8 -8
  383. package/node_modules/undici-types/pool.d.ts +14 -14
  384. package/node_modules/undici-types/proxy-agent.d.ts +6 -7
  385. package/node_modules/undici-types/readable.d.ts +16 -19
  386. package/node_modules/undici-types/retry-agent.d.ts +1 -1
  387. package/node_modules/undici-types/retry-handler.d.ts +10 -19
  388. package/node_modules/undici-types/util.d.ts +3 -3
  389. package/node_modules/undici-types/webidl.d.ts +30 -148
  390. package/node_modules/undici-types/websocket.d.ts +10 -48
  391. package/node_modules/zod/README.md +27 -0
  392. package/node_modules/zod/compile.cjs +96 -0
  393. package/node_modules/zod/compile.d.cts +1 -0
  394. package/node_modules/zod/compile.d.ts +1 -0
  395. package/node_modules/zod/compile.js +52 -0
  396. package/node_modules/zod/index.cjs +21 -2
  397. package/node_modules/zod/index.d.cts +1 -2
  398. package/node_modules/zod/index.d.ts +1 -2
  399. package/node_modules/zod/index.js +5 -2
  400. package/node_modules/zod/locales/index.cjs +19 -0
  401. package/node_modules/zod/mini/index.cjs +19 -0
  402. package/node_modules/zod/package.json +20 -8
  403. package/node_modules/zod/src/compile.ts +56 -0
  404. package/node_modules/zod/src/index.ts +5 -2
  405. package/node_modules/zod/src/v3/ZodError.ts +22 -12
  406. package/node_modules/zod/src/v3/helpers/errorUtil.ts +1 -1
  407. package/node_modules/zod/src/v3/tests/error.test.ts +35 -0
  408. package/node_modules/zod/src/v3/tests/intersection.test.ts +18 -0
  409. package/node_modules/zod/src/v3/tests/language-server.test.ts +1 -2
  410. package/node_modules/zod/src/v3/tests/object.test.ts +3 -6
  411. package/node_modules/zod/src/v3/tests/readonly.test.ts +0 -80
  412. package/node_modules/zod/src/v3/tests/string.test.ts +6 -0
  413. package/node_modules/zod/src/v3/types.ts +5 -5
  414. package/node_modules/zod/src/v4/classic/compat.ts +26 -18
  415. package/node_modules/zod/src/v4/classic/deep-partial.ts +76 -0
  416. package/node_modules/zod/src/v4/classic/errors.ts +59 -44
  417. package/node_modules/zod/src/v4/classic/external.ts +14 -9
  418. package/node_modules/zod/src/v4/classic/from-json-schema.ts +363 -78
  419. package/node_modules/zod/src/v4/classic/in-out.ts +45 -0
  420. package/node_modules/zod/src/v4/classic/index.ts +2 -2
  421. package/node_modules/zod/src/v4/classic/iso.ts +2 -72
  422. package/node_modules/zod/src/v4/classic/parse.ts +10 -4
  423. package/node_modules/zod/src/v4/classic/schemas.ts +652 -371
  424. package/node_modules/zod/src/v4/classic/tests/apply.test.ts +27 -0
  425. package/node_modules/zod/src/v4/classic/tests/array.test.ts +2 -2
  426. package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +185 -0
  427. package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +36 -1
  428. package/node_modules/zod/src/v4/classic/tests/catch.test.ts +278 -0
  429. package/node_modules/zod/src/v4/classic/tests/codec-examples.test.ts +1 -2
  430. package/node_modules/zod/src/v4/classic/tests/codec.test.ts +2 -1
  431. package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +3 -3
  432. package/node_modules/zod/src/v4/classic/tests/credit-card.test.ts +76 -0
  433. package/node_modules/zod/src/v4/classic/tests/cyclic-data.test.ts +994 -0
  434. package/node_modules/zod/src/v4/classic/tests/date.test.ts +30 -0
  435. package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +32 -18
  436. package/node_modules/zod/src/v4/classic/tests/deep-partial.test.ts +380 -0
  437. package/node_modules/zod/src/v4/classic/tests/default-locale.test.ts +32 -0
  438. package/node_modules/zod/src/v4/classic/tests/default.test.ts +46 -0
  439. package/node_modules/zod/src/v4/classic/tests/detached-methods.test.ts +31 -7
  440. package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +261 -13
  441. package/node_modules/zod/src/v4/classic/tests/enum.test.ts +20 -0
  442. package/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +112 -2
  443. package/node_modules/zod/src/v4/classic/tests/error.test.ts +403 -6
  444. package/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +4 -0
  445. package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +582 -10
  446. package/node_modules/zod/src/v4/classic/tests/function.test.ts +31 -0
  447. package/node_modules/zod/src/v4/classic/tests/global-config.test.ts +2 -9
  448. package/node_modules/zod/src/v4/classic/tests/hash.test.ts +1 -2
  449. package/node_modules/zod/src/v4/classic/tests/iban.test.ts +81 -0
  450. package/node_modules/zod/src/v4/classic/tests/in-out.test.ts +159 -0
  451. package/node_modules/zod/src/v4/classic/tests/index.test.ts +21 -2
  452. package/node_modules/zod/src/v4/classic/tests/instance-footprint.test.ts +297 -0
  453. package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +67 -0
  454. package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +136 -0
  455. package/node_modules/zod/src/v4/classic/tests/issue-schema.test.ts +215 -0
  456. package/node_modules/zod/src/v4/classic/tests/jitless-allows-eval.test.ts +3 -10
  457. package/node_modules/zod/src/v4/classic/tests/lazy.test.ts +36 -1
  458. package/node_modules/zod/src/v4/classic/tests/literal.test.ts +12 -1
  459. package/node_modules/zod/src/v4/classic/tests/map.test.ts +12 -0
  460. package/node_modules/zod/src/v4/classic/tests/number.test.ts +46 -9
  461. package/node_modules/zod/src/v4/classic/tests/object.test.ts +301 -12
  462. package/node_modules/zod/src/v4/classic/tests/optin-ladder.test.ts +235 -0
  463. package/node_modules/zod/src/v4/classic/tests/optional.test.ts +49 -16
  464. package/node_modules/zod/src/v4/classic/tests/partial.test.ts +51 -4
  465. package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +70 -0
  466. package/node_modules/zod/src/v4/classic/tests/preprocess-types.test.ts +20 -2
  467. package/node_modules/zod/src/v4/classic/tests/properties.test.ts +225 -0
  468. package/node_modules/zod/src/v4/classic/tests/readonly.test.ts +0 -68
  469. package/node_modules/zod/src/v4/classic/tests/record.test.ts +186 -18
  470. package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +79 -3
  471. package/node_modules/zod/src/v4/classic/tests/redos.test.ts +68 -0
  472. package/node_modules/zod/src/v4/classic/tests/refine.test.ts +60 -0
  473. package/node_modules/zod/src/v4/classic/tests/set.test.ts +9 -0
  474. package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +19 -0
  475. package/node_modules/zod/src/v4/classic/tests/string.test.ts +152 -5
  476. package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +18 -0
  477. package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +44 -3
  478. package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +1758 -202
  479. package/node_modules/zod/src/v4/classic/tests/tuple.test.ts +45 -30
  480. package/node_modules/zod/src/v4/classic/tests/union.test.ts +39 -2
  481. package/node_modules/zod/src/v4/classic/tests/validate.test.ts +645 -0
  482. package/node_modules/zod/src/v4/classic/tests/validations.test.ts +2 -2
  483. package/node_modules/zod/src/v4/core/api.ts +73 -13
  484. package/node_modules/zod/src/v4/core/checks.ts +58 -145
  485. package/node_modules/zod/src/v4/core/compile.ts +2302 -0
  486. package/node_modules/zod/src/v4/core/core.ts +98 -19
  487. package/node_modules/zod/src/v4/core/doc.ts +17 -9
  488. package/node_modules/zod/src/v4/core/errors.ts +113 -25
  489. package/node_modules/zod/src/v4/core/index.ts +3 -0
  490. package/node_modules/zod/src/v4/core/json-schema-generator.ts +8 -3
  491. package/node_modules/zod/src/v4/core/json-schema-processors.ts +468 -146
  492. package/node_modules/zod/src/v4/core/json-schema.ts +2 -1
  493. package/node_modules/zod/src/v4/core/memoizer.ts +334 -0
  494. package/node_modules/zod/src/v4/core/parse.ts +164 -50
  495. package/node_modules/zod/src/v4/core/regexes.ts +38 -15
  496. package/node_modules/zod/src/v4/core/registries.ts +2 -2
  497. package/node_modules/zod/src/v4/core/schemas.ts +1073 -538
  498. package/node_modules/zod/src/v4/core/tests/cached.test.ts +54 -0
  499. package/node_modules/zod/src/v4/core/tests/compile-differential.test.ts +969 -0
  500. package/node_modules/zod/src/v4/core/tests/compile-generative.test.ts +445 -0
  501. package/node_modules/zod/src/v4/core/tests/compile-global.test.ts +89 -0
  502. package/node_modules/zod/src/v4/core/tests/compile-off-by-default.test.ts +26 -0
  503. package/node_modules/zod/src/v4/core/tests/compile-stats.test.ts +34 -0
  504. package/node_modules/zod/src/v4/core/tests/compile.test.ts +1859 -0
  505. package/node_modules/zod/src/v4/core/tests/email-regex.test.ts +140 -0
  506. package/node_modules/zod/src/v4/core/tests/locales/el.test.ts +1 -2
  507. package/node_modules/zod/src/v4/core/tests/locales/es.test.ts +1 -2
  508. package/node_modules/zod/src/v4/core/tests/locales/fr.test.ts +3 -3
  509. package/node_modules/zod/src/v4/core/tests/locales/parity.test.ts +42 -0
  510. package/node_modules/zod/src/v4/core/tests/locales/tg.test.ts +85 -0
  511. package/node_modules/zod/src/v4/core/tests/locales/tk.test.ts +69 -0
  512. package/node_modules/zod/src/v4/core/tests/polyfill-collision.test.ts +46 -0
  513. package/node_modules/zod/src/v4/core/tests/treeshake.test.ts +51 -0
  514. package/node_modules/zod/src/v4/core/tests/url-no-canparse.test.ts +31 -0
  515. package/node_modules/zod/src/v4/core/to-json-schema.ts +284 -49
  516. package/node_modules/zod/src/v4/core/util.ts +458 -157
  517. package/node_modules/zod/src/v4/core/versions.ts +2 -2
  518. package/node_modules/zod/src/v4/core/visit.ts +204 -0
  519. package/node_modules/zod/src/v4/index.ts +3 -3
  520. package/node_modules/zod/src/v4/locales/ar.ts +4 -0
  521. package/node_modules/zod/src/v4/locales/az.ts +4 -0
  522. package/node_modules/zod/src/v4/locales/be.ts +11 -0
  523. package/node_modules/zod/src/v4/locales/bg.ts +4 -0
  524. package/node_modules/zod/src/v4/locales/bn.ts +122 -0
  525. package/node_modules/zod/src/v4/locales/ca.ts +4 -0
  526. package/node_modules/zod/src/v4/locales/ckb.ts +139 -0
  527. package/node_modules/zod/src/v4/locales/cs.ts +4 -0
  528. package/node_modules/zod/src/v4/locales/da.ts +6 -2
  529. package/node_modules/zod/src/v4/locales/de.ts +4 -0
  530. package/node_modules/zod/src/v4/locales/el.ts +2 -0
  531. package/node_modules/zod/src/v4/locales/en.ts +16 -4
  532. package/node_modules/zod/src/v4/locales/eo.ts +4 -0
  533. package/node_modules/zod/src/v4/locales/es.ts +3 -0
  534. package/node_modules/zod/src/v4/locales/fa.ts +4 -0
  535. package/node_modules/zod/src/v4/locales/fi.ts +4 -0
  536. package/node_modules/zod/src/v4/locales/fr-CA.ts +4 -0
  537. package/node_modules/zod/src/v4/locales/fr.ts +20 -14
  538. package/node_modules/zod/src/v4/locales/gu.ts +122 -0
  539. package/node_modules/zod/src/v4/locales/he.ts +7 -1
  540. package/node_modules/zod/src/v4/locales/hi.ts +125 -0
  541. package/node_modules/zod/src/v4/locales/hr.ts +3 -0
  542. package/node_modules/zod/src/v4/locales/hu.ts +4 -0
  543. package/node_modules/zod/src/v4/locales/hy.ts +10 -0
  544. package/node_modules/zod/src/v4/locales/id.ts +4 -0
  545. package/node_modules/zod/src/v4/locales/index.ts +11 -0
  546. package/node_modules/zod/src/v4/locales/is.ts +4 -0
  547. package/node_modules/zod/src/v4/locales/it.ts +4 -0
  548. package/node_modules/zod/src/v4/locales/ja.ts +4 -0
  549. package/node_modules/zod/src/v4/locales/ka.ts +4 -0
  550. package/node_modules/zod/src/v4/locales/km.ts +4 -0
  551. package/node_modules/zod/src/v4/locales/kn.ts +125 -0
  552. package/node_modules/zod/src/v4/locales/ko.ts +4 -0
  553. package/node_modules/zod/src/v4/locales/lt.ts +3 -0
  554. package/node_modules/zod/src/v4/locales/mk.ts +4 -0
  555. package/node_modules/zod/src/v4/locales/ms.ts +4 -0
  556. package/node_modules/zod/src/v4/locales/ne.ts +127 -0
  557. package/node_modules/zod/src/v4/locales/nl.ts +4 -0
  558. package/node_modules/zod/src/v4/locales/nn.ts +120 -0
  559. package/node_modules/zod/src/v4/locales/no.ts +6 -2
  560. package/node_modules/zod/src/v4/locales/ota.ts +4 -0
  561. package/node_modules/zod/src/v4/locales/pl.ts +4 -0
  562. package/node_modules/zod/src/v4/locales/ps.ts +4 -0
  563. package/node_modules/zod/src/v4/locales/pt-BR.ts +160 -0
  564. package/node_modules/zod/src/v4/locales/pt.ts +100 -58
  565. package/node_modules/zod/src/v4/locales/ro.ts +2 -0
  566. package/node_modules/zod/src/v4/locales/ru.ts +11 -0
  567. package/node_modules/zod/src/v4/locales/sk.ts +122 -0
  568. package/node_modules/zod/src/v4/locales/sl.ts +4 -0
  569. package/node_modules/zod/src/v4/locales/sv.ts +6 -2
  570. package/node_modules/zod/src/v4/locales/ta.ts +4 -0
  571. package/node_modules/zod/src/v4/locales/tg.ts +134 -0
  572. package/node_modules/zod/src/v4/locales/th.ts +4 -0
  573. package/node_modules/zod/src/v4/locales/tk.ts +112 -0
  574. package/node_modules/zod/src/v4/locales/tr.ts +4 -0
  575. package/node_modules/zod/src/v4/locales/uk.ts +4 -0
  576. package/node_modules/zod/src/v4/locales/ur.ts +4 -0
  577. package/node_modules/zod/src/v4/locales/uz.ts +2 -0
  578. package/node_modules/zod/src/v4/locales/vi.ts +4 -0
  579. package/node_modules/zod/src/v4/locales/yo.ts +4 -0
  580. package/node_modules/zod/src/v4/locales/zh-CN.ts +4 -0
  581. package/node_modules/zod/src/v4/locales/zh-TW.ts +4 -0
  582. package/node_modules/zod/src/v4/mini/deep-partial.ts +73 -0
  583. package/node_modules/zod/src/v4/mini/external.ts +12 -1
  584. package/node_modules/zod/src/v4/mini/in-out.ts +45 -0
  585. package/node_modules/zod/src/v4/mini/parse.ts +2 -0
  586. package/node_modules/zod/src/v4/mini/schemas.ts +174 -59
  587. package/node_modules/zod/src/v4/mini/tests/apply.test.ts +33 -0
  588. package/node_modules/zod/src/v4/mini/tests/assignability.test.ts +62 -1
  589. package/node_modules/zod/src/v4/mini/tests/checks.test.ts +14 -0
  590. package/node_modules/zod/src/v4/mini/tests/codec.test.ts +35 -1
  591. package/node_modules/zod/src/v4/mini/tests/computed.test.ts +11 -17
  592. package/node_modules/zod/src/v4/mini/tests/cyclic-data.test.ts +84 -0
  593. package/node_modules/zod/src/v4/mini/tests/deep-partial.test.ts +54 -0
  594. package/node_modules/zod/src/v4/mini/tests/error.test.ts +23 -4
  595. package/node_modules/zod/src/v4/mini/tests/functions.test.ts +9 -0
  596. package/node_modules/zod/src/v4/mini/tests/index.test.ts +102 -5
  597. package/node_modules/zod/src/v4/mini/tests/number.test.ts +14 -0
  598. package/node_modules/zod/src/v4/mini/tests/object.test.ts +65 -0
  599. package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +16 -0
  600. package/node_modules/zod/src/v4/mini/tests/string.test.ts +37 -0
  601. package/node_modules/zod/v3/ZodError.cjs +41 -12
  602. package/node_modules/zod/v3/ZodError.d.cts +1 -1
  603. package/node_modules/zod/v3/ZodError.d.ts +1 -1
  604. package/node_modules/zod/v3/ZodError.js +22 -12
  605. package/node_modules/zod/v3/errors.cjs +19 -0
  606. package/node_modules/zod/v3/external.cjs +19 -0
  607. package/node_modules/zod/v3/helpers/enumUtil.cjs +19 -0
  608. package/node_modules/zod/v3/helpers/errorUtil.cjs +20 -1
  609. package/node_modules/zod/v3/helpers/errorUtil.js +1 -1
  610. package/node_modules/zod/v3/helpers/parseUtil.cjs +19 -0
  611. package/node_modules/zod/v3/helpers/partialUtil.cjs +19 -0
  612. package/node_modules/zod/v3/helpers/typeAliases.cjs +19 -0
  613. package/node_modules/zod/v3/helpers/util.cjs +19 -0
  614. package/node_modules/zod/v3/index.cjs +19 -0
  615. package/node_modules/zod/v3/standard-schema.cjs +19 -0
  616. package/node_modules/zod/v3/types.cjs +26 -5
  617. package/node_modules/zod/v3/types.js +7 -5
  618. package/node_modules/zod/v4/classic/checks.cjs +19 -0
  619. package/node_modules/zod/v4/classic/coerce.cjs +19 -0
  620. package/node_modules/zod/v4/classic/compat.cjs +19 -0
  621. package/node_modules/zod/v4/classic/compat.d.cts +9 -11
  622. package/node_modules/zod/v4/classic/compat.d.ts +9 -11
  623. package/node_modules/zod/v4/classic/deep-partial.cjs +58 -0
  624. package/node_modules/zod/v4/classic/deep-partial.d.cts +14 -0
  625. package/node_modules/zod/v4/classic/deep-partial.d.ts +14 -0
  626. package/node_modules/zod/v4/classic/deep-partial.js +13 -0
  627. package/node_modules/zod/v4/classic/errors.cjs +62 -34
  628. package/node_modules/zod/v4/classic/errors.d.cts +3 -4
  629. package/node_modules/zod/v4/classic/errors.d.ts +3 -4
  630. package/node_modules/zod/v4/classic/errors.js +43 -34
  631. package/node_modules/zod/v4/classic/external.cjs +51 -27
  632. package/node_modules/zod/v4/classic/external.d.cts +5 -2
  633. package/node_modules/zod/v4/classic/external.d.ts +5 -2
  634. package/node_modules/zod/v4/classic/external.js +5 -8
  635. package/node_modules/zod/v4/classic/from-json-schema.cjs +376 -75
  636. package/node_modules/zod/v4/classic/from-json-schema.js +357 -75
  637. package/node_modules/zod/v4/classic/in-out.cjs +82 -0
  638. package/node_modules/zod/v4/classic/in-out.d.cts +8 -0
  639. package/node_modules/zod/v4/classic/in-out.d.ts +8 -0
  640. package/node_modules/zod/v4/classic/in-out.js +36 -0
  641. package/node_modules/zod/v4/classic/index.cjs +21 -2
  642. package/node_modules/zod/v4/classic/index.d.cts +1 -2
  643. package/node_modules/zod/v4/classic/index.d.ts +1 -2
  644. package/node_modules/zod/v4/classic/index.js +2 -2
  645. package/node_modules/zod/v4/classic/iso.cjs +30 -22
  646. package/node_modules/zod/v4/classic/iso.d.cts +2 -17
  647. package/node_modules/zod/v4/classic/iso.d.ts +2 -17
  648. package/node_modules/zod/v4/classic/iso.js +2 -17
  649. package/node_modules/zod/v4/classic/parse.cjs +23 -1
  650. package/node_modules/zod/v4/classic/parse.d.cts +17 -4
  651. package/node_modules/zod/v4/classic/parse.d.ts +17 -4
  652. package/node_modules/zod/v4/classic/parse.js +1 -0
  653. package/node_modules/zod/v4/classic/schemas.cjs +591 -422
  654. package/node_modules/zod/v4/classic/schemas.d.cts +70 -19
  655. package/node_modules/zod/v4/classic/schemas.d.ts +70 -19
  656. package/node_modules/zod/v4/classic/schemas.js +564 -420
  657. package/node_modules/zod/v4/core/api.cjs +58 -4
  658. package/node_modules/zod/v4/core/api.d.cts +16 -10
  659. package/node_modules/zod/v4/core/api.d.ts +16 -10
  660. package/node_modules/zod/v4/core/api.js +36 -4
  661. package/node_modules/zod/v4/core/checks.cjs +56 -127
  662. package/node_modules/zod/v4/core/checks.d.cts +13 -13
  663. package/node_modules/zod/v4/core/checks.d.ts +13 -13
  664. package/node_modules/zod/v4/core/checks.js +37 -127
  665. package/node_modules/zod/v4/core/compile.cjs +1913 -0
  666. package/node_modules/zod/v4/core/compile.d.cts +65 -0
  667. package/node_modules/zod/v4/core/compile.d.ts +65 -0
  668. package/node_modules/zod/v4/core/compile.js +1863 -0
  669. package/node_modules/zod/v4/core/core.cjs +100 -18
  670. package/node_modules/zod/v4/core/core.d.cts +16 -4
  671. package/node_modules/zod/v4/core/core.d.ts +16 -4
  672. package/node_modules/zod/v4/core/core.js +82 -19
  673. package/node_modules/zod/v4/core/doc.cjs +31 -9
  674. package/node_modules/zod/v4/core/doc.d.cts +3 -1
  675. package/node_modules/zod/v4/core/doc.d.ts +3 -1
  676. package/node_modules/zod/v4/core/doc.js +12 -9
  677. package/node_modules/zod/v4/core/errors.cjs +126 -25
  678. package/node_modules/zod/v4/core/errors.d.cts +4 -0
  679. package/node_modules/zod/v4/core/errors.d.ts +4 -0
  680. package/node_modules/zod/v4/core/errors.js +107 -25
  681. package/node_modules/zod/v4/core/index.cjs +24 -1
  682. package/node_modules/zod/v4/core/index.d.cts +3 -0
  683. package/node_modules/zod/v4/core/index.d.ts +3 -0
  684. package/node_modules/zod/v4/core/index.js +3 -0
  685. package/node_modules/zod/v4/core/json-schema-generator.cjs +24 -1
  686. package/node_modules/zod/v4/core/json-schema-generator.d.cts +2 -2
  687. package/node_modules/zod/v4/core/json-schema-generator.d.ts +2 -2
  688. package/node_modules/zod/v4/core/json-schema-generator.js +6 -2
  689. package/node_modules/zod/v4/core/json-schema-processors.cjs +470 -149
  690. package/node_modules/zod/v4/core/json-schema-processors.d.cts +17 -0
  691. package/node_modules/zod/v4/core/json-schema-processors.d.ts +17 -0
  692. package/node_modules/zod/v4/core/json-schema-processors.js +427 -150
  693. package/node_modules/zod/v4/core/json-schema.cjs +19 -0
  694. package/node_modules/zod/v4/core/json-schema.d.cts +2 -1
  695. package/node_modules/zod/v4/core/json-schema.d.ts +2 -1
  696. package/node_modules/zod/v4/core/memoizer.cjs +363 -0
  697. package/node_modules/zod/v4/core/memoizer.d.cts +15 -0
  698. package/node_modules/zod/v4/core/memoizer.d.ts +15 -0
  699. package/node_modules/zod/v4/core/memoizer.js +314 -0
  700. package/node_modules/zod/v4/core/parse.cjs +148 -46
  701. package/node_modules/zod/v4/core/parse.d.cts +14 -11
  702. package/node_modules/zod/v4/core/parse.d.ts +14 -11
  703. package/node_modules/zod/v4/core/parse.js +127 -45
  704. package/node_modules/zod/v4/core/regexes.cjs +52 -17
  705. package/node_modules/zod/v4/core/regexes.d.cts +4 -0
  706. package/node_modules/zod/v4/core/regexes.d.ts +4 -0
  707. package/node_modules/zod/v4/core/regexes.js +30 -15
  708. package/node_modules/zod/v4/core/registries.cjs +19 -0
  709. package/node_modules/zod/v4/core/registries.js +2 -2
  710. package/node_modules/zod/v4/core/schemas.cjs +826 -387
  711. package/node_modules/zod/v4/core/schemas.d.cts +140 -36
  712. package/node_modules/zod/v4/core/schemas.d.ts +140 -36
  713. package/node_modules/zod/v4/core/schemas.js +796 -387
  714. package/node_modules/zod/v4/core/standard-schema.cjs +19 -0
  715. package/node_modules/zod/v4/core/to-json-schema.cjs +270 -45
  716. package/node_modules/zod/v4/core/to-json-schema.d.cts +48 -5
  717. package/node_modules/zod/v4/core/to-json-schema.d.ts +48 -5
  718. package/node_modules/zod/v4/core/to-json-schema.js +248 -45
  719. package/node_modules/zod/v4/core/util.cjs +376 -157
  720. package/node_modules/zod/v4/core/util.d.cts +79 -1
  721. package/node_modules/zod/v4/core/util.d.ts +79 -1
  722. package/node_modules/zod/v4/core/util.js +345 -156
  723. package/node_modules/zod/v4/core/versions.cjs +21 -2
  724. package/node_modules/zod/v4/core/versions.d.cts +1 -1
  725. package/node_modules/zod/v4/core/versions.d.ts +1 -1
  726. package/node_modules/zod/v4/core/versions.js +2 -2
  727. package/node_modules/zod/v4/core/visit.cjs +226 -0
  728. package/node_modules/zod/v4/core/visit.d.cts +30 -0
  729. package/node_modules/zod/v4/core/visit.d.ts +30 -0
  730. package/node_modules/zod/v4/core/visit.js +181 -0
  731. package/node_modules/zod/v4/index.cjs +34 -5
  732. package/node_modules/zod/v4/index.d.cts +2 -2
  733. package/node_modules/zod/v4/index.d.ts +2 -2
  734. package/node_modules/zod/v4/index.js +3 -2
  735. package/node_modules/zod/v4/locales/ar.cjs +4 -0
  736. package/node_modules/zod/v4/locales/ar.js +4 -0
  737. package/node_modules/zod/v4/locales/az.cjs +4 -0
  738. package/node_modules/zod/v4/locales/az.js +4 -0
  739. package/node_modules/zod/v4/locales/be.cjs +11 -0
  740. package/node_modules/zod/v4/locales/be.js +11 -0
  741. package/node_modules/zod/v4/locales/bg.cjs +4 -0
  742. package/node_modules/zod/v4/locales/bg.js +4 -0
  743. package/node_modules/zod/v4/locales/bn.cjs +139 -0
  744. package/node_modules/zod/v4/locales/bn.d.cts +5 -0
  745. package/node_modules/zod/v4/locales/bn.d.ts +4 -0
  746. package/node_modules/zod/v4/locales/bn.js +112 -0
  747. package/node_modules/zod/v4/locales/ca.cjs +4 -0
  748. package/node_modules/zod/v4/locales/ca.js +4 -0
  749. package/node_modules/zod/v4/locales/ckb.cjs +159 -0
  750. package/node_modules/zod/v4/locales/ckb.d.cts +5 -0
  751. package/node_modules/zod/v4/locales/ckb.d.ts +4 -0
  752. package/node_modules/zod/v4/locales/ckb.js +132 -0
  753. package/node_modules/zod/v4/locales/cs.cjs +4 -0
  754. package/node_modules/zod/v4/locales/cs.js +4 -0
  755. package/node_modules/zod/v4/locales/da.cjs +6 -2
  756. package/node_modules/zod/v4/locales/da.js +6 -2
  757. package/node_modules/zod/v4/locales/de.cjs +4 -0
  758. package/node_modules/zod/v4/locales/de.js +4 -0
  759. package/node_modules/zod/v4/locales/el.cjs +2 -0
  760. package/node_modules/zod/v4/locales/el.js +2 -0
  761. package/node_modules/zod/v4/locales/en.cjs +15 -4
  762. package/node_modules/zod/v4/locales/en.js +15 -4
  763. package/node_modules/zod/v4/locales/eo.cjs +4 -0
  764. package/node_modules/zod/v4/locales/eo.js +4 -0
  765. package/node_modules/zod/v4/locales/es.cjs +3 -0
  766. package/node_modules/zod/v4/locales/es.js +3 -0
  767. package/node_modules/zod/v4/locales/fa.cjs +4 -0
  768. package/node_modules/zod/v4/locales/fa.js +4 -0
  769. package/node_modules/zod/v4/locales/fi.cjs +4 -0
  770. package/node_modules/zod/v4/locales/fi.js +4 -0
  771. package/node_modules/zod/v4/locales/fr-CA.cjs +4 -0
  772. package/node_modules/zod/v4/locales/fr-CA.js +4 -0
  773. package/node_modules/zod/v4/locales/fr.cjs +17 -14
  774. package/node_modules/zod/v4/locales/fr.js +17 -14
  775. package/node_modules/zod/v4/locales/gu.cjs +139 -0
  776. package/node_modules/zod/v4/locales/gu.d.cts +5 -0
  777. package/node_modules/zod/v4/locales/gu.d.ts +4 -0
  778. package/node_modules/zod/v4/locales/gu.js +112 -0
  779. package/node_modules/zod/v4/locales/he.cjs +6 -0
  780. package/node_modules/zod/v4/locales/he.js +6 -0
  781. package/node_modules/zod/v4/locales/hi.cjs +137 -0
  782. package/node_modules/zod/v4/locales/hi.d.cts +5 -0
  783. package/node_modules/zod/v4/locales/hi.d.ts +4 -0
  784. package/node_modules/zod/v4/locales/hi.js +110 -0
  785. package/node_modules/zod/v4/locales/hr.cjs +3 -0
  786. package/node_modules/zod/v4/locales/hr.js +3 -0
  787. package/node_modules/zod/v4/locales/hu.cjs +4 -0
  788. package/node_modules/zod/v4/locales/hu.js +4 -0
  789. package/node_modules/zod/v4/locales/hy.cjs +10 -0
  790. package/node_modules/zod/v4/locales/hy.js +10 -0
  791. package/node_modules/zod/v4/locales/id.cjs +4 -0
  792. package/node_modules/zod/v4/locales/id.js +4 -0
  793. package/node_modules/zod/v4/locales/index.cjs +43 -2
  794. package/node_modules/zod/v4/locales/index.d.cts +11 -0
  795. package/node_modules/zod/v4/locales/index.d.ts +11 -0
  796. package/node_modules/zod/v4/locales/index.js +11 -0
  797. package/node_modules/zod/v4/locales/is.cjs +4 -0
  798. package/node_modules/zod/v4/locales/is.js +4 -0
  799. package/node_modules/zod/v4/locales/it.cjs +4 -0
  800. package/node_modules/zod/v4/locales/it.js +4 -0
  801. package/node_modules/zod/v4/locales/ja.cjs +4 -0
  802. package/node_modules/zod/v4/locales/ja.js +4 -0
  803. package/node_modules/zod/v4/locales/ka.cjs +4 -0
  804. package/node_modules/zod/v4/locales/ka.js +4 -0
  805. package/node_modules/zod/v4/locales/km.cjs +4 -0
  806. package/node_modules/zod/v4/locales/km.js +4 -0
  807. package/node_modules/zod/v4/locales/kn.cjs +142 -0
  808. package/node_modules/zod/v4/locales/kn.d.cts +5 -0
  809. package/node_modules/zod/v4/locales/kn.d.ts +4 -0
  810. package/node_modules/zod/v4/locales/kn.js +115 -0
  811. package/node_modules/zod/v4/locales/ko.cjs +4 -0
  812. package/node_modules/zod/v4/locales/ko.js +4 -0
  813. package/node_modules/zod/v4/locales/lt.cjs +3 -0
  814. package/node_modules/zod/v4/locales/lt.js +3 -0
  815. package/node_modules/zod/v4/locales/mk.cjs +4 -0
  816. package/node_modules/zod/v4/locales/mk.js +4 -0
  817. package/node_modules/zod/v4/locales/ms.cjs +4 -0
  818. package/node_modules/zod/v4/locales/ms.js +4 -0
  819. package/node_modules/zod/v4/locales/ne.cjs +137 -0
  820. package/node_modules/zod/v4/locales/ne.d.cts +5 -0
  821. package/node_modules/zod/v4/locales/ne.d.ts +4 -0
  822. package/node_modules/zod/v4/locales/ne.js +110 -0
  823. package/node_modules/zod/v4/locales/nl.cjs +4 -0
  824. package/node_modules/zod/v4/locales/nl.js +4 -0
  825. package/node_modules/zod/v4/locales/nn.cjs +139 -0
  826. package/node_modules/zod/v4/locales/nn.d.cts +5 -0
  827. package/node_modules/zod/v4/locales/nn.d.ts +4 -0
  828. package/node_modules/zod/v4/locales/nn.js +112 -0
  829. package/node_modules/zod/v4/locales/no.cjs +6 -2
  830. package/node_modules/zod/v4/locales/no.js +6 -2
  831. package/node_modules/zod/v4/locales/ota.cjs +4 -0
  832. package/node_modules/zod/v4/locales/ota.js +4 -0
  833. package/node_modules/zod/v4/locales/pl.cjs +4 -0
  834. package/node_modules/zod/v4/locales/pl.js +4 -0
  835. package/node_modules/zod/v4/locales/ps.cjs +4 -0
  836. package/node_modules/zod/v4/locales/ps.js +4 -0
  837. package/node_modules/zod/v4/locales/pt-BR.cjs +169 -0
  838. package/node_modules/zod/v4/locales/pt-BR.d.cts +5 -0
  839. package/node_modules/zod/v4/locales/pt-BR.d.ts +4 -0
  840. package/node_modules/zod/v4/locales/pt-BR.js +142 -0
  841. package/node_modules/zod/v4/locales/pt.cjs +88 -55
  842. package/node_modules/zod/v4/locales/pt.js +88 -55
  843. package/node_modules/zod/v4/locales/ro.cjs +2 -0
  844. package/node_modules/zod/v4/locales/ro.js +2 -0
  845. package/node_modules/zod/v4/locales/ru.cjs +11 -0
  846. package/node_modules/zod/v4/locales/ru.js +11 -0
  847. package/node_modules/zod/v4/locales/sk.cjs +142 -0
  848. package/node_modules/zod/v4/locales/sk.d.cts +5 -0
  849. package/node_modules/zod/v4/locales/sk.d.ts +4 -0
  850. package/node_modules/zod/v4/locales/sk.js +115 -0
  851. package/node_modules/zod/v4/locales/sl.cjs +4 -0
  852. package/node_modules/zod/v4/locales/sl.js +4 -0
  853. package/node_modules/zod/v4/locales/sv.cjs +6 -2
  854. package/node_modules/zod/v4/locales/sv.js +6 -2
  855. package/node_modules/zod/v4/locales/ta.cjs +4 -0
  856. package/node_modules/zod/v4/locales/ta.js +4 -0
  857. package/node_modules/zod/v4/locales/tg.cjs +143 -0
  858. package/node_modules/zod/v4/locales/tg.d.cts +5 -0
  859. package/node_modules/zod/v4/locales/tg.d.ts +4 -0
  860. package/node_modules/zod/v4/locales/tg.js +116 -0
  861. package/node_modules/zod/v4/locales/th.cjs +4 -0
  862. package/node_modules/zod/v4/locales/th.js +4 -0
  863. package/node_modules/zod/v4/locales/tk.cjs +133 -0
  864. package/node_modules/zod/v4/locales/tk.d.cts +5 -0
  865. package/node_modules/zod/v4/locales/tk.d.ts +4 -0
  866. package/node_modules/zod/v4/locales/tk.js +106 -0
  867. package/node_modules/zod/v4/locales/tr.cjs +4 -0
  868. package/node_modules/zod/v4/locales/tr.js +4 -0
  869. package/node_modules/zod/v4/locales/uk.cjs +4 -0
  870. package/node_modules/zod/v4/locales/uk.js +4 -0
  871. package/node_modules/zod/v4/locales/ur.cjs +4 -0
  872. package/node_modules/zod/v4/locales/ur.js +4 -0
  873. package/node_modules/zod/v4/locales/uz.cjs +2 -0
  874. package/node_modules/zod/v4/locales/uz.js +2 -0
  875. package/node_modules/zod/v4/locales/vi.cjs +4 -0
  876. package/node_modules/zod/v4/locales/vi.js +4 -0
  877. package/node_modules/zod/v4/locales/yo.cjs +4 -0
  878. package/node_modules/zod/v4/locales/yo.js +4 -0
  879. package/node_modules/zod/v4/locales/zh-CN.cjs +4 -0
  880. package/node_modules/zod/v4/locales/zh-CN.js +4 -0
  881. package/node_modules/zod/v4/locales/zh-TW.cjs +4 -0
  882. package/node_modules/zod/v4/locales/zh-TW.js +4 -0
  883. package/node_modules/zod/v4/mini/checks.cjs +19 -0
  884. package/node_modules/zod/v4/mini/coerce.cjs +19 -0
  885. package/node_modules/zod/v4/mini/deep-partial.cjs +58 -0
  886. package/node_modules/zod/v4/mini/deep-partial.d.cts +14 -0
  887. package/node_modules/zod/v4/mini/deep-partial.d.ts +14 -0
  888. package/node_modules/zod/v4/mini/deep-partial.js +13 -0
  889. package/node_modules/zod/v4/mini/external.cjs +33 -1
  890. package/node_modules/zod/v4/mini/external.d.cts +5 -2
  891. package/node_modules/zod/v4/mini/external.d.ts +5 -2
  892. package/node_modules/zod/v4/mini/external.js +3 -1
  893. package/node_modules/zod/v4/mini/in-out.cjs +82 -0
  894. package/node_modules/zod/v4/mini/in-out.d.cts +8 -0
  895. package/node_modules/zod/v4/mini/in-out.d.ts +8 -0
  896. package/node_modules/zod/v4/mini/in-out.js +36 -0
  897. package/node_modules/zod/v4/mini/index.cjs +19 -0
  898. package/node_modules/zod/v4/mini/iso.cjs +19 -0
  899. package/node_modules/zod/v4/mini/parse.cjs +22 -1
  900. package/node_modules/zod/v4/mini/parse.d.cts +1 -1
  901. package/node_modules/zod/v4/mini/parse.d.ts +1 -1
  902. package/node_modules/zod/v4/mini/parse.js +1 -1
  903. package/node_modules/zod/v4/mini/schemas.cjs +115 -49
  904. package/node_modules/zod/v4/mini/schemas.d.cts +52 -14
  905. package/node_modules/zod/v4/mini/schemas.d.ts +52 -14
  906. package/node_modules/zod/v4/mini/schemas.js +90 -47
  907. package/node_modules/zod/v4-mini/index.cjs +19 -0
  908. package/package.json +3 -2
  909. package/skills/context-management/SKILL.md +258 -0
  910. package/skills/figma-implement-design/SKILL.md +258 -0
  911. package/skills/orchestrator/SKILL.md +82 -0
  912. package/skills/s-help/SKILL.md +42 -0
  913. package/skills/s-help/resources/README.md +23 -0
  914. package/skills/s-help/resources/commands.json +78 -0
  915. package/skills/s-help/resources/s-acm.md +26 -0
  916. package/skills/s-help/resources/s-bash-mode.md +23 -0
  917. package/skills/s-help/resources/s-bash-reset.md +23 -0
  918. package/skills/s-help/resources/s-context.md +25 -0
  919. package/skills/s-help/resources/s-filechanges-accept.md +25 -0
  920. package/skills/s-help/resources/s-filechanges-decline.md +30 -0
  921. package/skills/s-help/resources/s-filechanges.md +38 -0
  922. package/skills/s-help/resources/s-footer.md +38 -0
  923. package/skills/s-help/resources/s-promptlib.md +28 -0
  924. package/skills/s-help/resources/s-skills-manager.md +31 -0
  925. package/skills/s-help/resources/s-stash-history.md +26 -0
  926. package/skills/screenshot/SKILL.md +267 -0
  927. package/skills/screenshot/scripts/ensure_macos_permissions.sh +54 -0
  928. package/skills/screenshot/scripts/macos_display_info.swift +22 -0
  929. package/skills/screenshot/scripts/macos_permissions.swift +40 -0
  930. package/skills/screenshot/scripts/macos_window_info.swift +126 -0
  931. package/skills/screenshot/scripts/take_screenshot.ps1 +163 -0
  932. package/skills/screenshot/scripts/take_screenshot.py +585 -0
  933. package/slingshot/index.js +232 -230
  934. package/node_modules/@types/node/ffi.d.ts +0 -486
  935. package/node_modules/@types/node/inspector/promises.d.ts +0 -35
  936. package/node_modules/@types/node/path/posix.d.ts +0 -8
  937. package/node_modules/@types/node/path/win32.d.ts +0 -8
  938. package/node_modules/@types/node/quic.d.ts +0 -2151
  939. package/node_modules/@types/node/stream/iter.d.ts +0 -452
  940. package/node_modules/@types/node/test/reporters.d.ts +0 -59
  941. package/node_modules/@types/node/ts5.6/compatibility/float16array.d.ts +0 -71
  942. package/node_modules/@types/node/ts5.7/compatibility/float16array.d.ts +0 -72
  943. package/node_modules/@types/node/ts5.7/index.d.ts +0 -118
  944. package/node_modules/@types/node/util/types.d.ts +0 -558
  945. package/node_modules/@types/node/vfs.d.ts +0 -210
  946. package/node_modules/@types/node/web-globals/blob.d.ts +0 -23
  947. package/node_modules/@types/node/web-globals/console.d.ts +0 -9
  948. package/node_modules/@types/node/web-globals/crypto.d.ts +0 -39
  949. package/node_modules/@types/node/web-globals/encoding.d.ts +0 -11
  950. package/node_modules/@types/node/web-globals/importmeta.d.ts +0 -13
  951. package/node_modules/@types/node/web-globals/messaging.d.ts +0 -23
  952. package/node_modules/@types/node/web-globals/performance.d.ts +0 -45
  953. package/node_modules/@types/node/web-globals/timers.d.ts +0 -44
  954. package/node_modules/@types/node/web-globals/url.d.ts +0 -24
  955. package/node_modules/@types/node/zlib/iter.d.ts +0 -131
  956. package/node_modules/jose/dist/webapi/lib/base64.js +0 -22
  957. package/node_modules/jose/dist/webapi/lib/crypto_key.js +0 -28
  958. package/node_modules/jose/dist/webapi/lib/helpers.js +0 -42
  959. package/node_modules/jose/dist/webapi/lib/invalid_key_input.js +0 -26
  960. package/node_modules/jose/dist/webapi/lib/is_key_like.js +0 -17
  961. package/node_modules/jose/dist/webapi/lib/jwk_metadata.js +0 -20
  962. package/node_modules/jose/dist/webapi/lib/jwk_to_key.js +0 -17
  963. package/node_modules/jose/dist/webapi/lib/key_options.js +0 -6
  964. package/node_modules/jose/dist/webapi/lib/options.js +0 -74
  965. package/node_modules/jose/dist/webapi/lib/signing.js +0 -26
  966. package/node_modules/jose/dist/webapi/lib/type_checks.js +0 -33
  967. package/node_modules/undici-types/cache-interceptor.d.ts +0 -179
  968. package/node_modules/undici-types/client-stats.d.ts +0 -15
  969. package/node_modules/undici-types/dispatcher1-wrapper.d.ts +0 -7
  970. package/node_modules/undici-types/h2c-client.d.ts +0 -73
  971. package/node_modules/undici-types/mock-call-history.d.ts +0 -111
  972. package/node_modules/undici-types/round-robin-pool.d.ts +0 -39
  973. package/node_modules/undici-types/snapshot-agent.d.ts +0 -113
  974. package/node_modules/undici-types/socks5-proxy-agent.d.ts +0 -25
  975. package/node_modules/undici-types/utility.d.ts +0 -7
  976. package/node_modules/zod/src/v4/core/config.ts +0 -15
@@ -0,0 +1,2302 @@
1
+ import type * as checks from "./checks.js";
2
+ import type * as core from "./core.js";
3
+ import { $ZodAsyncError } from "./core.js";
4
+ import { Doc } from "./doc.js";
5
+ import { isBackEdge, isRecursiveSchema } from "./memoizer.js";
6
+ import * as regexes from "./regexes.js";
7
+ import {
8
+ isValidBase64,
9
+ isValidBase64URL,
10
+ isValidCIDRv6,
11
+ isValidCreditCard,
12
+ isValidIBAN,
13
+ isValidIPv6,
14
+ isValidJWT,
15
+ mergeValues,
16
+ parseURLObject,
17
+ stripTabAndNewline,
18
+ urlHostnameOk,
19
+ urlProtocolOk,
20
+ } from "./schemas.js";
21
+ import type { $ZodProperties, $ZodPropertiesDef, ParseContextInternal, ParsePayload, SomeType } from "./schemas.js";
22
+ import * as util from "./util.js";
23
+
24
+ /** @internal Sentinel the compiled fast path returns when validation fails. */
25
+ export const INVALID: unique symbol = Symbol.for("zod.compile.invalid");
26
+ /** @internal */
27
+ export type INVALID = typeof INVALID;
28
+
29
+ // Set on the parse ctx when a compiled wrapper falls back to the runtime, so nested compiled wrappers skip their fast paths for the rest of that parse.
30
+ const FALLBACK_FLAG: unique symbol = Symbol.for("zod.compile.fallback");
31
+
32
+ interface CompileFnOptions {
33
+ debug?: boolean | undefined;
34
+ /** Emit a validator instead of a parser: skip building the output value where nothing reads it. */
35
+ assertOnly?: boolean | undefined;
36
+ }
37
+
38
+ type CompiledFn<T> = ((input: unknown) => T | INVALID) & {
39
+ code?: string | undefined;
40
+ /** False when this function's INVALID does not strictly mean "the runtime would reject". */
41
+ definite?: boolean | undefined;
42
+ };
43
+
44
+ /** Raised when the schema contains async refinements or transforms. Surfaces only under `compile(schema, { strict: true })`. */
45
+ export class ZodCompileAsyncError extends Error {
46
+ constructor(message = "z.compile does not support async refinements, transforms, or checks") {
47
+ super(message);
48
+ this.name = "ZodCompileAsyncError";
49
+ }
50
+ }
51
+
52
+ /**
53
+ * Raised when the schema contains a feature whose semantics the fast path
54
+ * can't fully model. Both the shim in `zod/compile` and the default
55
+ * `compile()` fall back to the runtime parser for that schema; only
56
+ * `compile(schema, { strict: true })` lets it surface.
57
+ */
58
+ export class ZodCompileUnsupportedError extends Error {
59
+ /** Whether a container may absorb this refusal by running the child through the runtime (see `compileChild`). False when running only that node on the runtime is not equivalent to running the whole parse there — a runtime island gets no parse context, so a node that *consumes* issues rather than propagating them would finalize them against the wrong error map and still succeed. */
60
+ readonly islandable: boolean;
61
+
62
+ constructor(feature: string, islandable = true) {
63
+ super(`z.compile does not support ${feature}; this schema must use the runtime parser`);
64
+ this.name = "ZodCompileUnsupportedError";
65
+ this.islandable = islandable;
66
+ }
67
+ }
68
+
69
+ interface CompileContext {
70
+ constants: Map<string, unknown>;
71
+ constantCounter: number;
72
+ varCounter: number;
73
+ /** Cleared when a construct can return INVALID for something the interpreter throws on, so `validate` keeps its fallback. */
74
+ definite: boolean;
75
+ }
76
+
77
+ // Union of all check types we support in AOT compilation
78
+ type SupportedCheck =
79
+ | checks.$ZodCheckLessThan
80
+ | checks.$ZodCheckGreaterThan
81
+ | checks.$ZodCheckMultipleOf
82
+ | checks.$ZodCheckNumberFormat
83
+ | checks.$ZodCheckBigIntFormat
84
+ | checks.$ZodCheckMaxSize
85
+ | checks.$ZodCheckMinSize
86
+ | checks.$ZodCheckSizeEquals
87
+ | checks.$ZodCheckMaxLength
88
+ | checks.$ZodCheckMinLength
89
+ | checks.$ZodCheckLengthEquals
90
+ | checks.$ZodCheckStringFormat
91
+ | checks.$ZodCheckProperty
92
+ | $ZodProperties
93
+ | checks.$ZodCheckMimeType
94
+ | checks.$ZodCheckOverwrite
95
+ | { _zod: { def: { check: "custom"; fn?: (value: unknown) => boolean }; check?: (payload: unknown) => unknown } };
96
+
97
+ /**
98
+ * Build the validator `validate` calls: the same codegen as the parser with the output construction
99
+ * dropped. A schema the flag cannot express reuses the parser, which still answers correctly — it
100
+ * just builds a value nothing reads.
101
+ */
102
+ function compileValidator(schema: SomeType, parser: CompiledFn<unknown>): CompiledFn<unknown> {
103
+ try {
104
+ return compileFn(schema, { assertOnly: true }) as CompiledFn<unknown>;
105
+ } catch {
106
+ return parser;
107
+ }
108
+ }
109
+
110
+ export interface CompileOptions {
111
+ /** Throw the refusal instead of returning the schema uncompiled. */
112
+ strict?: boolean | undefined;
113
+ }
114
+
115
+ /**
116
+ * AOT-compile a Zod schema. Returns a clone whose `_zod.run` calls a generated
117
+ * fast path first and falls back to the original runtime parser on failure.
118
+ *
119
+ * - Forward direction only. Backward (encode), async, and `skipChecks` paths
120
+ * bypass the fast path and use the runtime directly.
121
+ * - Never throws. A schema the fast path can't model is returned unchanged and
122
+ * keeps using the runtime parser. Pass `{ strict: true }` to get the refusal
123
+ * as a thrown `ZodCompileUnsupportedError` / `ZodCompileAsyncError` instead.
124
+ * - The original schema is unchanged. The clone shares children by reference.
125
+ */
126
+ export function compile<T extends SomeType>(schema: T, options?: CompileOptions): T {
127
+ try {
128
+ const parser = compileFn(schema);
129
+ const clone = withParser(schema, parser);
130
+ // withParser leaves the parser as its own validator; the generated assert-only variant is better when we have one
131
+ clone._zod.bag.validator = compileValidator(schema, parser as CompiledFn<unknown>);
132
+ return clone;
133
+ } catch (err) {
134
+ if (options?.strict) throw err;
135
+ // a schema we can't compile still has to work, so hand it back untouched on the runtime parser — the same silent fallback global mode already does
136
+ return schema;
137
+ }
138
+ }
139
+
140
+ /**
141
+ * Install an already-generated parser as a schema's fast path. Returns a clone; the original is
142
+ * unchanged.
143
+ *
144
+ * The parser takes the input and returns the parsed value, or `INVALID` to hand the parse to the
145
+ * runtime. It must be synchronous and forward-direction, and it must build fresh output rather than
146
+ * return its input — Zod cannot check either, and a wrong *success* is returned to the caller as-is.
147
+ *
148
+ * `compile()` is the ordinary entry point. This is for a build-time or native compiler that produces
149
+ * a parser where `new Function` is unavailable.
150
+ */
151
+ export function withParser<T extends SomeType>(schema: T, parser: (input: unknown) => core.output<T> | INVALID): T {
152
+ // generated code never receives the parse context, so only the runtime can close a reference cycle; compileFn refuses these too
153
+ if (isRecursiveSchema(schema as any)) {
154
+ throw new ZodCompileUnsupportedError("a schema whose subtree contains a reference cycle");
155
+ }
156
+ const clone = util.clone(schema as any) as T;
157
+
158
+ // Capture the source-of-truth runtime eagerly. If schema._zod.run is itself a shim installed by global-mode (`__originalRun` set), unwrap past it. Otherwise capturing the live property lazily would let a later self- replacement of schema._zod.run feed our wrapper back into itself.
159
+ const liveRun = schema._zod.run as ((p: ParsePayload, c: ParseContextInternal) => any) & {
160
+ __originalRun?: (p: ParsePayload, c: ParseContextInternal) => any;
161
+ };
162
+ const originalRun = liveRun.__originalRun ?? liveRun;
163
+
164
+ // Delegate to the *original* schema's run on bypass/fallback, not the clone's. The original closed over its own `inst` at construction time, and issue payloads use that reference to derive things like the class name for `z.instanceof(Test)`; calling the clone's freshly-initialized run would push issues with `inst === clone` and diverge from the original schema's error messages.
165
+ const wrapped = (payload: ParsePayload, ctx: ParseContextInternal): any => {
166
+ if (
167
+ ctx?.async ||
168
+ ctx?.direction === "backward" ||
169
+ ctx?.skipChecks ||
170
+ (ctx as Record<symbol, unknown> | undefined)?.[FALLBACK_FLAG]
171
+ ) {
172
+ return originalRun(payload, ctx);
173
+ }
174
+
175
+ // A memoized back-edge: only the runtime can close a reference cycle, and a transform on one must raise $ZodCyclicError from its own parse.
176
+ if (ctx && isBackEdge(ctx, payload.value)) {
177
+ return originalRun(payload, ctx);
178
+ }
179
+
180
+ const out = parser(payload.value);
181
+ if (out !== INVALID) {
182
+ payload.value = out;
183
+ return payload;
184
+ }
185
+ // Mark this parse as runtime-driven: under global mode every nested schema carries its own compiled wrapper, and without the flag the parent's runtime fallback re-enters each child's fast path, running user callbacks a third time on invalid input.
186
+ if (ctx) (ctx as Record<symbol, unknown>)[FALLBACK_FLAG] = true;
187
+ return originalRun(payload, ctx);
188
+ };
189
+ // Let later compiles of (or through) this run unwrap to the true runtime — both the global shim and repeated z.compile calls rely on this. The bag also carries the parser and the validator, so the standalone validate can skip the payload and wrapper on the happy path.
190
+ (wrapped as { __originalRun?: typeof originalRun }).__originalRun = originalRun;
191
+ clone._zod.bag.fallbackRun = originalRun;
192
+ // a supplied parser answers `validate` too: one implementation means parse and validate cannot disagree, and its undefined `definite` keeps the runtime re-parse on every rejection
193
+ clone._zod.bag.validator = parser as CompiledFn<unknown>;
194
+ clone._zod.run = wrapped;
195
+
196
+ // The fast parse/safeParse closures fall back through the source schema's methods. If the source is shim- or wrapper-managed, those methods route into a compiled run and would execute user callbacks a third time on invalid input — the plain method → wrapper path is exactly 2x, so skip.
197
+ if (!liveRun.__originalRun) installCompiledUserMethods(clone, schema, parser as CompiledFn<core.output<T>>);
198
+
199
+ return clone;
200
+ }
201
+
202
+ function installCompiledUserMethods<T extends SomeType>(
203
+ target: T,
204
+ source: T,
205
+ parser: CompiledFn<core.output<T>>
206
+ ): void {
207
+ const targetAny = target as any;
208
+ const sourceAny = source as any;
209
+
210
+ if (typeof sourceAny.safeParse === "function") {
211
+ const originalSafeParse = sourceAny.safeParse;
212
+ targetAny.safeParse = (data: unknown, params?: unknown) => {
213
+ const out = parser(data);
214
+ if (out !== INVALID) {
215
+ return { success: true, data: out };
216
+ }
217
+ return originalSafeParse(data, params);
218
+ };
219
+ }
220
+
221
+ if (typeof sourceAny.parse === "function") {
222
+ const originalParse = sourceAny.parse;
223
+ targetAny.parse = (data: unknown, params?: unknown) => {
224
+ const out = parser(data);
225
+ if (out !== INVALID) {
226
+ return out;
227
+ }
228
+ return originalParse(data, params);
229
+ };
230
+ }
231
+ }
232
+
233
+ /**
234
+ * @internal Generate the standalone compiled function: a parser by default, a validator under
235
+ * `assertOnly`. Returns the parsed value, `true` where nothing reads the output, or `INVALID`. Consumers use `compile()`.
236
+ */
237
+ export function compileFn<T extends SomeType>(schema: T, options?: CompileFnOptions): CompiledFn<core.output<T>> {
238
+ // Cycle-breaking is keyed on the parse context, which generated code never receives. `shape` can be a getter that throws (z.pick() with an unrecognized mask key), so treat "can't tell" as recursive.
239
+ let recursive = true;
240
+ try {
241
+ recursive = isRecursiveSchema(schema as any);
242
+ } catch {}
243
+ if (recursive) {
244
+ throw new ZodCompileUnsupportedError("a schema whose subtree contains a reference cycle");
245
+ }
246
+
247
+ const ctx: CompileContext = {
248
+ constants: new Map(),
249
+ constantCounter: 0,
250
+ varCounter: 0,
251
+ definite: true,
252
+ };
253
+
254
+ const doc = new Doc(["input"]);
255
+ const outputAccessor = generateCheck(doc, ctx, schema, "input", !options?.assertOnly);
256
+ // In assert mode a root that built nothing has already returned INVALID on every failure, so reaching the end means valid.
257
+ doc.write(outputAccessor === null ? `return true;` : `return ${outputAccessor};`);
258
+
259
+ // Build the function with hoisted constants Always include INVALID as the first constant
260
+ const constantNames = ["INVALID", ...ctx.constants.keys()];
261
+ const constantValues = [INVALID, ...ctx.constants.values()];
262
+
263
+ const code = doc.content.join("\n");
264
+ const fullCode = options?.debug
265
+ ? constantNames.length > 0
266
+ ? `// Constants: ${constantNames.join(", ")}\n${code}`
267
+ : code
268
+ : "";
269
+
270
+ const F = Function;
271
+ const factoryCode = `return (input) => {\n${code}\n}`;
272
+ let fn: CompiledFn<core.output<T>>;
273
+ try {
274
+ const factory = new F(...constantNames, factoryCode);
275
+ fn = factory(...constantValues) as CompiledFn<core.output<T>>;
276
+ } catch (err) {
277
+ // Malformed generated code (or a CSP environment rejecting `new Function`) surfaces as a typed error so the global shim falls back to the runtime instead of crashing with a raw SyntaxError/EvalError.
278
+ throw new ZodCompileUnsupportedError(`this schema (generated code failed to evaluate: ${(err as Error).message})`);
279
+ }
280
+ if (options?.debug) {
281
+ fn.code = fullCode;
282
+ }
283
+ fn.definite = ctx.definite;
284
+ return fn;
285
+ }
286
+
287
+ function addConstant(ctx: CompileContext, value: unknown): string {
288
+ // Check if we already have this constant
289
+ for (const [name, v] of ctx.constants) {
290
+ if (v === value) return name;
291
+ }
292
+ const name = `c${ctx.constantCounter++}`;
293
+ ctx.constants.set(name, value);
294
+ return name;
295
+ }
296
+
297
+ /** Hoists a user-supplied callback. Anything the schema's author wrote can throw, and generated code can reject an earlier sibling before ever reaching it, so this clears `definite` — a rejection is then no longer proof that the interpreter would have rejected rather than thrown. */
298
+ function addUserConstant(ctx: CompileContext, fn: unknown): string {
299
+ ctx.definite = false;
300
+ return addConstant(ctx, fn);
301
+ }
302
+
303
+ function newVar(ctx: CompileContext): string {
304
+ return `v${ctx.varCounter++}`;
305
+ }
306
+
307
+ // Runs a child schema as a black box: its value, or INVALID for a failure or an async run.
308
+ function runtimeRun(schema: SomeType, value: unknown): unknown {
309
+ const result = (schema._zod.run as (p: ParsePayload, c: ParseContextInternal) => any)(
310
+ { value, issues: [] },
311
+ {} as ParseContextInternal
312
+ );
313
+ if (result && typeof (result as Promise<unknown>).then === "function") return INVALID;
314
+ const r = result as { value: unknown; issues: unknown[] };
315
+ return r.issues.length === 0 ? r.value : INVALID;
316
+ }
317
+
318
+ // Try to compile `schema` against `accessor`. If `generateCheck` throws
319
+ // `ZodCompileUnsupportedError`, the doc + ctx state is rolled back and a
320
+ // runtime island is emitted instead — the child schema is invoked through
321
+ // `runtimeRun` at parse time and treated as a black box. Anything else thrown
322
+ // propagates (e.g. `ZodCompileAsyncError`).
323
+ function compileChild(doc: Doc, ctx: CompileContext, schema: SomeType, accessor: string): string;
324
+ function compileChild(
325
+ doc: Doc,
326
+ ctx: CompileContext,
327
+ schema: SomeType,
328
+ accessor: string,
329
+ needsValue: boolean
330
+ ): string | null;
331
+ // `null` means the node built no value because nothing reads it. The overloads keep that case out of the 20-odd callers that always want one, so only a caller passing needsValue has to handle it.
332
+ function compileChild(
333
+ doc: Doc,
334
+ ctx: CompileContext,
335
+ schema: SomeType,
336
+ accessor: string,
337
+ needsValue = true
338
+ ): string | null {
339
+ const contentLen = doc.content.length;
340
+ const constantCount = ctx.constants.size;
341
+ const constantCounter = ctx.constantCounter;
342
+ const varCounter = ctx.varCounter;
343
+ try {
344
+ return generateCheck(doc, ctx, schema, accessor, needsValue);
345
+ } catch (err) {
346
+ if (!(err instanceof ZodCompileUnsupportedError) || !err.islandable) throw err;
347
+ doc.content.length = contentLen;
348
+ if (ctx.constants.size > constantCount) {
349
+ const trailing = Array.from(ctx.constants.keys()).slice(constantCount);
350
+ for (const k of trailing) ctx.constants.delete(k);
351
+ }
352
+ ctx.constantCounter = constantCounter;
353
+ ctx.varCounter = varCounter;
354
+ return emitRuntimeIsland(doc, ctx, schema, accessor);
355
+ }
356
+ }
357
+
358
+ function emitRuntimeIsland(doc: Doc, ctx: CompileContext, schema: SomeType, accessor: string): string {
359
+ // an islanded child answers INVALID for an async run too, which the interpreter throws for
360
+ ctx.definite = false;
361
+ const schemaConst = addConstant(ctx, schema);
362
+ const runConst = addConstant(ctx, runtimeRun);
363
+ const outVar = newVar(ctx);
364
+ doc.write(`const ${outVar} = ${runConst}(${schemaConst}, ${accessor});`);
365
+ doc.write(`if (${outVar} === INVALID) return INVALID;`);
366
+ return outVar;
367
+ }
368
+
369
+ // Check classes whose `when` is auto-defaulted at init (checks.ts `when ??=`).
370
+ const WHEN_DEFAULTED_CHECKS = new Set([
371
+ "max_size",
372
+ "min_size",
373
+ "size_equals",
374
+ "max_length",
375
+ "min_length",
376
+ "length_equals",
377
+ ]);
378
+
379
+ function generateChecks(doc: Doc, ctx: CompileContext, schema: SomeType, accessor: string): string {
380
+ const schemaChecks = schema._zod.def.checks as SupportedCheck[] | undefined;
381
+ if (!schemaChecks || schemaChecks.length === 0) return accessor;
382
+
383
+ // Track current accessor - may change if overwrite checks are encountered
384
+ let currentAccessor = accessor;
385
+
386
+ for (const check of schemaChecks) {
387
+ const def = check._zod.def;
388
+ // A custom `when` skips a check the fast path always runs; the one auto-defaulted on size/length classes matches its bail-on-first-failure.
389
+ if ((def as { when?: unknown }).when && !WHEN_DEFAULTED_CHECKS.has(def.check)) {
390
+ throw new ZodCompileUnsupportedError(`check with a custom "when" condition`);
391
+ }
392
+ switch (def.check) {
393
+ case "greater_than":
394
+ generateGreaterThanCheck(doc, ctx, def, currentAccessor);
395
+ break;
396
+ case "less_than":
397
+ generateLessThanCheck(doc, ctx, def, currentAccessor);
398
+ break;
399
+ case "multiple_of":
400
+ generateMultipleOfCheck(doc, ctx, def, currentAccessor);
401
+ break;
402
+ case "number_format":
403
+ generateNumberFormatCheck(doc, def, currentAccessor);
404
+ break;
405
+ case "min_length": {
406
+ const min = numericOperand(def.minimum, "min_length");
407
+ const len = codePointLengthVar(
408
+ doc,
409
+ ctx,
410
+ currentAccessor,
411
+ `${currentAccessor}.length >= ${min} && ${currentAccessor}.length < ${def.minimum * 2}`
412
+ );
413
+ doc.write(`if (${len} < ${min}) return INVALID;`);
414
+ break;
415
+ }
416
+ case "max_length": {
417
+ const max = numericOperand(def.maximum, "max_length");
418
+ const len = codePointLengthVar(doc, ctx, currentAccessor, `${currentAccessor}.length > ${max}`);
419
+ doc.write(`if (${len} > ${max}) return INVALID;`);
420
+ break;
421
+ }
422
+ case "length_equals": {
423
+ const exact = numericOperand(def.length, "length_equals");
424
+ const len = codePointLengthVar(
425
+ doc,
426
+ ctx,
427
+ currentAccessor,
428
+ `${currentAccessor}.length >= ${exact} && ${currentAccessor}.length <= ${def.length * 2}`
429
+ );
430
+ doc.write(`if (${len} !== ${exact}) return INVALID;`);
431
+ break;
432
+ }
433
+ case "min_size":
434
+ doc.write(`if (${currentAccessor}.size < ${numericOperand(def.minimum, "min_size")}) return INVALID;`);
435
+ break;
436
+ case "max_size":
437
+ doc.write(`if (${currentAccessor}.size > ${numericOperand(def.maximum, "max_size")}) return INVALID;`);
438
+ break;
439
+ case "size_equals":
440
+ doc.write(`if (${currentAccessor}.size !== ${numericOperand(def.size, "size_equals")}) return INVALID;`);
441
+ break;
442
+ case "string_format":
443
+ currentAccessor = generateStringFormatCheck(doc, ctx, def, currentAccessor);
444
+ break;
445
+ case "custom":
446
+ currentAccessor = generateCustomRefineCheck(doc, ctx, check as CustomCheck, currentAccessor);
447
+ break;
448
+ case "bigint_format":
449
+ generateBigIntFormatCheck(doc, def, currentAccessor);
450
+ break;
451
+ case "mime_type":
452
+ generateMimeTypeCheck(doc, ctx, def, currentAccessor);
453
+ break;
454
+ case "property":
455
+ generatePropertyCheck(doc, ctx, def, currentAccessor);
456
+ break;
457
+ case "properties":
458
+ generatePropertiesChecks(doc, ctx, def, currentAccessor, false);
459
+ break;
460
+ case "overwrite": {
461
+ // Overwrite transforms the value - create new variable for transformed result
462
+ const newAccessor = newVar(ctx);
463
+ generateOverwriteCheck(doc, ctx, check as checks.$ZodCheckOverwrite, currentAccessor, newAccessor);
464
+ currentAccessor = newAccessor;
465
+ break;
466
+ }
467
+ default: {
468
+ void (def satisfies never);
469
+ throw new ZodCompileUnsupportedError(`check type ${(def as { check: string }).check}`);
470
+ }
471
+ }
472
+ }
473
+
474
+ return currentAccessor;
475
+ }
476
+
477
+ // Emit the length operand for a length check, mirroring `$ZodCheckMinLength` and friends: strings measure in code points, everything else in `.length`. `inDoubt` is the caller's cheap UTF-16 bound test — outside it the unit count already settles the comparison, so the scan is skipped.
478
+ function codePointLengthVar(doc: Doc, ctx: CompileContext, accessor: string, inDoubt: string): string {
479
+ const cpLen = addConstant(ctx, util.codePointLength);
480
+ const v = newVar(ctx);
481
+ doc.write(`const ${v} = typeof ${accessor} === "string" && ${inDoubt} ? ${cpLen}(${accessor}) : ${accessor}.length;`);
482
+ return v;
483
+ }
484
+
485
+ // Emit a source operand for a gt/lt bound. Numbers inline; Dates hoist as a constant (relational operators compare via valueOf). NaN and Invalid Date bounds can't compile to a comparison that matches runtime semantics.
486
+ /**
487
+ * A count bound reaches generated source verbatim, so a non-number would be
488
+ * emitted as code rather than as a value — `min('0) {} evil(); if (0')` writes an
489
+ * arbitrary statement into the function body. TypeScript types these as `number`
490
+ * and fromJSONSchema guards them, so this is a backstop rather than a live hole,
491
+ * but generated source is the one place a wrong type stops being a type error.
492
+ */
493
+ function numericOperand(value: unknown, label: string): string {
494
+ if (typeof value !== "number" || !Number.isFinite(value)) {
495
+ throw new ZodCompileUnsupportedError(`${label} bound of type ${typeof value}`);
496
+ }
497
+ return `${value}`;
498
+ }
499
+
500
+ function comparisonOperand(ctx: CompileContext, value: number | bigint | Date): string {
501
+ if (typeof value === "bigint") return `${value}n`;
502
+ if (typeof value === "number") {
503
+ if (Number.isNaN(value)) throw new ZodCompileUnsupportedError("comparison check with NaN bound");
504
+ return `${value}`;
505
+ }
506
+ if (value instanceof Date) {
507
+ if (Number.isNaN(value.getTime())) {
508
+ throw new ZodCompileUnsupportedError("comparison check with Invalid Date bound");
509
+ }
510
+ return addConstant(ctx, value);
511
+ }
512
+ throw new ZodCompileUnsupportedError(`comparison check bound of type ${typeof value}`);
513
+ }
514
+
515
+ function generateGreaterThanCheck(
516
+ doc: Doc,
517
+ ctx: CompileContext,
518
+ def: checks.$ZodCheckGreaterThanDef,
519
+ accessor: string
520
+ ): void {
521
+ const op = def.inclusive ? "<" : "<=";
522
+ doc.write(`if (${accessor} ${op} ${comparisonOperand(ctx, def.value)}) return INVALID;`);
523
+ }
524
+
525
+ function generateLessThanCheck(
526
+ doc: Doc,
527
+ ctx: CompileContext,
528
+ def: checks.$ZodCheckLessThanDef,
529
+ accessor: string
530
+ ): void {
531
+ const op = def.inclusive ? ">" : ">=";
532
+ doc.write(`if (${accessor} ${op} ${comparisonOperand(ctx, def.value)}) return INVALID;`);
533
+ }
534
+
535
+ function generateMultipleOfCheck(
536
+ doc: Doc,
537
+ ctx: CompileContext,
538
+ def: checks.$ZodCheckMultipleOfDef,
539
+ accessor: string
540
+ ): void {
541
+ if (typeof def.value === "bigint") {
542
+ // a zero divisor has no compiled form: `x % 0n` throws
543
+ if (def.value === BigInt(0)) throw new ZodCompileUnsupportedError("multiple_of check with a zero divisor");
544
+ doc.write(`if (${accessor} % ${def.value}n !== 0n) return INVALID;`);
545
+ } else {
546
+ // Float `%` has well-known precision issues for sub-integer steps
547
+ // (`1.5 % 0.1`, `2.5e-7 % 1e-7`). Defer to util.floatSafeRemainder so the
548
+ // exact tolerance logic stays in one place — single function call is fine
549
+ // since `multipleOf` runs at most once per number.
550
+ const remainder = addConstant(ctx, util.floatSafeRemainder);
551
+ doc.write(`if (${remainder}(${accessor}, ${numericOperand(def.value, "multiple_of")}) !== 0) return INVALID;`);
552
+ }
553
+ }
554
+
555
+ function generateNumberFormatCheck(doc: Doc, def: checks.$ZodCheckNumberFormatDef, accessor: string): void {
556
+ const format = def.format;
557
+ switch (format) {
558
+ case "safeint":
559
+ doc.write(`if (!Number.isSafeInteger(${accessor})) return INVALID;`);
560
+ break;
561
+ case "int32":
562
+ doc.write(
563
+ `if (!Number.isInteger(${accessor}) || ${accessor} < -2147483648 || ${accessor} > 2147483647) return INVALID;`
564
+ );
565
+ break;
566
+ case "uint32":
567
+ doc.write(`if (!Number.isInteger(${accessor}) || ${accessor} < 0 || ${accessor} > 4294967295) return INVALID;`);
568
+ break;
569
+ case "float32":
570
+ // Float32 range per util.NUMBER_FORMAT_RANGES
571
+ doc.write(
572
+ `if (!Number.isFinite(${accessor}) || ${accessor} < -3.4028234663852886e38 || ${accessor} > 3.4028234663852886e38) return INVALID;`
573
+ );
574
+ break;
575
+ case "float64":
576
+ doc.write(`if (!Number.isFinite(${accessor})) return INVALID;`);
577
+ break;
578
+ default: {
579
+ void (format satisfies never);
580
+ throw new ZodCompileUnsupportedError(`number format ${format}`);
581
+ }
582
+ }
583
+ }
584
+
585
+ function generateBigIntFormatCheck(doc: Doc, def: checks.$ZodCheckBigIntFormatDef, accessor: string): void {
586
+ const format = def.format;
587
+ if (!format) return; // undefined format means no range check
588
+ switch (format) {
589
+ case "int64":
590
+ doc.write(`if (${accessor} < -9223372036854775808n || ${accessor} > 9223372036854775807n) return INVALID;`);
591
+ break;
592
+ case "uint64":
593
+ doc.write(`if (${accessor} < 0n || ${accessor} > 18446744073709551615n) return INVALID;`);
594
+ break;
595
+ default: {
596
+ void (format satisfies never);
597
+ throw new ZodCompileUnsupportedError(`bigint format ${format}`);
598
+ }
599
+ }
600
+ }
601
+
602
+ function generateMimeTypeCheck(
603
+ doc: Doc,
604
+ ctx: CompileContext,
605
+ def: checks.$ZodCheckMimeTypeDef,
606
+ accessor: string
607
+ ): void {
608
+ const mimeTypes = def.mime;
609
+ if (mimeTypes && mimeTypes.length > 0) {
610
+ const mimeSet = addConstant(ctx, new Set(mimeTypes));
611
+ doc.write(`if (!${mimeSet}.has(${accessor}.type)) return INVALID;`);
612
+ }
613
+ }
614
+
615
+ // asserts each named property in place; children compile assert-only because z.properties never rebuilds its input
616
+ function generatePropertiesChecks(
617
+ doc: Doc,
618
+ ctx: CompileContext,
619
+ def: $ZodPropertiesDef,
620
+ accessor: string,
621
+ schemaRole: boolean
622
+ ): void {
623
+ // a custom `when` gates the assertion at runtime; inside a union a wrongly-run branch is absorbed as a branch failure rather than falling back, so refuse at codegen the way the check role does
624
+ if (def.when) {
625
+ throw new ZodCompileUnsupportedError(`check with a custom "when" condition`);
626
+ }
627
+ // matches the runtime gate for whichever role this is: a schema rejects a primitive outright, a check only a nullish value
628
+ doc.write(
629
+ schemaRole
630
+ ? `if (${accessor} === null || (typeof ${accessor} !== "object" && typeof ${accessor} !== "function")) return INVALID;`
631
+ : `if (${accessor} == null) return INVALID;`
632
+ );
633
+ const shape = def.shape as Record<string | symbol, SomeType>;
634
+ for (const key of Reflect.ownKeys(shape)) {
635
+ // a symbol has no source literal, so it is hoisted as a constant
636
+ const keyExpr = typeof key === "symbol" ? addConstant(ctx, key) : util.esc(key);
637
+ // cache the property read so a getter runs exactly once, matching the runtime
638
+ const inputVar = newVar(ctx);
639
+ doc.write(`const ${inputVar} = ${accessor}[${keyExpr}];`);
640
+ compileChild(doc, ctx, shape[key]!, inputVar, false);
641
+ }
642
+ }
643
+
644
+ function generatePropertyCheck(
645
+ doc: Doc,
646
+ ctx: CompileContext,
647
+ def: checks.$ZodCheckPropertyDef,
648
+ accessor: string
649
+ ): void {
650
+ const propAccessor = `${accessor}[${JSON.stringify(def.property)}]`;
651
+ generateCheck(doc, ctx, def.schema as SomeType, propAccessor);
652
+ }
653
+
654
+ function generateOverwriteCheck(
655
+ doc: Doc,
656
+ ctx: CompileContext,
657
+ check: checks.$ZodCheckOverwrite,
658
+ currentAccessor: string,
659
+ newAccessor: string
660
+ ): void {
661
+ const tx = check._zod.def.tx;
662
+ if (!tx) {
663
+ throw new ZodCompileUnsupportedError("overwrite check without a transform function");
664
+ }
665
+
666
+ // Check for async transform
667
+ if (isAsyncFunction(tx)) {
668
+ throw new ZodCompileAsyncError("z.compile: async overwrite transforms are not supported");
669
+ }
670
+
671
+ // Hoist the transform function as a constant and apply it
672
+ const txConst = addConstant(ctx, tx);
673
+ doc.write(`const ${newAccessor} = ${txConst}(${currentAccessor});`);
674
+ }
675
+
676
+ type CustomCheck = {
677
+ _zod: { def: { check: "custom"; fn?: (value: unknown) => boolean }; check?: (payload: unknown) => unknown };
678
+ };
679
+ /** A predicate that hands back a thenable is an async check reached synchronously, and the interpreter throws `$ZodAsyncError` for it. Returning INVALID instead would be a bail-out, and a union reads a bail-out as a rejected branch and answers with a later one — so the throw has to survive into generated code. */
680
+ function throwAsync(): never {
681
+ throw new $ZodAsyncError();
682
+ }
683
+
684
+ /** Shared `addIssue` for the spoofed payloads a refine, check or transform receives. Allocating one per call — a fresh closure plus a `this`-bound method on a fresh literal — pinned every payload-allocating schema at ~2.7M ops/sec against 135M for a plain object literal. It captures nothing per call; it only reaches `this.issues`. */
685
+ function pushIssue(this: { issues: unknown[] }, issue: unknown): void {
686
+ this.issues.push(issue);
687
+ }
688
+
689
+ function generateCustomRefineCheck(doc: Doc, ctx: CompileContext, check: CustomCheck, accessor: string): string {
690
+ const def = check._zod.def;
691
+
692
+ if (def.fn) {
693
+ // Simple predicate function (from .refine())
694
+ if (isAsyncFunction(def.fn)) {
695
+ throw new ZodCompileAsyncError("z.compile: async .refine() predicates are not supported");
696
+ }
697
+ const fnConst = addUserConstant(ctx, def.fn);
698
+ const throwAsyncConst = addConstant(ctx, throwAsync);
699
+ const resVar = newVar(ctx);
700
+ doc.write(`const ${resVar} = ${fnConst}(${accessor});`);
701
+ // A thenable is truthy, so it would otherwise read as a pass. It is not a rejection either: the interpreter throws, and INVALID inside a union would just hand the parse to the next branch.
702
+ doc.write(`if (${resVar} instanceof Promise) ${throwAsyncConst}();`);
703
+ doc.write(`if (!${resVar}) return INVALID;`);
704
+ // A `.refine()` predicate only answers yes or no; it cannot rewrite the value.
705
+ return accessor;
706
+ }
707
+ if (check._zod.check) {
708
+ if (isAsyncFunction(check._zod.check)) {
709
+ throw new ZodCompileAsyncError("z.compile: async .superRefine() / check functions are not supported");
710
+ }
711
+ // SuperRefine or other check function - need to spoof context Create a helper that runs the check and returns true if no issues
712
+ const checkFn = check._zod.check;
713
+ // `$RefinementCtx` extends the parse payload, so a check may rewrite
714
+ // `ctx.value` as well as push issues — `.superRefine((v, ctx) => { ctx.value =
715
+ // v.trim() })` is a value transform. Returning only a boolean discarded that
716
+ // write and emitted the untrimmed input. Hand the value back and thread it on.
717
+ const helperFn = (value: unknown): unknown => {
718
+ const fakePayload = { value, issues: [] as unknown[], addIssue: pushIssue };
719
+ const result = checkFn(fakePayload);
720
+ // Throw rather than return INVALID: the interpreter throws here, and a union would read INVALID as a rejected branch.
721
+ if (result instanceof Promise) throwAsync();
722
+ return fakePayload.issues.length === 0 ? fakePayload.value : INVALID;
723
+ };
724
+ const helperConst = addUserConstant(ctx, helperFn);
725
+ const outVar = newVar(ctx);
726
+ doc.write(`const ${outVar} = ${helperConst}(${accessor});`);
727
+ doc.write(`if (${outVar} === INVALID) return INVALID;`);
728
+ return outVar;
729
+ }
730
+ throw new ZodCompileUnsupportedError("custom check without a predicate or check function");
731
+ }
732
+
733
+ type StringFormatDef =
734
+ | checks.$ZodCheckStringFormatDef
735
+ | checks.$ZodCheckRegexDef
736
+ | checks.$ZodCheckLowerCaseDef
737
+ | checks.$ZodCheckUpperCaseDef
738
+ | checks.$ZodCheckIncludesDef
739
+ | checks.$ZodCheckStartsWithDef
740
+ | checks.$ZodCheckEndsWithDef;
741
+
742
+ type SupportedStringFormat = "regex" | "lowercase" | "uppercase" | "includes" | "starts_with" | "ends_with";
743
+
744
+ /**
745
+ * Built-in formats that validate with nothing but `def.pattern`, so compiling
746
+ * the regex reproduces the runtime exactly. Deliberately an allowlist: a format
747
+ * missing from it loses its fast path, while a format wrongly added to it
748
+ * silently accepts input the runtime rejects. Formats that layer extra
749
+ * validation over a shape-only pattern (`credit_card`, `base64`, `ipv6`, …) are
750
+ * handled above by hoisting the runtime validator itself.
751
+ */
752
+ const PATTERN_IS_COMPLETE: Set<string> = new Set([
753
+ "cidrv4",
754
+ "cuid",
755
+ "cuid2",
756
+ "date",
757
+ "datetime",
758
+ "duration",
759
+ "e164",
760
+ "email",
761
+ "emoji",
762
+ "ends_with",
763
+ "guid",
764
+ "includes",
765
+ "ipv4",
766
+ "ksuid",
767
+ "lowercase",
768
+ "mac",
769
+ "nanoid",
770
+ "regex",
771
+ "starts_with",
772
+ "time",
773
+ "ulid",
774
+ "uppercase",
775
+ "uuid",
776
+ "xid",
777
+ ]);
778
+
779
+ // Returns the accessor holding the (possibly normalized) value after the check — url/normalize formats produce a new value like overwrite does. Never assigns to the incoming accessor: it may be a `const` or a property expression on user input.
780
+ function generateStringFormatCheck(doc: Doc, ctx: CompileContext, def: StringFormatDef, accessor: string): string {
781
+ // Some string formats do runtime validation beyond their advertised pattern. For cheap pure utility checks, hoist the runtime function and call it so the fast path stays correct without cloning the utility logic into codegen.
782
+ const fmt = def.format;
783
+ if (fmt === "base64") {
784
+ const validator = addConstant(ctx, isValidBase64);
785
+ doc.write(`if (!${validator}(${accessor})) return INVALID;`);
786
+ return accessor;
787
+ }
788
+ if (fmt === "base64url") {
789
+ const validator = addConstant(ctx, isValidBase64URL);
790
+ doc.write(`if (!${validator}(${accessor})) return INVALID;`);
791
+ return accessor;
792
+ }
793
+ if (fmt === "jwt") {
794
+ const validator = addConstant(ctx, isValidJWT);
795
+ const alg = addConstant(ctx, (def as unknown as { alg?: util.JWTAlgorithm }).alg ?? null);
796
+ doc.write(`if (!${validator}(${accessor}, ${alg})) return INVALID;`);
797
+ return accessor;
798
+ }
799
+ if (fmt === "ipv6") {
800
+ const validator = addConstant(ctx, isValidIPv6);
801
+ doc.write(`if (!${validator}(${accessor})) return INVALID;`);
802
+ return accessor;
803
+ }
804
+ if (fmt === "cidrv6") {
805
+ const validator = addConstant(ctx, isValidCIDRv6);
806
+ doc.write(`if (!${validator}(${accessor})) return INVALID;`);
807
+ return accessor;
808
+ }
809
+ if (fmt === "credit_card") {
810
+ const validator = addConstant(ctx, isValidCreditCard);
811
+ doc.write(`if (!${validator}(${accessor})) return INVALID;`);
812
+ return accessor;
813
+ }
814
+ if (fmt === "iban") {
815
+ const validator = addConstant(ctx, isValidIBAN);
816
+ doc.write(`if (!${validator}(${accessor})) return INVALID;`);
817
+ return accessor;
818
+ }
819
+ const formatDef = def as unknown as { normalize?: boolean; hostname?: unknown; protocol?: unknown };
820
+ if (
821
+ fmt === "url" ||
822
+ fmt === "httpurl" ||
823
+ formatDef.normalize ||
824
+ formatDef.hostname !== undefined ||
825
+ formatDef.protocol !== undefined
826
+ ) {
827
+ // Same three predicates the runtime calls, in the same order, so there is no second URL implementation to drift. Which options exist is known now, so the calls the runtime makes conditionally are emitted conditionally instead.
828
+ const parseConst = addConstant(ctx, parseURLObject);
829
+ const defConst = addConstant(ctx, def);
830
+ const trimVar = newVar(ctx);
831
+ const urlVar = newVar(ctx);
832
+ doc.write(`const ${trimVar} = ${accessor}.trim();`);
833
+ doc.write(`const ${urlVar} = ${parseConst}(${trimVar}, ${defConst});`);
834
+ doc.write(`if (typeof ${urlVar} === "number") return INVALID;`);
835
+ if (formatDef.hostname !== undefined) {
836
+ const hostnameConst = addConstant(ctx, urlHostnameOk);
837
+ doc.write(`if (!${hostnameConst}(${urlVar}, ${defConst}.hostname)) return INVALID;`);
838
+ }
839
+ if (formatDef.protocol !== undefined) {
840
+ const protocolConst = addConstant(ctx, urlProtocolOk);
841
+ doc.write(`if (!${protocolConst}(${urlVar}, ${defConst}.protocol)) return INVALID;`);
842
+ }
843
+ const outputVar = newVar(ctx);
844
+ const outputExpr = formatDef.normalize ? `${urlVar}.href` : `${addConstant(ctx, stripTabAndNewline)}(${trimVar})`;
845
+ doc.write(`const ${outputVar} = ${outputExpr};`);
846
+ return outputVar;
847
+ }
848
+
849
+ // A custom string format carries the predicate the runtime actually calls. Hoist and call it instead of testing `def.pattern`: the two only coincide when the format was built from a RegExp, and relying on that coupling is how supplemental validation gets dropped.
850
+ const customFn = (def as unknown as { fn?: (input: string) => unknown }).fn;
851
+ if (customFn) {
852
+ if (isAsyncFunction(customFn)) throw new ZodCompileUnsupportedError(`async string format ${fmt}`);
853
+ const fnConst = addConstant(ctx, customFn);
854
+ doc.write(`if (!${fnConst}(${accessor})) return INVALID;`);
855
+ return accessor;
856
+ }
857
+
858
+ // Formats whose `pattern` IS the whole check. An allowlist rather than `if (def.pattern)`, because credit_card, base64 and ipv6 carry a shape-only pattern and validate the rest separately.
859
+ if (PATTERN_IS_COMPLETE.has(fmt) && def.pattern) {
860
+ const patternConst = addConstant(ctx, def.pattern);
861
+ doc.write(`${patternConst}.lastIndex = 0;`);
862
+ doc.write(`if (!${patternConst}.test(${accessor})) return INVALID;`);
863
+ return accessor;
864
+ }
865
+
866
+ const format = def.format as SupportedStringFormat;
867
+ switch (format) {
868
+ case "regex":
869
+ // A regex check with a pattern returned above. Reaching here means there is no pattern to test, and accepting unconditionally would pass every input, so hand the schema back to the runtime.
870
+ throw new ZodCompileUnsupportedError("regex format without a pattern");
871
+ case "lowercase":
872
+ doc.write(`if (${accessor} !== ${accessor}.toLowerCase()) return INVALID;`);
873
+ break;
874
+ case "uppercase":
875
+ doc.write(`if (${accessor} !== ${accessor}.toUpperCase()) return INVALID;`);
876
+ break;
877
+ case "includes":
878
+ doc.write(
879
+ `if (!${accessor}.includes(${util.esc((def as checks.$ZodCheckIncludesDef).includes)})) return INVALID;`
880
+ );
881
+ break;
882
+ case "starts_with": {
883
+ const prefix = (def as checks.$ZodCheckStartsWithDef).prefix;
884
+ doc.write(`if (${accessor}.slice(0, ${prefix.length}) !== ${util.esc(prefix)}) return INVALID;`);
885
+ break;
886
+ }
887
+ case "ends_with": {
888
+ const suffix = (def as checks.$ZodCheckEndsWithDef).suffix;
889
+ doc.write(`if (${accessor}.slice(-${suffix.length}) !== ${util.esc(suffix)}) return INVALID;`);
890
+ break;
891
+ }
892
+ default: {
893
+ void (format satisfies never);
894
+ throw new ZodCompileUnsupportedError(`string format ${format}`);
895
+ }
896
+ }
897
+ return accessor;
898
+ }
899
+
900
+ // Union of all schema types we support in AOT compilation
901
+ type SupportedSchemaType =
902
+ | "string"
903
+ | "number"
904
+ | "boolean"
905
+ | "bigint"
906
+ | "symbol"
907
+ | "undefined"
908
+ | "null"
909
+ | "any"
910
+ | "unknown"
911
+ | "never"
912
+ | "void"
913
+ | "nan"
914
+ | "date"
915
+ | "object"
916
+ | "optional"
917
+ | "nullable"
918
+ | "array"
919
+ | "literal"
920
+ | "enum"
921
+ | "readonly"
922
+ | "success"
923
+ | "default"
924
+ | "prefault"
925
+ | "nonoptional"
926
+ | "tuple"
927
+ | "union"
928
+ | "intersection"
929
+ | "record"
930
+ | "map"
931
+ | "set"
932
+ | "file"
933
+ | "template_literal"
934
+ | "lazy"
935
+ | "pipe"
936
+ | "custom"
937
+ | "properties"
938
+ | "transform"
939
+ | "catch";
940
+
941
+ function generateCheck(doc: Doc, ctx: CompileContext, schema: SomeType, accessor: string): string;
942
+ function generateCheck(
943
+ doc: Doc,
944
+ ctx: CompileContext,
945
+ schema: SomeType,
946
+ accessor: string,
947
+ needsValue: boolean
948
+ ): string | null;
949
+ function generateCheck(
950
+ doc: Doc,
951
+ ctx: CompileContext,
952
+ schema: SomeType,
953
+ accessor: string,
954
+ needsValue = true
955
+ ): string | null {
956
+ const def = schema._zod.def;
957
+ const type = def.type as SupportedSchemaType;
958
+
959
+ // A coercing schema would compile to the bare type test and reject what it should convert; inside a union that reads as a rejected branch, so refuse at codegen.
960
+ if ((def as { coerce?: boolean }).coerce) {
961
+ throw new ZodCompileUnsupportedError(`coercion (z.coerce.${type}())`);
962
+ }
963
+
964
+ // A node builds its output when its caller reads one, or when it carries checks of its own, since a check reads what was built. One polarity for the whole walk: this is what the node does, and it is what its children are told they need.
965
+ const buildsValue = needsValue || !!def.checks?.length;
966
+ let typeAccessor: string | null;
967
+
968
+ switch (type) {
969
+ case "string":
970
+ typeAccessor = generateStringCheck(doc, ctx, schema, accessor);
971
+ break;
972
+ case "number":
973
+ typeAccessor = generateNumberCheck(doc, schema, accessor);
974
+ break;
975
+ case "boolean":
976
+ typeAccessor = generateBooleanCheck(doc, accessor);
977
+ break;
978
+ case "bigint":
979
+ typeAccessor = generateBigIntCheck(doc, schema, accessor);
980
+ break;
981
+ case "symbol":
982
+ typeAccessor = generateSymbolCheck(doc, accessor);
983
+ break;
984
+ case "undefined":
985
+ typeAccessor = generateUndefinedCheck(doc, accessor);
986
+ break;
987
+ case "null":
988
+ typeAccessor = generateNullCheck(doc, accessor);
989
+ break;
990
+ case "any":
991
+ case "unknown":
992
+ // No check needed - pass through
993
+ typeAccessor = accessor;
994
+ break;
995
+ case "never":
996
+ doc.write("return INVALID;");
997
+ typeAccessor = accessor;
998
+ break;
999
+ case "void":
1000
+ typeAccessor = generateVoidCheck(doc, accessor);
1001
+ break;
1002
+ case "nan":
1003
+ typeAccessor = generateNaNCheck(doc, accessor);
1004
+ break;
1005
+ case "date":
1006
+ typeAccessor = generateDateCheck(doc, accessor);
1007
+ break;
1008
+ case "object":
1009
+ typeAccessor = generateObjectCheck(doc, ctx, schema, accessor, buildsValue);
1010
+ break;
1011
+ case "optional":
1012
+ typeAccessor = generateOptionalCheck(doc, ctx, schema, accessor, buildsValue);
1013
+ break;
1014
+ case "nullable":
1015
+ typeAccessor = generateNullableCheck(doc, ctx, schema, accessor, buildsValue);
1016
+ break;
1017
+ case "array":
1018
+ typeAccessor = generateArrayCheck(doc, ctx, schema, accessor, buildsValue);
1019
+ break;
1020
+ case "literal":
1021
+ typeAccessor = generateLiteralCheck(doc, ctx, schema, accessor);
1022
+ break;
1023
+ case "enum":
1024
+ typeAccessor = generateEnumCheck(doc, ctx, schema, accessor);
1025
+ break;
1026
+ case "readonly": {
1027
+ const innerOut = generateWrapperCheck(doc, ctx, schema, accessor);
1028
+ // Runtime freezes the parsed value (schemas.ts handleReadonlyResult).
1029
+ const frozenVar = newVar(ctx);
1030
+ doc.write(`const ${frozenVar} = Object.freeze(${innerOut});`);
1031
+ typeAccessor = frozenVar;
1032
+ break;
1033
+ }
1034
+ case "success":
1035
+ // Runtime output is `issues.length === 0`. The fast path only reaches
1036
+ // here when the inner check passed (failure returns INVALID and the
1037
+ // runtime fallback reproduces the inner issues), so the output is
1038
+ // always `true`.
1039
+ generateWrapperCheck(doc, ctx, schema, accessor);
1040
+ typeAccessor = "true";
1041
+ break;
1042
+ case "default":
1043
+ case "prefault":
1044
+ typeAccessor = generateDefaultCheck(doc, ctx, schema, accessor);
1045
+ break;
1046
+ case "nonoptional":
1047
+ typeAccessor = generateNonOptionalCheck(doc, ctx, schema, accessor);
1048
+ break;
1049
+ case "tuple":
1050
+ typeAccessor = generateTupleCheck(doc, ctx, schema, accessor);
1051
+ break;
1052
+ case "union":
1053
+ typeAccessor = generateUnionCheck(doc, ctx, schema, accessor);
1054
+ break;
1055
+ case "intersection":
1056
+ typeAccessor = generateIntersectionCheck(doc, ctx, schema, accessor);
1057
+ break;
1058
+ case "record":
1059
+ typeAccessor = generateRecordCheck(doc, ctx, schema, accessor);
1060
+ break;
1061
+ case "map":
1062
+ typeAccessor = generateMapCheck(doc, ctx, schema, accessor);
1063
+ break;
1064
+ case "set":
1065
+ typeAccessor = generateSetCheck(doc, ctx, schema, accessor);
1066
+ break;
1067
+ case "file":
1068
+ typeAccessor = generateFileCheck(doc, accessor);
1069
+ break;
1070
+ case "template_literal":
1071
+ typeAccessor = generateTemplateLiteralCheck(doc, ctx, schema, accessor);
1072
+ break;
1073
+ case "lazy":
1074
+ typeAccessor = generateLazyCheck(doc, ctx, schema, accessor);
1075
+ break;
1076
+ case "pipe":
1077
+ typeAccessor = generatePipeCheck(doc, ctx, schema, accessor);
1078
+ break;
1079
+ case "custom":
1080
+ typeAccessor = generateCustomCheck(doc, ctx, schema, accessor);
1081
+ break;
1082
+ case "properties":
1083
+ generatePropertiesChecks(doc, ctx, (schema as $ZodProperties)._zod.def, accessor, true);
1084
+ typeAccessor = accessor;
1085
+ break;
1086
+ case "transform":
1087
+ typeAccessor = generateTransformCheck(doc, ctx, schema, accessor);
1088
+ break;
1089
+ case "catch":
1090
+ typeAccessor = generateCatchCheck(doc, ctx, schema, accessor);
1091
+ break;
1092
+ default: {
1093
+ void (type satisfies never);
1094
+ throw new ZodCompileUnsupportedError(`schema type ${type}`);
1095
+ }
1096
+ }
1097
+
1098
+ // a node that built nothing has no checks to run: not building requires an empty check list
1099
+ if (typeAccessor === null) return null;
1100
+
1101
+ // Generate checks after the type-specific validation (may transform value)
1102
+ return generateChecks(doc, ctx, schema, typeAccessor);
1103
+ }
1104
+
1105
+ function generateStringCheck(doc: Doc, ctx: CompileContext, schema: SomeType, accessor: string): string {
1106
+ doc.write(`if (typeof ${accessor} !== "string") return INVALID;`);
1107
+
1108
+ // z.email() carries its format on the def, z.string().email() in def.checks; both route here so the format table has no second copy to drift from.
1109
+ const def = schema._zod.def as unknown as StringFormatDef & { format?: string };
1110
+ if (def.format === undefined) return accessor;
1111
+ return generateStringFormatCheck(doc, ctx, def, accessor);
1112
+ }
1113
+
1114
+ function generateNumberCheck(doc: Doc, schema: SomeType, accessor: string): string {
1115
+ // Runtime z.number() rejects NaN and ±Infinity. Number.isFinite covers both.
1116
+ doc.write(`if (typeof ${accessor} !== "number" || !Number.isFinite(${accessor})) return INVALID;`);
1117
+
1118
+ // Mini factories like z.int(), z.int32(), z.uint32(), z.float32() bake a number_format check into the schema def itself (not into def.checks). Apply the same constraint here.
1119
+ const def = schema._zod.def as unknown as { check?: string; format?: string };
1120
+ if (def.check === "number_format" && def.format) {
1121
+ generateNumberFormatCheck(doc, { format: def.format } as checks.$ZodCheckNumberFormatDef, accessor);
1122
+ }
1123
+ return accessor;
1124
+ }
1125
+
1126
+ function generateBooleanCheck(doc: Doc, accessor: string): string {
1127
+ doc.write(`if (typeof ${accessor} !== "boolean") return INVALID;`);
1128
+ return accessor;
1129
+ }
1130
+
1131
+ function generateBigIntCheck(doc: Doc, schema: SomeType, accessor: string): string {
1132
+ doc.write(`if (typeof ${accessor} !== "bigint") return INVALID;`);
1133
+
1134
+ // Handle bigint format (int64, uint64) directly on the schema def
1135
+ const def = schema._zod.def as unknown as { format?: string };
1136
+ if (def.format) {
1137
+ switch (def.format) {
1138
+ case "int64":
1139
+ doc.write(`if (${accessor} < -9223372036854775808n || ${accessor} > 9223372036854775807n) return INVALID;`);
1140
+ break;
1141
+ case "uint64":
1142
+ doc.write(`if (${accessor} < 0n || ${accessor} > 18446744073709551615n) return INVALID;`);
1143
+ break;
1144
+ }
1145
+ }
1146
+ return accessor;
1147
+ }
1148
+
1149
+ function generateSymbolCheck(doc: Doc, accessor: string): string {
1150
+ doc.write(`if (typeof ${accessor} !== "symbol") return INVALID;`);
1151
+ return accessor;
1152
+ }
1153
+
1154
+ function generateUndefinedCheck(doc: Doc, accessor: string): string {
1155
+ doc.write(`if (${accessor} !== undefined) return INVALID;`);
1156
+ return accessor;
1157
+ }
1158
+
1159
+ function generateNullCheck(doc: Doc, accessor: string): string {
1160
+ doc.write(`if (${accessor} !== null) return INVALID;`);
1161
+ return accessor;
1162
+ }
1163
+
1164
+ function generateVoidCheck(doc: Doc, accessor: string): string {
1165
+ doc.write(`if (${accessor} !== undefined) return INVALID;`);
1166
+ return accessor;
1167
+ }
1168
+
1169
+ function generateNaNCheck(doc: Doc, accessor: string): string {
1170
+ doc.write(`if (typeof ${accessor} !== "number" || !Number.isNaN(${accessor})) return INVALID;`);
1171
+ return accessor;
1172
+ }
1173
+
1174
+ function generateDateCheck(doc: Doc, accessor: string): string {
1175
+ doc.write(`if (!(${accessor} instanceof Date) || Number.isNaN(${accessor}.getTime())) return INVALID;`);
1176
+ return accessor;
1177
+ }
1178
+
1179
+ function generateObjectCheck(
1180
+ doc: Doc,
1181
+ ctx: CompileContext,
1182
+ schema: SomeType,
1183
+ accessor: string,
1184
+ buildsValue = true
1185
+ ): string | null {
1186
+ const def = schema._zod.def as unknown as { shape: Record<string, SomeType>; catchall?: SomeType };
1187
+
1188
+ // Check that input is a non-null, non-array object
1189
+ doc.write(
1190
+ `if (typeof ${accessor} !== "object" || ${accessor} === null || Array.isArray(${accessor})) return INVALID;`
1191
+ );
1192
+
1193
+ const shape = def.shape;
1194
+ const keys = Object.keys(shape);
1195
+ const symbolKeys = Object.getOwnPropertySymbols(shape);
1196
+ // a symbol has no source literal, so it is hoisted as a constant; `keys` stays string-only where the emitted code uses `for...in`
1197
+ const allKeys: (string | symbol)[] = symbolKeys.length ? [...keys, ...symbolKeys] : keys;
1198
+ const keyExpr = (k: string | symbol) => (typeof k === "symbol" ? addConstant(ctx, k) : util.esc(k));
1199
+ const propKey = (k: string | symbol) => (typeof k === "symbol" ? `[${keyExpr(k)}]` : util.esc(k));
1200
+ const propShape = shape as Record<string | symbol, SomeType>;
1201
+
1202
+ // `__proto__` as an own shape key can't be expressed in an output object literal (the literal form sets the prototype instead of an own property).
1203
+ if (keys.includes("__proto__")) {
1204
+ throw new ZodCompileUnsupportedError('object shape key "__proto__"');
1205
+ }
1206
+
1207
+ // Map from key to output accessor for that property
1208
+ const propOutputs = new Map<string | symbol, string>();
1209
+
1210
+ // Validate each property and collect output accessors
1211
+ for (const key of allKeys) {
1212
+ const propSchema = propShape[key]!;
1213
+ const kx = keyExpr(key);
1214
+ // Always cache the property read: the runtime reads input[key] exactly once, so a getter must not be re-read by checks or output assembly.
1215
+ const inputVar = newVar(ctx);
1216
+ doc.write(`const ${inputVar} = ${accessor}[${kx}];`);
1217
+
1218
+ if (propSchema._zod.optin !== undefined) {
1219
+ // Any optin rung means the key may be omitted. The runtime runs the property anyway and ignores issues only when the key is genuinely absent, which is what makes exactOptional compositional.
1220
+ const outputVar = newVar(ctx);
1221
+ doc.write(`let ${outputVar} = (() => {`);
1222
+ doc.indented((d) => {
1223
+ const outputAccessor = compileChild(d, ctx, propSchema, inputVar);
1224
+ d.write(`return ${outputAccessor};`);
1225
+ });
1226
+ doc.write(`})();`);
1227
+
1228
+ if (propSchema._zod.optout === "optional") {
1229
+ doc.write(`if (${outputVar} === INVALID) {`);
1230
+ doc.indented((d) => {
1231
+ d.write(`if (${kx} in ${accessor}) return INVALID;`);
1232
+ d.write(`${outputVar} = undefined;`);
1233
+ });
1234
+ doc.write(`}`);
1235
+ } else {
1236
+ doc.write(`if (${outputVar} === INVALID) return INVALID;`);
1237
+ }
1238
+ propOutputs.set(key, outputVar);
1239
+ } else {
1240
+ if (requiresPresenceCheck(propSchema)) {
1241
+ doc.write(`if (!(${kx} in ${accessor})) return INVALID;`);
1242
+ }
1243
+
1244
+ // Generate check and get output accessor
1245
+ const outputAccessor = compileChild(doc, ctx, propSchema, inputVar, buildsValue);
1246
+ if (outputAccessor !== null) propOutputs.set(key, outputAccessor);
1247
+ }
1248
+ }
1249
+
1250
+ // Handle catchall
1251
+ const catchall = def.catchall;
1252
+ let unknownKeysMode: "none" | "passthrough" | "schema" = "none";
1253
+
1254
+ if (catchall) {
1255
+ const catchallType = catchall._zod.def.type;
1256
+
1257
+ if (catchallType === "never") {
1258
+ // Strict: one `for...in`, as the runtime does, so inherited enumerable keys count. An undeclared `__proto__` is reported here and excluded only from the output (#6221); an own-key count would wrongly reject a class instance.
1259
+ const condition = keys.map((k) => `k !== ${util.esc(k)}`).join(" && ") || "true";
1260
+ doc.write(`for (const k in ${accessor}) {`);
1261
+ doc.indented((d) => {
1262
+ d.write(`if (${condition}) return INVALID;`);
1263
+ });
1264
+ doc.write(`}`);
1265
+ } else if ((catchallType === "unknown" || catchallType === "any") && !catchall._zod.def.checks?.length) {
1266
+ unknownKeysMode = "passthrough";
1267
+ } else {
1268
+ unknownKeysMode = "schema";
1269
+ }
1270
+ }
1271
+ // else: strip mode (no catchall) - unknown keys ignored, only include known keys
1272
+
1273
+ // defaulted required outputs keep their keys even when undefined
1274
+ const outputVar = newVar(ctx);
1275
+ const hasConditionalKeys = allKeys.some((k) => mayOmitUndefined(propShape[k]!) || dropsWhenAbsent(propShape[k]!));
1276
+
1277
+ // Assert mode: every declared key is validated above, so the output literal and the unknown-key copy are pure waste. A `never` catchall already emitted its rejection loop; a schema catchall still has to validate the values it would otherwise have stored.
1278
+ if (!buildsValue) {
1279
+ if (unknownKeysMode === "schema") {
1280
+ const knownSet = keys.length > 0 ? addConstant(ctx, new Set(keys)) : null;
1281
+ doc.write(`for (const k in ${accessor}) {`);
1282
+ doc.indented((d) => {
1283
+ d.write(`if (k === "__proto__") continue;`);
1284
+ if (knownSet) d.write(`if (${knownSet}.has(k)) continue;`);
1285
+ const valVar = newVar(ctx);
1286
+ d.write(`const ${valVar} = ${accessor}[k];`);
1287
+ compileChild(d, ctx, catchall!, valVar, false);
1288
+ });
1289
+ doc.write(`}`);
1290
+ }
1291
+ return null;
1292
+ }
1293
+
1294
+ if (!hasConditionalKeys) {
1295
+ const propLiterals = allKeys.map((k) => `${propKey(k)}: ${propOutputs.get(k)}`).join(", ");
1296
+ doc.write(`const ${outputVar} = { ${propLiterals} };`);
1297
+ } else {
1298
+ doc.write(`const ${outputVar} = {};`);
1299
+ for (const k of allKeys) {
1300
+ const kx = keyExpr(k);
1301
+ const out = propOutputs.get(k);
1302
+ if (dropsWhenAbsent(propShape[k]!)) {
1303
+ doc.write(`if (${kx} in ${accessor}) ${outputVar}[${kx}] = ${out};`);
1304
+ } else if (mayOmitUndefined(propShape[k]!)) {
1305
+ doc.write(`if (${out} !== undefined || ${kx} in ${accessor}) ${outputVar}[${kx}] = ${out};`);
1306
+ } else {
1307
+ doc.write(`${outputVar}[${kx}] = ${out};`);
1308
+ }
1309
+ }
1310
+ }
1311
+
1312
+ if (unknownKeysMode !== "none") {
1313
+ // Unknown keys are written directly into the output after shape keys — for...in (like the runtime) so inherited enumerables participate.
1314
+ const knownSet = keys.length > 0 ? addConstant(ctx, new Set(keys)) : null;
1315
+ doc.write(`for (const k in ${accessor}) {`);
1316
+ doc.indented((d) => {
1317
+ // Skip __proto__: assigning obj["__proto__"] on a plain {} replaces the prototype via the setter rather than adding an own property. Mirrors the runtime catchall fix (#5898).
1318
+ d.write(`if (k === "__proto__") continue;`);
1319
+ if (knownSet) d.write(`if (${knownSet}.has(k)) continue;`);
1320
+ if (unknownKeysMode === "passthrough") {
1321
+ d.write(`${outputVar}[k] = ${accessor}[k];`);
1322
+ } else {
1323
+ const valVar = newVar(ctx);
1324
+ d.write(`const ${valVar} = ${accessor}[k];`);
1325
+ const catchallOut = compileChild(d, ctx, catchall!, valVar);
1326
+ d.write(`${outputVar}[k] = ${catchallOut};`);
1327
+ }
1328
+ });
1329
+ doc.write(`}`);
1330
+ }
1331
+
1332
+ return outputVar;
1333
+ }
1334
+
1335
+ function generateOptionalCheck(
1336
+ doc: Doc,
1337
+ ctx: CompileContext,
1338
+ schema: SomeType,
1339
+ accessor: string,
1340
+ buildsValue = true
1341
+ ): string | null {
1342
+ const def = schema._zod.def as unknown as { innerType: SomeType };
1343
+ if (isExactOptional(schema)) {
1344
+ return generateCheck(doc, ctx, def.innerType, accessor, buildsValue);
1345
+ }
1346
+
1347
+ // Same question $ZodOptional asks: only the top rung of the optin ladder substitutes a value for an absent input, so only it is worth running on `undefined`. Every other rung leaves the value intact, which is the skip branch below.
1348
+ if (def.innerType._zod.optin === "defaulted") {
1349
+ const outputVar = newVar(ctx);
1350
+ const branchVar = newVar(ctx);
1351
+ doc.write(`let ${outputVar};`);
1352
+ doc.write(`if (${accessor} === undefined) {`);
1353
+ doc.indented((d) => {
1354
+ d.write(`const ${branchVar} = (() => {`);
1355
+ d.indented((d2) => {
1356
+ const innerOutput = generateCheck(d2, ctx, def.innerType, accessor);
1357
+ d2.write(`return ${innerOutput};`);
1358
+ });
1359
+ d.write(`})();`);
1360
+ d.write(`if (${branchVar} !== INVALID) ${outputVar} = ${branchVar};`);
1361
+ });
1362
+ doc.write(`} else {`);
1363
+ doc.indented((d) => {
1364
+ const innerOutput = generateCheck(d, ctx, def.innerType, accessor);
1365
+ d.write(`${outputVar} = ${innerOutput};`);
1366
+ });
1367
+ doc.write(`}`);
1368
+ return outputVar;
1369
+ }
1370
+
1371
+ const outputVar = buildsValue ? newVar(ctx) : null;
1372
+ if (outputVar) doc.write(`let ${outputVar};`);
1373
+ doc.write(`if (${accessor} !== undefined) {`);
1374
+ doc.indented((d) => {
1375
+ const innerOutput = generateCheck(d, ctx, def.innerType, accessor, buildsValue);
1376
+ if (outputVar && innerOutput !== null) d.write(`${outputVar} = ${innerOutput};`);
1377
+ });
1378
+ doc.write(`}`);
1379
+ return outputVar;
1380
+ }
1381
+
1382
+ function isExactOptional(schema: SomeType): boolean {
1383
+ return (schema._zod as { traits?: Set<string> }).traits?.has("$ZodExactOptional") === true;
1384
+ }
1385
+
1386
+ // A value-level fast path reads an absent key as `undefined`, so z.undefined(), z.any() and unions containing undefined would accept a missing property the runtime rejects.
1387
+ function requiresPresenceCheck(schema: SomeType): boolean {
1388
+ return schema._zod.optin === undefined && fastPathAcceptsAbsence(schema);
1389
+ }
1390
+
1391
+ function fastPathAcceptsAbsence(schema: SomeType): boolean {
1392
+ // An island is handed `input[key]` and cannot tell absent from explicitly undefined, so report absence-accepting and let the object emit the presence guard (#6405).
1393
+ if ((schema._zod.def as { coerce?: boolean }).coerce) return true;
1394
+
1395
+ const def = schema._zod.def as {
1396
+ type: string;
1397
+ values?: unknown[];
1398
+ innerType?: SomeType;
1399
+ options?: SomeType[];
1400
+ in?: SomeType;
1401
+ out?: SomeType;
1402
+ left?: SomeType;
1403
+ right?: SomeType;
1404
+ };
1405
+
1406
+ switch (def.type) {
1407
+ case "any":
1408
+ case "unknown":
1409
+ case "undefined":
1410
+ case "void":
1411
+ case "default":
1412
+ case "prefault":
1413
+ case "transform":
1414
+ case "custom":
1415
+ case "lazy":
1416
+ return true;
1417
+ case "string":
1418
+ case "number":
1419
+ case "boolean":
1420
+ case "bigint":
1421
+ case "symbol":
1422
+ case "null":
1423
+ case "never":
1424
+ case "nan":
1425
+ case "date":
1426
+ case "object":
1427
+ case "array":
1428
+ case "tuple":
1429
+ case "record":
1430
+ case "map":
1431
+ case "set":
1432
+ case "file":
1433
+ case "template_literal":
1434
+ return false;
1435
+ case "nonoptional":
1436
+ // Normally rejects an absent key, but not when something inside supplies a value for it: `.default(v).optional().nonoptional()` accepts absence and yields v. Defer to the inner — over-reporting here only costs a presence check, and a fast path that wrongly rejects still falls back to the runtime.
1437
+ return def.innerType ? fastPathAcceptsAbsence(def.innerType) : false;
1438
+ case "literal":
1439
+ return !!def.values?.includes(undefined);
1440
+ case "enum":
1441
+ return !!(schema._zod as unknown as { values?: Set<unknown> }).values?.has(undefined);
1442
+ case "optional":
1443
+ case "nullable":
1444
+ case "readonly":
1445
+ case "success":
1446
+ return def.innerType ? fastPathAcceptsAbsence(def.innerType) : true;
1447
+ case "catch":
1448
+ // catch always produces a value (inner may fail → catchValue substitutes), so it accepts an absent key regardless of inner.
1449
+ return true;
1450
+ case "union":
1451
+ return def.options ? def.options.some(fastPathAcceptsAbsence) : true;
1452
+ case "intersection":
1453
+ if (!def.left || !def.right) return true;
1454
+ return fastPathAcceptsAbsence(def.left) && fastPathAcceptsAbsence(def.right);
1455
+ case "pipe":
1456
+ return def.in ? fastPathAcceptsAbsence(def.in) : true;
1457
+ default:
1458
+ return true;
1459
+ }
1460
+ }
1461
+
1462
+ /** The middle rung permits absence without supplying anything in its place, so an absent key contributes nothing — mirrors the leading gate in `handlePropertyResult`. */
1463
+ function dropsWhenAbsent(schema: SomeType): boolean {
1464
+ return schema._zod.optin === "optional" && schema._zod.optout === "optional";
1465
+ }
1466
+
1467
+ function mayOmitUndefined(schema: SomeType): boolean {
1468
+ return (schema._zod.optin !== "defaulted" || schema._zod.optout === "optional") && mayOutputUndefined(schema);
1469
+ }
1470
+
1471
+ // whether a schema's success-path output can be undefined
1472
+ function mayOutputUndefined(schema: SomeType): boolean {
1473
+ const def = schema._zod.def as {
1474
+ type: string;
1475
+ values?: unknown[];
1476
+ innerType?: SomeType;
1477
+ options?: SomeType[];
1478
+ out?: SomeType;
1479
+ left?: SomeType;
1480
+ right?: SomeType;
1481
+ };
1482
+ switch (def.type) {
1483
+ case "string":
1484
+ case "number":
1485
+ case "boolean":
1486
+ case "bigint":
1487
+ case "symbol":
1488
+ case "null":
1489
+ case "nan":
1490
+ case "date":
1491
+ case "object":
1492
+ case "array":
1493
+ case "tuple":
1494
+ case "record":
1495
+ case "map":
1496
+ case "set":
1497
+ case "file":
1498
+ case "template_literal":
1499
+ case "never":
1500
+ case "success":
1501
+ return false;
1502
+ case "literal":
1503
+ return !!def.values?.includes(undefined);
1504
+ case "enum":
1505
+ return !!(schema._zod as unknown as { values?: Set<unknown> }).values?.has(undefined);
1506
+ case "optional":
1507
+ return true;
1508
+ case "nullable":
1509
+ case "readonly":
1510
+ case "nonoptional":
1511
+ return def.innerType ? mayOutputUndefined(def.innerType) : true;
1512
+ case "union":
1513
+ return def.options ? def.options.some(mayOutputUndefined) : true;
1514
+ case "intersection":
1515
+ return !def.left || !def.right || mayOutputUndefined(def.left) || mayOutputUndefined(def.right);
1516
+ case "pipe":
1517
+ return def.out ? mayOutputUndefined(def.out) : true;
1518
+ default:
1519
+ // any/unknown/undefined/void/default/prefault/transform/custom/lazy/catch
1520
+ return true;
1521
+ }
1522
+ }
1523
+
1524
+ function generateNullableCheck(
1525
+ doc: Doc,
1526
+ ctx: CompileContext,
1527
+ schema: SomeType,
1528
+ accessor: string,
1529
+ buildsValue = true
1530
+ ): string | null {
1531
+ const def = schema._zod.def as unknown as { innerType: SomeType };
1532
+ const outputVar = buildsValue ? newVar(ctx) : null;
1533
+ if (outputVar) doc.write(`let ${outputVar} = null;`);
1534
+ doc.write(`if (${accessor} !== null) {`);
1535
+ doc.indented((d) => {
1536
+ const innerOutput = generateCheck(d, ctx, def.innerType, accessor, buildsValue);
1537
+ if (outputVar && innerOutput !== null) d.write(`${outputVar} = ${innerOutput};`);
1538
+ });
1539
+ doc.write(`}`);
1540
+ return outputVar;
1541
+ }
1542
+
1543
+ function generateArrayCheck(
1544
+ doc: Doc,
1545
+ ctx: CompileContext,
1546
+ schema: SomeType,
1547
+ accessor: string,
1548
+ buildsValue = true
1549
+ ): string | null {
1550
+ const def = schema._zod.def as unknown as { element: SomeType };
1551
+ doc.write(`if (!Array.isArray(${accessor})) return INVALID;`);
1552
+
1553
+ // Build a new array with validated/transformed elements.
1554
+ const outputVar = buildsValue ? newVar(ctx) : null;
1555
+ const iVar = newVar(ctx);
1556
+ const elemVar = newVar(ctx);
1557
+
1558
+ if (outputVar) doc.write(`const ${outputVar} = new Array(${accessor}.length);`);
1559
+ doc.write(`for (let ${iVar} = 0; ${iVar} < ${accessor}.length; ${iVar}++) {`);
1560
+ doc.indented((d) => {
1561
+ d.write(`const ${elemVar} = ${accessor}[${iVar}];`);
1562
+ const elemOutput = compileChild(d, ctx, def.element, elemVar, buildsValue);
1563
+ if (outputVar && elemOutput !== null) d.write(`${outputVar}[${iVar}] = ${elemOutput};`);
1564
+ });
1565
+ doc.write(`}`);
1566
+
1567
+ return outputVar;
1568
+ }
1569
+
1570
+ function generateLiteralCheck(doc: Doc, ctx: CompileContext, schema: SomeType, accessor: string): string {
1571
+ const def = schema._zod.def as unknown as { values: unknown[] };
1572
+ const values = def.values;
1573
+
1574
+ // Anything but a single value goes through Set.has: multi-value so every value participates, empty so nothing does — values[0] would be undefined and compile to an `!== undefined` check that accepts it. Single-value stays inlined for speed.
1575
+ if (values.length !== 1) {
1576
+ const literalSet = addConstant(ctx, new Set(values));
1577
+ doc.write(`if (!${literalSet}.has(${accessor})) return INVALID;`);
1578
+ return accessor;
1579
+ }
1580
+
1581
+ const value = values[0];
1582
+ // `$ZodLiteral` matches with `values.has`, i.e. SameValueZero, so NaN matches itself. `x !== NaN` is true for every input, which would reject everything — hand it to the same Set form the multi-value path uses.
1583
+ if (typeof value === "number" && Number.isNaN(value)) {
1584
+ const literalSet = addConstant(ctx, new Set(values));
1585
+ doc.write(`if (!${literalSet}.has(${accessor})) return INVALID;`);
1586
+ return accessor;
1587
+ }
1588
+ if (typeof value === "string") {
1589
+ doc.write(`if (${accessor} !== ${util.esc(value)}) return INVALID;`);
1590
+ } else if (typeof value === "number" || typeof value === "boolean") {
1591
+ doc.write(`if (${accessor} !== ${value}) return INVALID;`);
1592
+ } else if (value === null) {
1593
+ doc.write(`if (${accessor} !== null) return INVALID;`);
1594
+ } else if (value === undefined) {
1595
+ doc.write(`if (${accessor} !== undefined) return INVALID;`);
1596
+ } else if (typeof value === "bigint") {
1597
+ doc.write(`if (${accessor} !== ${value}n) return INVALID;`);
1598
+ } else {
1599
+ throw new ZodCompileUnsupportedError(`literal type ${typeof value}`);
1600
+ }
1601
+ return accessor;
1602
+ }
1603
+
1604
+ function generateEnumCheck(doc: Doc, ctx: CompileContext, schema: SomeType, accessor: string): string {
1605
+ const values = (schema._zod as unknown as { values?: Set<unknown> }).values;
1606
+ // z.partialRecord and friends clear `_zod.values`, leaving no set to test membership against. Throw rather than emit INVALID so a union falls back whole instead of counting a false rejection.
1607
+ if (!values) {
1608
+ throw new ZodCompileUnsupportedError("enum schema without enumerated values");
1609
+ }
1610
+ const enumSet = addConstant(ctx, values);
1611
+ doc.write(`if (!${enumSet}.has(${accessor})) return INVALID;`);
1612
+ return accessor;
1613
+ }
1614
+
1615
+ function generateWrapperCheck(doc: Doc, ctx: CompileContext, schema: SomeType, accessor: string): string {
1616
+ const def = schema._zod.def as unknown as { innerType: SomeType };
1617
+ return generateCheck(doc, ctx, def.innerType, accessor);
1618
+ }
1619
+
1620
+ function generateDefaultCheck(doc: Doc, ctx: CompileContext, schema: SomeType, accessor: string): string {
1621
+ const def = schema._zod.def as unknown as { innerType: SomeType };
1622
+
1623
+ // `defaultValue` is an accessor on schemas built through the classic/mini
1624
+ // factories and a plain data property on ones rebuilt programmatically
1625
+ // (deepPartial and friends). Read it off the def either way — taking only
1626
+ // `descriptor.get` silently dropped the default for the second kind, so
1627
+ // `.default(v)` compiled to `undefined` instead of `v`.
1628
+ const descriptor = Object.getOwnPropertyDescriptor(schema._zod.def, "defaultValue");
1629
+ const defaultGetter = descriptor
1630
+ ? () => (schema._zod.def as unknown as { defaultValue: unknown }).defaultValue
1631
+ : undefined;
1632
+
1633
+ // prefault differs from default: undefined-input is first replaced with the prefault value, then run through the inner schema.
1634
+ if (schema._zod.def.type === "prefault") {
1635
+ if (!defaultGetter) {
1636
+ return generateCheck(doc, ctx, def.innerType, accessor);
1637
+ }
1638
+ const defaultFn = addConstant(ctx, defaultGetter);
1639
+ const inputVar = newVar(ctx);
1640
+ doc.write(`let ${inputVar} = ${accessor};`);
1641
+ doc.write(`if (${accessor} === undefined) ${inputVar} = ${defaultFn}();`);
1642
+ return generateCheck(doc, ctx, def.innerType, inputVar);
1643
+ }
1644
+
1645
+ const outputVar = newVar(ctx);
1646
+
1647
+ // Default allows undefined (replaces with default value), otherwise validates inner type
1648
+ if (defaultGetter) {
1649
+ const defaultFn = addConstant(ctx, defaultGetter);
1650
+ const cloneFn = addConstant(ctx, util.shallowClone);
1651
+ doc.write(`let ${outputVar};`);
1652
+ doc.write(`if (${accessor} === undefined) {`);
1653
+ doc.indented((d) => {
1654
+ // Shallow-clone the default so callers can mutate the result without affecting subsequent parses (#5855 — also covers Map/Set).
1655
+ d.write(`${outputVar} = ${cloneFn}(${defaultFn}());`);
1656
+ });
1657
+ doc.write(`} else {`);
1658
+ doc.indented((d) => {
1659
+ const innerOutput = generateCheck(d, ctx, def.innerType, accessor);
1660
+ d.write(`${outputVar} = ${innerOutput} === undefined ? ${cloneFn}(${defaultFn}()) : ${innerOutput};`);
1661
+ });
1662
+ doc.write(`}`);
1663
+ } else {
1664
+ doc.write(`let ${outputVar};`);
1665
+ doc.write(`if (${accessor} !== undefined) {`);
1666
+ doc.indented((d) => {
1667
+ const innerOutput = generateCheck(d, ctx, def.innerType, accessor);
1668
+ d.write(`${outputVar} = ${innerOutput};`);
1669
+ });
1670
+ doc.write(`}`);
1671
+ }
1672
+
1673
+ return outputVar;
1674
+ }
1675
+
1676
+ function generateNonOptionalCheck(doc: Doc, ctx: CompileContext, schema: SomeType, accessor: string): string {
1677
+ const def = schema._zod.def as unknown as { innerType: SomeType };
1678
+ // The runtime inspects what the inner produced, not what it was given: a catch can turn a defined input into undefined, a default an absent one into a value.
1679
+ const innerOutput = generateCheck(doc, ctx, def.innerType, accessor);
1680
+ const outputVar = newVar(ctx);
1681
+ doc.write(`const ${outputVar} = ${innerOutput};`);
1682
+ doc.write(`if (${outputVar} === undefined) return INVALID;`);
1683
+ return outputVar;
1684
+ }
1685
+
1686
+ function generateTupleCheck(doc: Doc, ctx: CompileContext, schema: SomeType, accessor: string): string {
1687
+ const def = schema._zod.def as unknown as { items: SomeType[]; rest: SomeType | null };
1688
+ const items = def.items;
1689
+ const rest = def.rest;
1690
+
1691
+ doc.write(`if (!Array.isArray(${accessor})) return INVALID;`);
1692
+
1693
+ // Mirror the runtime's getTupleOptStart: find the first index where every subsequent slot accepts `undefined` (i.e. is optional on input). Anything shorter than this is too_small; trailing absent slots are legal.
1694
+ const optinStart = getTupleOptStart(items, "optin");
1695
+ const optoutStart = getTupleOptStart(items, "optout");
1696
+
1697
+ // Length bounds
1698
+ if (rest) {
1699
+ // With rest: minimum length is the last required input slot
1700
+ doc.write(`if (${accessor}.length < ${optinStart}) return INVALID;`);
1701
+ } else {
1702
+ // No rest: input must be in [optinStart, items.length]
1703
+ doc.write(`if (${accessor}.length < ${optinStart} || ${accessor}.length > ${items.length}) return INVALID;`);
1704
+ }
1705
+
1706
+ // Build the output in assignment order so absent optional-output tail slots can truncate while default/prefault slots still fill missing positions.
1707
+ const outputVar = newVar(ctx);
1708
+ doc.write(`const ${outputVar} = [];`);
1709
+
1710
+ // Validate and collect each fixed item
1711
+ for (let i = 0; i < items.length; i++) {
1712
+ const itemSchema = items[i]!;
1713
+ if (i >= optoutStart) {
1714
+ doc.write(`if (${outputVar}.length === ${i}) {`);
1715
+ doc.indented((d) => {
1716
+ d.write(`if (${i} < ${accessor}.length) {`);
1717
+ d.indented((d2) => {
1718
+ const elemVar = newVar(ctx);
1719
+ d2.write(`const ${elemVar} = ${accessor}[${i}];`);
1720
+ const elemOutput = compileChild(d2, ctx, itemSchema, elemVar);
1721
+ d2.write(`${outputVar}[${i}] = ${elemOutput};`);
1722
+ });
1723
+ d.write(`} else {`);
1724
+ d.indented((d2) => {
1725
+ // Middle rung: absence supplies nothing in its place, so truncate rather than running the item on `undefined` and keeping what it invents. Mirrors the leading gate in `handleTupleResults`.
1726
+ if (dropsWhenAbsent(itemSchema)) {
1727
+ d2.write(`${outputVar}.length = ${i};`);
1728
+ return;
1729
+ }
1730
+ const elemVar = newVar(ctx);
1731
+ const branchVar = newVar(ctx);
1732
+ d2.write(`const ${elemVar} = undefined;`);
1733
+ d2.write(`const ${branchVar} = (() => {`);
1734
+ d2.indented((d3) => {
1735
+ const elemOutput = compileChild(d3, ctx, itemSchema, elemVar);
1736
+ d3.write(`return ${elemOutput};`);
1737
+ });
1738
+ d2.write(`})();`);
1739
+ d2.write(`if (${branchVar} === INVALID || ${branchVar} === undefined) ${outputVar}.length = ${i};`);
1740
+ d2.write(`else ${outputVar}[${i}] = ${branchVar};`);
1741
+ });
1742
+ d.write(`}`);
1743
+ });
1744
+ doc.write(`}`);
1745
+ } else {
1746
+ const elemVar = newVar(ctx);
1747
+ doc.write(`const ${elemVar} = ${accessor}[${i}];`);
1748
+ const elemOutput = compileChild(doc, ctx, itemSchema, elemVar);
1749
+ doc.write(`${outputVar}[${i}] = ${elemOutput};`);
1750
+ }
1751
+ }
1752
+
1753
+ // Validate and collect rest elements if present
1754
+ if (rest) {
1755
+ const iVar = newVar(ctx);
1756
+ const elemVar = newVar(ctx);
1757
+ doc.write(`for (let ${iVar} = ${items.length}; ${iVar} < ${accessor}.length; ${iVar}++) {`);
1758
+ doc.indented((d) => {
1759
+ d.write(`const ${elemVar} = ${accessor}[${iVar}];`);
1760
+ const elemOutput = compileChild(d, ctx, rest, elemVar);
1761
+ d.write(`${outputVar}[${iVar}] = ${elemOutput};`);
1762
+ });
1763
+ doc.write(`}`);
1764
+ }
1765
+
1766
+ return outputVar;
1767
+ }
1768
+
1769
+ function getTupleOptStart(items: SomeType[], key: "optin" | "optout"): number {
1770
+ for (let i = items.length - 1; i >= 0; i--) {
1771
+ // Mirrors the runtime: optin is a three-rung ladder so any rung above `undefined` permits an absent slot; optout stays two-valued.
1772
+ const omittable = key === "optin" ? items[i]!._zod.optin !== undefined : items[i]!._zod.optout === "optional";
1773
+ if (!omittable) return i + 1;
1774
+ }
1775
+ return 0;
1776
+ }
1777
+
1778
+ function generateUnionCheck(doc: Doc, ctx: CompileContext, schema: SomeType, accessor: string): string {
1779
+ const def = schema._zod.def as unknown as {
1780
+ options: SomeType[];
1781
+ inclusive?: boolean;
1782
+ discriminator?: string;
1783
+ unionFallback?: boolean;
1784
+ };
1785
+ const options = def.options;
1786
+
1787
+ if (def.discriminator) {
1788
+ return generateDiscriminatedUnionCheck(
1789
+ doc,
1790
+ ctx,
1791
+ def as { options: SomeType[]; discriminator: string; unionFallback?: boolean },
1792
+ accessor
1793
+ );
1794
+ }
1795
+
1796
+ // z.xor requires *exactly one* option to match. Match-counting in the fast path is only sound if every branch is exactly as strict as the runtime — any falsely-rejecting branch silently turns a multi-match rejection into an accept. Force the runtime for this rare combinator.
1797
+ if (def.inclusive === false) {
1798
+ throw new ZodCompileUnsupportedError("exclusive unions (z.xor)");
1799
+ }
1800
+
1801
+ if (options.length === 0) {
1802
+ doc.write("return INVALID;");
1803
+ return accessor;
1804
+ }
1805
+
1806
+ if (options.length === 1) {
1807
+ return generateCheck(doc, ctx, options[0]!, accessor);
1808
+ }
1809
+
1810
+ // Check if all options are bare literals - use Set optimization. A literal option carrying checks (e.g. .refine) must take the general path or the Set would accept values its checks reject.
1811
+ const allLiterals = options.every(
1812
+ (opt) => opt._zod.def.type === "literal" && !(opt._zod.def.checks as unknown[] | undefined)?.length
1813
+ );
1814
+ if (allLiterals) {
1815
+ const values = new Set(options.flatMap((opt) => (opt._zod.def as unknown as { values: unknown[] }).values));
1816
+ const valuesConst = addConstant(ctx, values);
1817
+ doc.write(`if (!${valuesConst}.has(${accessor})) return INVALID;`);
1818
+ return accessor;
1819
+ }
1820
+
1821
+ // General case: try each option until one succeeds Use IIFEs that return the output or INVALID
1822
+ const outputVar = newVar(ctx);
1823
+ doc.write(`let ${outputVar};`);
1824
+
1825
+ for (let i = 0; i < options.length; i++) {
1826
+ const opt = options[i]!;
1827
+
1828
+ if (i === 0) {
1829
+ doc.write(`${outputVar} = (() => {`);
1830
+ } else {
1831
+ doc.write(`if (${outputVar} === INVALID) ${outputVar} = (() => {`);
1832
+ }
1833
+
1834
+ doc.indented((d) => {
1835
+ // Generate check inside IIFE - returns INVALID on failure
1836
+ const branchOutput = generateCheck(d, ctx, opt, accessor);
1837
+ d.write(`return ${branchOutput};`);
1838
+ });
1839
+ doc.write(`})();`);
1840
+ }
1841
+
1842
+ doc.write(`if (${outputVar} === INVALID) return INVALID;`);
1843
+ return outputVar;
1844
+ }
1845
+
1846
+ function generateDiscriminatedUnionCheck(
1847
+ doc: Doc,
1848
+ ctx: CompileContext,
1849
+ def: { options: SomeType[]; discriminator: string; unionFallback?: boolean },
1850
+ accessor: string
1851
+ ): string {
1852
+ if (def.unionFallback) {
1853
+ throw new ZodCompileUnsupportedError("discriminated union with unionFallback");
1854
+ }
1855
+
1856
+ if (def.options.length === 0) {
1857
+ doc.write("return INVALID;");
1858
+ return accessor;
1859
+ }
1860
+
1861
+ const discVar = newVar(ctx);
1862
+ const outputVar = newVar(ctx);
1863
+ doc.write(`const ${discVar} = ${accessor}?.[${util.esc(def.discriminator)}];`);
1864
+ doc.write(`let ${outputVar};`);
1865
+
1866
+ let firstBranch = true;
1867
+ const claimed = new Set<util.Primitive>();
1868
+ for (const option of def.options) {
1869
+ const values = option._zod.propValues?.[def.discriminator];
1870
+ if (!values || values.size === 0) {
1871
+ throw new ZodCompileUnsupportedError("discriminated union option without static discriminator values");
1872
+ }
1873
+
1874
+ // let the interpreter handle collisions instead of compiling first-match dispatch
1875
+ for (const value of values) {
1876
+ if (claimed.has(value)) {
1877
+ throw new ZodCompileUnsupportedError(`duplicate discriminator value ${String(value)}`);
1878
+ }
1879
+ claimed.add(value);
1880
+ }
1881
+
1882
+ const conditions = Array.from(values, (value) => literalEquality(ctx, discVar, value));
1883
+ const prefix = firstBranch ? "if" : "else if";
1884
+ doc.write(`${prefix} (${conditions.join(" || ")}) {`);
1885
+ doc.indented((d) => {
1886
+ const branchOutput = generateCheck(d, ctx, option, accessor);
1887
+ d.write(`${outputVar} = ${branchOutput};`);
1888
+ });
1889
+ doc.write(`}`);
1890
+ firstBranch = false;
1891
+ }
1892
+
1893
+ doc.write(`else { return INVALID; }`);
1894
+ return outputVar;
1895
+ }
1896
+
1897
+ function literalEquality(ctx: CompileContext, accessor: string, value: unknown): string {
1898
+ if (typeof value === "string") return `${accessor} === ${util.esc(value)}`;
1899
+ if (typeof value === "number") {
1900
+ if (Number.isNaN(value)) return `Number.isNaN(${accessor})`;
1901
+ return `${accessor} === ${value}`;
1902
+ }
1903
+ if (typeof value === "boolean") return `${accessor} === ${value}`;
1904
+ if (value === null) return `${accessor} === null`;
1905
+ if (value === undefined) return `${accessor} === undefined`;
1906
+ if (typeof value === "bigint") return `${accessor} === ${value}n`;
1907
+ if (typeof value === "symbol") {
1908
+ const symbolConst = addConstant(ctx, value);
1909
+ return `${accessor} === ${symbolConst}`;
1910
+ }
1911
+ throw new ZodCompileUnsupportedError(`literal discriminator value ${String(value)}`);
1912
+ }
1913
+
1914
+ function generateIntersectionCheck(doc: Doc, ctx: CompileContext, schema: SomeType, accessor: string): string {
1915
+ const def = schema._zod.def as unknown as { left: SomeType; right: SomeType };
1916
+ // An unmergeable merge, and a child failing before the merge is even reached, both return INVALID for a case the interpreter answers with a throw.
1917
+ ctx.definite = false;
1918
+ const leftOutput = compileChild(doc, ctx, def.left, accessor);
1919
+ const rightOutput = compileChild(doc, ctx, def.right, accessor);
1920
+
1921
+ // Hoist the runtime merge helper so recursive object/array merge semantics stay in one place. If the merge is invalid, return INVALID and let the runtime fallback construct canonical errors.
1922
+ const mergeConst = addConstant(ctx, mergeValues);
1923
+ const mergedVar = newVar(ctx);
1924
+ doc.write(`const ${mergedVar} = ${mergeConst}(${leftOutput}, ${rightOutput});`);
1925
+ doc.write(`if (!${mergedVar}.valid) return INVALID;`);
1926
+ return `${mergedVar}.data`;
1927
+ }
1928
+
1929
+ function generateRecordCheck(doc: Doc, ctx: CompileContext, schema: SomeType, accessor: string): string {
1930
+ const def = schema._zod.def as unknown as { keyType: SomeType; valueType: SomeType };
1931
+
1932
+ // Use util.isPlainObject (rejects Date, Map, Set, class instances, etc.) to match runtime behavior. Hoisted call instead of inline so this stays a single source of truth with the runtime parser.
1933
+ const isPlainObjectConst = addConstant(ctx, util.isPlainObject);
1934
+ doc.write(`if (!${isPlainObjectConst}(${accessor})) return INVALID;`);
1935
+
1936
+ const outputVar = newVar(ctx);
1937
+ const kVar = newVar(ctx);
1938
+ const valVar = newVar(ctx);
1939
+
1940
+ doc.write(`const ${outputVar} = {};`);
1941
+
1942
+ // Exhaustive record. The runtime gates this on `values && !def.partial`, since z.partialRecord keeps its value set but makes every key optional; a loose record passes unrecognized keys through, which the per-key scan cannot express.
1943
+ const recordDef = def as unknown as { mode?: string; partial?: boolean };
1944
+ const keyValues = recordDef.partial ? undefined : (def.keyType._zod as unknown as { values?: Set<unknown> }).values;
1945
+ if (keyValues) {
1946
+ const inputKeys: Array<string | symbol> = [];
1947
+ for (const key of keyValues) {
1948
+ if (!(typeof key === "string" || typeof key === "number" || typeof key === "symbol")) {
1949
+ throw new ZodCompileUnsupportedError(`record key value ${String(key)}`);
1950
+ }
1951
+
1952
+ const inputKey = typeof key === "number" ? key.toString() : key;
1953
+ if (inputKey === "__proto__") {
1954
+ // `out["__proto__"] = v` would hit the prototype setter on the output.
1955
+ throw new ZodCompileUnsupportedError('record key "__proto__"');
1956
+ }
1957
+ inputKeys.push(inputKey);
1958
+
1959
+ const keyConst = addConstant(ctx, key);
1960
+ const outKey = generateCheck(doc, ctx, def.keyType, keyConst);
1961
+ // Read the property once. Passing the raw expression let compileChild validate one read while the output write performed a second, so a getter could hand back a value nothing had checked.
1962
+ const valueVar = newVar(ctx);
1963
+ doc.write(`const ${valueVar} = ${accessor}[${literalPropertyKey(ctx, inputKey)}];`);
1964
+ const valOutput = compileChild(doc, ctx, def.valueType, valueVar);
1965
+ doc.write(`${outputVar}[${outKey}] = ${valOutput};`);
1966
+ }
1967
+
1968
+ // `mode: "loose"` changes only what happens to unrecognized keys, so it belongs here rather than the per-present-key scan. Passing them through matches the runtime, which skips `__proto__`.
1969
+ const knownKeysConst = addConstant(ctx, new Set(inputKeys));
1970
+ doc.write(`for (const ${kVar} in ${accessor}) {`);
1971
+ doc.indented((d) => {
1972
+ d.write(`if (${knownKeysConst}.has(${kVar})) continue;`);
1973
+ if (recordDef.mode === "loose") {
1974
+ d.write(`if (${kVar} !== "__proto__") ${outputVar}[${kVar}] = ${accessor}[${kVar}];`);
1975
+ } else {
1976
+ d.write(`return INVALID;`);
1977
+ }
1978
+ });
1979
+ doc.write(`}`);
1980
+ return outputVar;
1981
+ }
1982
+
1983
+ // The bare-string shortcut below only tests `typeof key === "string"`, so it
1984
+ // is correct exclusively for a `z.string()` carrying nothing else. A string
1985
+ // *format* lives on the def rather than in `checks` — `z.record(z.email(), …)`
1986
+ // reads as a plain string here — and coercion rewrites the key, so both have
1987
+ // to take the general path or the shortcut accepts keys the runtime rejects.
1988
+ const keyDef = def.keyType._zod.def as { type: string; format?: string; coerce?: boolean; checks?: unknown[] };
1989
+ const keyIsBareString =
1990
+ keyDef.type === "string" && keyDef.format === undefined && !keyDef.coerce && (keyDef.checks?.length ?? 0) === 0;
1991
+ if (!keyIsBareString) {
1992
+ // A key schema with no value set is a constraint every key must satisfy
1993
+ // (`z.email()`, `z.string().min(3)`, `z.number()`, a template literal).
1994
+ // The runtime runs it against each own enumerable key and writes the value
1995
+ // under the key it produced, so compile it once and call it per key.
1996
+ const isLoose = (def as { mode?: string }).mode === "loose";
1997
+ // the key compiles in its own context, so carry its verdict out: a key schema that can answer INVALID undecidably makes this validator undecidable too
1998
+ const keyFn = compileFn(def.keyType);
1999
+ if (keyFn.definite === false) ctx.definite = false;
2000
+ const keyFast = addConstant(ctx, keyFn);
2001
+ const numericConst = addConstant(ctx, regexes.number);
2002
+ const outKeyVar = newVar(ctx);
2003
+
2004
+ // the body runs once per string key and once per symbol key, since a key schema can accept symbols
2005
+ emitOwnKeys(doc, ctx, accessor, kVar, (d) => {
2006
+ d.write(`let ${outKeyVar} = ${keyFast}(${kVar});`);
2007
+ // Numeric-string retry, mirroring the runtime: a key the schema rejects as a string is tried again as a number, so z.record(z.number(), …) matches the numeric keys JavaScript stringified on the way in.
2008
+ d.write(
2009
+ `if (${outKeyVar} === INVALID && typeof ${kVar} === "string" && ${numericConst}.test(${kVar})) ${outKeyVar} = ${keyFast}(Number(${kVar}));`
2010
+ );
2011
+ if (isLoose) {
2012
+ // A loose record keeps a key its schema rejects, copying the value across unvalidated rather than failing the parse.
2013
+ d.write(`if (${outKeyVar} === INVALID) { ${outputVar}[${kVar}] = ${accessor}[${kVar}]; continue; }`);
2014
+ } else {
2015
+ d.write(`if (${outKeyVar} === INVALID) return INVALID;`);
2016
+ }
2017
+ // The guard above tested the input key, but the schema can normalize an ordinary key into __proto__; re-check the one actually written under.
2018
+ d.write(`if (${outKeyVar} === "__proto__") continue;`);
2019
+ // Read once: the raw expression would be evaluated again by the output write below, so an accessor could return an unvalidated second value.
2020
+ const valueVar = newVar(ctx);
2021
+ d.write(`const ${valueVar} = ${accessor}[${kVar}];`);
2022
+ const valOutput = compileChild(d, ctx, def.valueType, valueVar);
2023
+ d.write(`${outputVar}[${outKeyVar}] = ${valOutput};`);
2024
+ });
2025
+ return outputVar;
2026
+ }
2027
+
2028
+ // Plain z.string() keys: every own enumerable string key's value is validated, and an own enumerable symbol key fails the string key schema, as it does in the runtime's Reflect.ownKeys walk.
2029
+ emitOwnKeys(
2030
+ doc,
2031
+ ctx,
2032
+ accessor,
2033
+ kVar,
2034
+ (d) => {
2035
+ d.write(`const ${valVar} = ${accessor}[${kVar}];`);
2036
+ const valOutput = compileChild(d, ctx, def.valueType, valVar);
2037
+ d.write(`${outputVar}[${kVar}] = ${valOutput};`);
2038
+ },
2039
+ `return INVALID;`
2040
+ );
2041
+
2042
+ return outputVar;
2043
+ }
2044
+
2045
+ // Walks the own enumerable keys of a plain object in Reflect.ownKeys order — strings from getOwnPropertyNames, then symbols — instead of Reflect.ownKeys, whose accumulator made that walk 3–6x the cost of the loop it fed. Both snapshots are taken before any value is read and every key is rechecked with propertyIsEnumerable when visited, exactly the runtime's walk, so a getter that adds, deletes, hides or reveals a key mid-walk sees the runtime's verdict; for-in and Object.keys were no faster and each lost a case (for-in enumerates the prototype chain after the own keys, Object.keys drops a key that is non-enumerable at snapshot time). `body` is written once for the string loop and once for the symbol loop unless `onSymbol` replaces the latter.
2046
+ function emitOwnKeys(
2047
+ doc: Doc,
2048
+ ctx: CompileContext,
2049
+ accessor: string,
2050
+ kVar: string,
2051
+ body: (d: Doc) => void,
2052
+ onSymbol?: string
2053
+ ): void {
2054
+ const propIsEnumerableConst = addConstant(ctx, Object.prototype.propertyIsEnumerable);
2055
+ const symsVar = newVar(ctx);
2056
+ const keysVar = newVar(ctx);
2057
+ const iVar = newVar(ctx);
2058
+ doc.write(`const ${symsVar} = Object.getOwnPropertySymbols(${accessor});`);
2059
+ doc.write(`const ${keysVar} = Object.getOwnPropertyNames(${accessor});`);
2060
+ doc.write(`for (let ${iVar} = 0; ${iVar} < ${keysVar}.length; ${iVar}++) {`);
2061
+ doc.indented((d) => {
2062
+ d.write(`const ${kVar} = ${keysVar}[${iVar}];`);
2063
+ d.write(`if (${kVar} === "__proto__" || !${propIsEnumerableConst}.call(${accessor}, ${kVar})) continue;`);
2064
+ body(d);
2065
+ });
2066
+ doc.write(`}`);
2067
+ doc.write(`for (let ${iVar} = 0; ${iVar} < ${symsVar}.length; ${iVar}++) {`);
2068
+ doc.indented((d) => {
2069
+ d.write(`const ${kVar} = ${symsVar}[${iVar}];`);
2070
+ d.write(`if (!${propIsEnumerableConst}.call(${accessor}, ${kVar})) continue;`);
2071
+ if (onSymbol) d.write(onSymbol);
2072
+ else body(d);
2073
+ });
2074
+ doc.write(`}`);
2075
+ }
2076
+
2077
+ function literalPropertyKey(ctx: CompileContext, key: string | symbol): string {
2078
+ if (typeof key === "string") return util.esc(key);
2079
+ return addConstant(ctx, key);
2080
+ }
2081
+
2082
+ function generateMapCheck(doc: Doc, ctx: CompileContext, schema: SomeType, accessor: string): string {
2083
+ const def = schema._zod.def as unknown as { keyType: SomeType; valueType: SomeType };
2084
+
2085
+ doc.write(`if (!(${accessor} instanceof Map)) return INVALID;`);
2086
+
2087
+ const outputVar = newVar(ctx);
2088
+ const kVar = newVar(ctx);
2089
+ const valVar = newVar(ctx);
2090
+
2091
+ doc.write(`const ${outputVar} = new Map();`);
2092
+ doc.write(`for (const [${kVar}, ${valVar}] of ${accessor}) {`);
2093
+ doc.indented((d) => {
2094
+ const keyOutput = generateCheck(d, ctx, def.keyType, kVar);
2095
+ const valOutput = generateCheck(d, ctx, def.valueType, valVar);
2096
+ d.write(`${outputVar}.set(${keyOutput}, ${valOutput});`);
2097
+ });
2098
+ doc.write(`}`);
2099
+
2100
+ return outputVar;
2101
+ }
2102
+
2103
+ function generateSetCheck(doc: Doc, ctx: CompileContext, schema: SomeType, accessor: string): string {
2104
+ const def = schema._zod.def as unknown as { valueType: SomeType };
2105
+
2106
+ doc.write(`if (!(${accessor} instanceof Set)) return INVALID;`);
2107
+
2108
+ const outputVar = newVar(ctx);
2109
+ const valVar = newVar(ctx);
2110
+
2111
+ doc.write(`const ${outputVar} = new Set();`);
2112
+ doc.write(`for (const ${valVar} of ${accessor}) {`);
2113
+ doc.indented((d) => {
2114
+ const valOutput = generateCheck(d, ctx, def.valueType, valVar);
2115
+ d.write(`${outputVar}.add(${valOutput});`);
2116
+ });
2117
+ doc.write(`}`);
2118
+
2119
+ return outputVar;
2120
+ }
2121
+
2122
+ function generateFileCheck(doc: Doc, accessor: string): string {
2123
+ // Runtime $ZodFile is a bare `instanceof File`, including the implicit global lookup. The previous duck-typed fallback accepted arbitrary {name, size} objects in File-less environments — behavior the runtime never had.
2124
+ doc.write(`if (!(${accessor} instanceof File)) return INVALID;`);
2125
+ return accessor;
2126
+ }
2127
+
2128
+ function generateTemplateLiteralCheck(doc: Doc, ctx: CompileContext, schema: SomeType, accessor: string): string {
2129
+ doc.write(`if (typeof ${accessor} !== "string") return INVALID;`);
2130
+
2131
+ // Template literal schemas have a pre-computed pattern in _zod.pattern
2132
+ const pattern = (schema._zod as unknown as { pattern: RegExp }).pattern;
2133
+ if (pattern) {
2134
+ const patternConst = addConstant(ctx, pattern);
2135
+ doc.write(`${patternConst}.lastIndex = 0;`);
2136
+ doc.write(`if (!${patternConst}.test(${accessor})) return INVALID;`);
2137
+ }
2138
+ return accessor;
2139
+ }
2140
+
2141
+ function generateLazyCheck(doc: Doc, ctx: CompileContext, schema: SomeType, accessor: string): string {
2142
+ // For lazy schemas, we use a cached parser that falls back to runtime Zod parsing This handles recursive schemas correctly by avoiding infinite compilation loops
2143
+ const def = schema._zod.def as unknown as { getter: () => SomeType };
2144
+ const getterConst = addUserConstant(ctx, def.getter);
2145
+ const cacheConst = addConstant(ctx, { parser: null as ((input: unknown) => unknown) | null });
2146
+
2147
+ doc.write(`if (!${cacheConst}.parser) {`);
2148
+ doc.indented((d) => {
2149
+ d.write(`const inner = ${getterConst}();`);
2150
+ d.write(`${cacheConst}.parser = function(input) {`);
2151
+ d.indented((d2) => {
2152
+ // Use runtime Zod parsing - this correctly handles recursive schemas Pass an empty ctx like runtimeRun does — runtime parsers read ctx.skipChecks/ctx.direction unconditionally and crash on undefined.
2153
+ d2.write(`const result = inner._zod.run({ value: input, issues: [] }, {});`);
2154
+ d2.write(`return result.issues.length === 0 ? result.value : INVALID;`);
2155
+ });
2156
+ d.write(`};`);
2157
+ });
2158
+ doc.write(`}`);
2159
+
2160
+ const outputVar = newVar(ctx);
2161
+ doc.write(`const ${outputVar} = ${cacheConst}.parser(${accessor});`);
2162
+ doc.write(`if (${outputVar} === INVALID) return INVALID;`);
2163
+ return outputVar;
2164
+ }
2165
+
2166
+ function generatePipeCheck(doc: Doc, ctx: CompileContext, schema: SomeType, accessor: string): string {
2167
+ const def = schema._zod.def as unknown as {
2168
+ in: SomeType;
2169
+ out: SomeType;
2170
+ transform?: (value: unknown, payload: unknown) => unknown;
2171
+ };
2172
+
2173
+ // Validate input type first
2174
+ const inputOutput = generateCheck(doc, ctx, def.in, accessor);
2175
+
2176
+ if (def.transform) {
2177
+ // Apply transform and validate output. The transform may read its second `payload` argument (codec transforms like z.stringbool() push issues there) so wrap the call in a helper that spoofs a payload. Pushed issues signal INVALID and the wrapper falls back to the runtime, and a plain function handing back a promise answers INVALID too — union parity, but not a decidable rejection at the top level.
2178
+ if (isAsyncFunction(def.transform)) {
2179
+ throw new ZodCompileAsyncError("z.compile: async transforms in pipes are not supported");
2180
+ }
2181
+ const transformFn = def.transform;
2182
+ const helperFn = (value: unknown): unknown => {
2183
+ // `addIssue` has to be here: a transform reporting through it is reporting, not failing. Without it the call threw a TypeError that the old catch swallowed into a fallback, so every ctx.addIssue transform quietly lost its fast path and the real error was never visible.
2184
+ const fakePayload = { value, issues: [] as unknown[], addIssue: pushIssue };
2185
+ // A throw is deliberately not caught. The interpreter lets one propagate out of the whole parse; swallowing it into INVALID turned a thrown error into a merely-rejected union branch, so a later branch answered instead.
2186
+ const result = transformFn(value, fakePayload as any);
2187
+ if (result instanceof Promise) return INVALID;
2188
+ return fakePayload.issues.length === 0 ? result : INVALID;
2189
+ };
2190
+ const helperConst = addUserConstant(ctx, helperFn);
2191
+ const transformedVar = newVar(ctx);
2192
+ doc.write(`const ${transformedVar} = ${helperConst}(${inputOutput});`);
2193
+ doc.write(`if (${transformedVar} === INVALID) return INVALID;`);
2194
+ return generateCheck(doc, ctx, def.out, transformedVar);
2195
+ } else {
2196
+ // No transform - validate output type on same value
2197
+ return generateCheck(doc, ctx, def.out, inputOutput);
2198
+ }
2199
+ }
2200
+
2201
+ function isAsyncFunction(fn: unknown): boolean {
2202
+ return (
2203
+ typeof fn === "function" &&
2204
+ (fn.constructor.name === "AsyncFunction" ||
2205
+ (fn as { [Symbol.toStringTag]?: string })[Symbol.toStringTag] === "AsyncFunction")
2206
+ );
2207
+ }
2208
+
2209
+ function generateCustomCheck(doc: Doc, ctx: CompileContext, schema: SomeType, accessor: string): string {
2210
+ const def = schema._zod.def as unknown as { fn?: (value: unknown) => boolean };
2211
+
2212
+ if (def.fn) {
2213
+ // Check for async function
2214
+ if (isAsyncFunction(def.fn)) {
2215
+ throw new ZodCompileAsyncError("z.compile: async custom predicates are not supported");
2216
+ }
2217
+ // Custom schema with a predicate function (e.g. z.instanceof). `isAsyncFunction` above is syntactic, so a plain function returning a promise reaches here, and a promise is truthy — it would read as a pass where the interpreter throws.
2218
+ const fnConst = addUserConstant(ctx, def.fn);
2219
+ const throwAsyncConst = addConstant(ctx, throwAsync);
2220
+ const resVar = newVar(ctx);
2221
+ doc.write(`const ${resVar} = ${fnConst}(${accessor});`);
2222
+ doc.write(`if (${resVar} instanceof Promise) ${throwAsyncConst}();`);
2223
+ doc.write(`if (!${resVar}) return INVALID;`);
2224
+ } else {
2225
+ throw new ZodCompileUnsupportedError("custom schema without a predicate function");
2226
+ }
2227
+ return accessor;
2228
+ }
2229
+
2230
+ // Runtime helper for a compiled `catch`: runs the inner schema once and returns its value when it succeeded. Anything else — a failure the catch would handle, or an async inner — returns INVALID so the interpreter takes over.
2231
+ function runtimeCatch(innerSchema: SomeType, catchValue: () => unknown, value: unknown): unknown {
2232
+ const result = (innerSchema._zod.run as (p: ParsePayload, c: ParseContextInternal) => any)(
2233
+ { value, issues: [] },
2234
+ {} as ParseContextInternal
2235
+ );
2236
+ if (result && typeof (result as Promise<unknown>).then === "function") return INVALID;
2237
+ const r = result as { value: unknown; issues: any[] };
2238
+ if (r.issues.length === 0) return r.value;
2239
+ // Only reached for a catch value that ignores the parse context — codegen refuses the rest — so there are no issues to finalize and nothing here needs the caller's error map.
2240
+ return catchValue();
2241
+ }
2242
+
2243
+ function generateCatchCheck(doc: Doc, ctx: CompileContext, schema: SomeType, accessor: string): string {
2244
+ const def = schema._zod.def as unknown as {
2245
+ innerType: SomeType;
2246
+ catchValue: (ctx: any) => unknown;
2247
+ };
2248
+
2249
+ // An untagged catchValue is a user callback, and one reading `ctx.error` needs the caller's per-parse error map. Catch *succeeds*, so a wrong message there is unobservable — refuse at codegen, and not islandable either, since `runtimeRun` has no context to hand it.
2250
+ if (!(def.catchValue as { [util.CONSTANT_CATCH]?: boolean })[util.CONSTANT_CATCH]) {
2251
+ throw new ZodCompileUnsupportedError("catch with a callback (only a constant catch value compiles)", false);
2252
+ }
2253
+
2254
+ const outputVar = newVar(ctx);
2255
+ doc.write(`let ${outputVar} = (() => {`);
2256
+ doc.indented((d) => {
2257
+ const innerOut = compileChild(d, ctx, def.innerType, accessor);
2258
+ d.write(`return ${innerOut};`);
2259
+ });
2260
+ doc.write(`})();`);
2261
+
2262
+ const innerConst = addConstant(ctx, def.innerType);
2263
+ const catchConst = addUserConstant(ctx, def.catchValue);
2264
+ const catchHelperConst = addConstant(ctx, runtimeCatch);
2265
+ doc.write(`if (${outputVar} === INVALID) {`);
2266
+ doc.indented((d) => {
2267
+ d.write(`${outputVar} = ${catchHelperConst}(${innerConst}, ${catchConst}, ${accessor});`);
2268
+ d.write(`if (${outputVar} === INVALID) return INVALID;`);
2269
+ });
2270
+ doc.write(`}`);
2271
+ return outputVar;
2272
+ }
2273
+
2274
+ function generateTransformCheck(doc: Doc, ctx: CompileContext, schema: SomeType, accessor: string): string {
2275
+ const def = schema._zod.def as unknown as {
2276
+ transform: (value: unknown, payload: unknown) => unknown;
2277
+ };
2278
+
2279
+ if (def.transform) {
2280
+ // Check for async transform
2281
+ if (isAsyncFunction(def.transform)) {
2282
+ throw new ZodCompileAsyncError("z.compile: async transforms are not supported");
2283
+ }
2284
+
2285
+ // Create a helper that runs the transform and returns the result or INVALID on error
2286
+ const transformFn = def.transform;
2287
+ const helperFn = (value: unknown): unknown => {
2288
+ const fakePayload = { value, issues: [] as unknown[], addIssue: pushIssue };
2289
+ // As in the pipe helper: a throw propagates, because the interpreter lets it out of the whole parse rather than treating it as a failed branch.
2290
+ const result = transformFn(value, fakePayload);
2291
+ if (result instanceof Promise) return INVALID;
2292
+ return fakePayload.issues.length === 0 ? result : INVALID;
2293
+ };
2294
+ const helperConst = addUserConstant(ctx, helperFn);
2295
+ const outputVar = newVar(ctx);
2296
+ doc.write(`const ${outputVar} = ${helperConst}(${accessor});`);
2297
+ doc.write(`if (${outputVar} === INVALID) return INVALID;`);
2298
+ return outputVar;
2299
+ }
2300
+
2301
+ return accessor;
2302
+ }