@btc-embedded/cdk-extensions 0.10.1 → 0.10.3

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 (386) hide show
  1. package/.jsii +5 -5
  2. package/CHANGELOG.md +9 -0
  3. package/lib/constructs/EventPipe.js +1 -1
  4. package/lib/constructs/S3Bucket.js +1 -1
  5. package/lib/constructs/SecureRestApi.js +1 -1
  6. package/lib/constructs/SecureRestApiV2.js +1 -1
  7. package/lib/extensions/ApiGatewayExtension.js +1 -1
  8. package/lib/extensions/ApplicationLoadBalancerExtension.js +1 -1
  9. package/lib/extensions/ApplicationLoadBalancerExtensionV2.js +1 -1
  10. package/lib/extensions/CloudMapExtension.js +1 -1
  11. package/lib/extensions/DeactivatableServiceExtension.js +1 -1
  12. package/lib/extensions/DocumentDbAccessExtension.js +1 -1
  13. package/lib/extensions/DomainEventMessagingExtension.js +1 -1
  14. package/lib/extensions/ExtraContainerExtension.js +1 -1
  15. package/lib/extensions/HTTPApiExtension.js +1 -1
  16. package/lib/extensions/LogExtension.js +1 -1
  17. package/lib/extensions/ModifyContainerDefinitionExtension.js +1 -1
  18. package/lib/extensions/ModifyTaskDefinitionExtension.js +1 -1
  19. package/lib/extensions/OpenTelemetryExtension.js +1 -1
  20. package/lib/extensions/PostgresDbAccessExtension.js +1 -1
  21. package/lib/extensions/SharedVolumeExtension.js +1 -1
  22. package/lib/extensions/TcpKeepAliveExtension.js +1 -1
  23. package/lib/platform/ApiGateway.js +1 -1
  24. package/lib/platform/ApiGatewayV2.js +2 -2
  25. package/lib/platform/ApplicationLoadBalancer.js +1 -1
  26. package/lib/platform/ApplicationLoadBalancerV2.js +2 -2
  27. package/lib/platform/CognitoUserPool.js +2 -2
  28. package/lib/platform/DefaultUserPoolClients.js +1 -1
  29. package/lib/platform/DocumentDB.js +2 -2
  30. package/lib/platform/PrivateDnsNamespace.js +1 -1
  31. package/lib/platform/ResourceServer.js +1 -1
  32. package/lib/platform/Vpc.js +1 -1
  33. package/lib/utils/StackParameter.js +1 -1
  34. package/node_modules/yaml/README.md +2 -0
  35. package/node_modules/yaml/browser/dist/compose/compose-collection.js +2 -2
  36. package/node_modules/yaml/browser/dist/compose/resolve-props.js +2 -4
  37. package/node_modules/yaml/browser/dist/compose/util-empty-scalar-position.js +1 -2
  38. package/node_modules/yaml/browser/dist/doc/anchors.js +1 -2
  39. package/node_modules/yaml/browser/dist/doc/createNode.js +1 -2
  40. package/node_modules/yaml/browser/dist/nodes/Alias.js +24 -11
  41. package/node_modules/yaml/browser/dist/nodes/YAMLMap.js +1 -1
  42. package/node_modules/yaml/browser/dist/nodes/addPairToJSMap.js +1 -0
  43. package/node_modules/yaml/browser/dist/parse/parser.js +14 -1
  44. package/node_modules/yaml/browser/dist/schema/tags.js +3 -3
  45. package/node_modules/yaml/browser/dist/schema/yaml-1.1/binary.js +3 -2
  46. package/node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.js +1 -1
  47. package/node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js +1 -1
  48. package/node_modules/yaml/browser/dist/stringify/stringify.js +3 -4
  49. package/node_modules/yaml/browser/dist/stringify/stringifyString.js +3 -4
  50. package/node_modules/yaml/dist/cli.d.ts +1 -1
  51. package/node_modules/yaml/dist/cli.mjs +5 -3
  52. package/node_modules/yaml/dist/compose/compose-collection.js +2 -2
  53. package/node_modules/yaml/dist/compose/composer.js +1 -1
  54. package/node_modules/yaml/dist/compose/resolve-props.js +2 -4
  55. package/node_modules/yaml/dist/compose/util-empty-scalar-position.js +1 -2
  56. package/node_modules/yaml/dist/doc/anchors.js +1 -2
  57. package/node_modules/yaml/dist/doc/createNode.js +1 -2
  58. package/node_modules/yaml/dist/log.js +1 -1
  59. package/node_modules/yaml/dist/nodes/Alias.d.ts +1 -1
  60. package/node_modules/yaml/dist/nodes/Alias.js +23 -10
  61. package/node_modules/yaml/dist/nodes/addPairToJSMap.js +1 -0
  62. package/node_modules/yaml/dist/nodes/toJS.d.ts +2 -0
  63. package/node_modules/yaml/dist/parse/parser.js +15 -2
  64. package/node_modules/yaml/dist/schema/yaml-1.1/binary.js +4 -3
  65. package/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js +1 -1
  66. package/node_modules/yaml/dist/stringify/stringify.js +3 -4
  67. package/node_modules/yaml/dist/stringify/stringifyString.js +2 -3
  68. package/node_modules/yaml/package.json +2 -2
  69. package/node_modules/zod/LICENSE +1 -1
  70. package/node_modules/zod/README.md +105 -2971
  71. package/node_modules/zod/{lib/external.js → dist/cjs/index.js} +6 -6
  72. package/node_modules/zod/dist/cjs/package.json +3 -0
  73. package/node_modules/zod/{lib → dist/cjs/v3}/ZodError.js +3 -3
  74. package/node_modules/zod/{lib → dist/cjs/v3}/benchmarks/datetime.js +1 -1
  75. package/node_modules/zod/{lib → dist/cjs/v3}/benchmarks/discriminatedUnion.js +15 -15
  76. package/node_modules/zod/dist/cjs/v3/benchmarks/index.js +59 -0
  77. package/node_modules/zod/{lib → dist/cjs/v3}/benchmarks/object.js +11 -11
  78. package/node_modules/zod/{lib → dist/cjs/v3}/benchmarks/primitives.js +22 -33
  79. package/node_modules/zod/{lib → dist/cjs/v3}/benchmarks/realworld.js +12 -12
  80. package/node_modules/zod/{lib → dist/cjs/v3}/benchmarks/string.js +5 -5
  81. package/node_modules/zod/{lib → dist/cjs/v3}/benchmarks/union.js +15 -15
  82. package/node_modules/zod/{lib → dist/cjs/v3}/errors.js +6 -6
  83. package/node_modules/zod/dist/cjs/v3/external.js +22 -0
  84. package/node_modules/zod/{lib → dist/cjs/v3}/helpers/errorUtil.js +2 -1
  85. package/node_modules/zod/{lib → dist/cjs/v3}/helpers/parseUtil.js +7 -8
  86. package/node_modules/zod/{lib → dist/cjs/v3}/helpers/util.js +5 -10
  87. package/node_modules/zod/{lib → dist/cjs/v3}/index.js +2 -2
  88. package/node_modules/zod/{lib → dist/cjs/v3}/locales/en.js +30 -50
  89. package/node_modules/zod/{lib → dist/cjs/v3}/types.js +466 -539
  90. package/node_modules/zod/dist/cjs/v4/classic/checks.js +32 -0
  91. package/node_modules/zod/dist/cjs/v4/classic/coerce.js +47 -0
  92. package/node_modules/zod/dist/cjs/v4/classic/compat.js +63 -0
  93. package/node_modules/zod/dist/cjs/v4/classic/errors.js +67 -0
  94. package/node_modules/zod/dist/cjs/v4/classic/external.js +69 -0
  95. package/node_modules/zod/dist/cjs/v4/classic/index.js +33 -0
  96. package/node_modules/zod/dist/cjs/v4/classic/iso.js +60 -0
  97. package/node_modules/zod/dist/cjs/v4/classic/parse.js +32 -0
  98. package/node_modules/zod/dist/cjs/v4/classic/schemas.js +1100 -0
  99. package/node_modules/zod/dist/cjs/v4/core/api.js +1021 -0
  100. package/node_modules/zod/dist/cjs/v4/core/checks.js +580 -0
  101. package/node_modules/zod/dist/cjs/v4/core/config.js +10 -0
  102. package/node_modules/zod/dist/cjs/v4/core/core.js +63 -0
  103. package/node_modules/zod/dist/cjs/v4/core/doc.js +39 -0
  104. package/node_modules/zod/dist/cjs/v4/core/errors.js +222 -0
  105. package/node_modules/zod/dist/cjs/v4/core/function.js +102 -0
  106. package/node_modules/zod/dist/cjs/v4/core/index.js +44 -0
  107. package/node_modules/zod/dist/cjs/v4/core/json-schema.js +2 -0
  108. package/node_modules/zod/dist/cjs/v4/core/parse.js +87 -0
  109. package/node_modules/zod/dist/cjs/v4/core/regexes.js +103 -0
  110. package/node_modules/zod/dist/cjs/v4/core/registries.js +47 -0
  111. package/node_modules/zod/dist/cjs/v4/core/schemas.js +1719 -0
  112. package/node_modules/zod/dist/cjs/v4/core/standard-schema.js +2 -0
  113. package/node_modules/zod/dist/cjs/v4/core/to-json-schema.js +833 -0
  114. package/node_modules/zod/dist/cjs/v4/core/util.js +537 -0
  115. package/node_modules/zod/dist/cjs/v4/core/versions.js +8 -0
  116. package/node_modules/zod/dist/cjs/v4/core/zsf.js +172 -0
  117. package/node_modules/zod/dist/cjs/v4/index.js +22 -0
  118. package/node_modules/zod/dist/cjs/v4/locales/ar.js +142 -0
  119. package/node_modules/zod/dist/cjs/v4/locales/az.js +141 -0
  120. package/node_modules/zod/dist/cjs/v4/locales/be.js +190 -0
  121. package/node_modules/zod/dist/cjs/v4/locales/ca.js +144 -0
  122. package/node_modules/zod/dist/cjs/v4/locales/cs.js +161 -0
  123. package/node_modules/zod/dist/cjs/v4/locales/de.js +142 -0
  124. package/node_modules/zod/dist/cjs/v4/locales/en.js +145 -0
  125. package/node_modules/zod/dist/cjs/v4/locales/es.js +143 -0
  126. package/node_modules/zod/dist/cjs/v4/locales/fa.js +148 -0
  127. package/node_modules/zod/dist/cjs/v4/locales/fi.js +148 -0
  128. package/node_modules/zod/dist/cjs/v4/locales/fr-CA.js +143 -0
  129. package/node_modules/zod/dist/cjs/v4/locales/fr.js +142 -0
  130. package/node_modules/zod/dist/cjs/v4/locales/he.js +143 -0
  131. package/node_modules/zod/dist/cjs/v4/locales/hu.js +143 -0
  132. package/node_modules/zod/dist/cjs/v4/locales/id.js +142 -0
  133. package/node_modules/zod/dist/cjs/v4/locales/index.js +82 -0
  134. package/node_modules/zod/dist/cjs/v4/locales/it.js +143 -0
  135. package/node_modules/zod/dist/cjs/v4/locales/ja.js +141 -0
  136. package/node_modules/zod/dist/cjs/v4/locales/kh.js +143 -0
  137. package/node_modules/zod/dist/cjs/v4/locales/ko.js +147 -0
  138. package/node_modules/zod/dist/cjs/v4/locales/mk.js +144 -0
  139. package/node_modules/zod/dist/cjs/v4/locales/ms.js +142 -0
  140. package/node_modules/zod/dist/cjs/v4/locales/nl.js +143 -0
  141. package/node_modules/zod/dist/cjs/v4/locales/no.js +142 -0
  142. package/node_modules/zod/dist/cjs/v4/locales/ota.js +143 -0
  143. package/node_modules/zod/dist/cjs/v4/locales/pl.js +143 -0
  144. package/node_modules/zod/dist/cjs/v4/locales/ps.js +148 -0
  145. package/node_modules/zod/dist/cjs/v4/locales/pt.js +142 -0
  146. package/node_modules/zod/dist/cjs/v4/locales/ru.js +190 -0
  147. package/node_modules/zod/dist/cjs/v4/locales/sl.js +143 -0
  148. package/node_modules/zod/dist/cjs/v4/locales/sv.js +144 -0
  149. package/node_modules/zod/dist/cjs/v4/locales/ta.js +143 -0
  150. package/node_modules/zod/dist/cjs/v4/locales/th.js +143 -0
  151. package/node_modules/zod/dist/cjs/v4/locales/tr.js +143 -0
  152. package/node_modules/zod/dist/cjs/v4/locales/ua.js +143 -0
  153. package/node_modules/zod/dist/cjs/v4/locales/ur.js +143 -0
  154. package/node_modules/zod/dist/cjs/v4/locales/vi.js +142 -0
  155. package/node_modules/zod/dist/cjs/v4/locales/zh-CN.js +142 -0
  156. package/node_modules/zod/dist/cjs/v4/locales/zh-TW.js +143 -0
  157. package/node_modules/zod/dist/cjs/v4/mini/checks.js +34 -0
  158. package/node_modules/zod/dist/cjs/v4/mini/coerce.js +47 -0
  159. package/node_modules/zod/dist/cjs/v4/mini/external.js +61 -0
  160. package/node_modules/zod/dist/cjs/v4/mini/index.js +32 -0
  161. package/node_modules/zod/dist/cjs/v4/mini/iso.js +60 -0
  162. package/node_modules/zod/dist/cjs/v4/mini/parse.js +8 -0
  163. package/node_modules/zod/dist/cjs/v4/mini/schemas.js +831 -0
  164. package/node_modules/zod/dist/esm/index.js +3 -0
  165. package/node_modules/zod/dist/esm/package.json +3 -0
  166. package/node_modules/zod/dist/esm/v3/ZodError.js +132 -0
  167. package/node_modules/zod/dist/esm/v3/benchmarks/datetime.js +49 -0
  168. package/node_modules/zod/dist/esm/v3/benchmarks/discriminatedUnion.js +74 -0
  169. package/node_modules/zod/dist/esm/v3/benchmarks/index.js +54 -0
  170. package/node_modules/zod/dist/esm/v3/benchmarks/ipv4.js +49 -0
  171. package/node_modules/zod/dist/esm/v3/benchmarks/object.js +65 -0
  172. package/node_modules/zod/dist/esm/v3/benchmarks/primitives.js +154 -0
  173. package/node_modules/zod/dist/esm/v3/benchmarks/realworld.js +51 -0
  174. package/node_modules/zod/dist/esm/v3/benchmarks/string.js +50 -0
  175. package/node_modules/zod/dist/esm/v3/benchmarks/union.js +74 -0
  176. package/node_modules/zod/dist/esm/v3/errors.js +9 -0
  177. package/node_modules/zod/dist/esm/v3/external.js +6 -0
  178. package/node_modules/zod/dist/esm/v3/helpers/errorUtil.js +6 -0
  179. package/node_modules/zod/dist/esm/v3/helpers/parseUtil.js +109 -0
  180. package/node_modules/zod/dist/esm/v3/helpers/partialUtil.js +1 -0
  181. package/node_modules/zod/dist/esm/v3/helpers/typeAliases.js +1 -0
  182. package/node_modules/zod/dist/esm/v3/helpers/util.js +133 -0
  183. package/node_modules/zod/dist/esm/v3/index.js +4 -0
  184. package/node_modules/zod/dist/esm/v3/locales/en.js +107 -0
  185. package/node_modules/zod/dist/esm/v3/standard-schema.js +1 -0
  186. package/node_modules/zod/dist/esm/v3/tests/Mocker.js +53 -0
  187. package/node_modules/zod/{lib/index.mjs → dist/esm/v3/types.js} +148 -862
  188. package/node_modules/zod/dist/esm/v4/classic/checks.js +1 -0
  189. package/node_modules/zod/dist/esm/v4/classic/coerce.js +17 -0
  190. package/node_modules/zod/dist/esm/v4/classic/compat.js +33 -0
  191. package/node_modules/zod/dist/esm/v4/classic/errors.js +41 -0
  192. package/node_modules/zod/dist/esm/v4/classic/external.js +18 -0
  193. package/node_modules/zod/dist/esm/v4/classic/index.js +4 -0
  194. package/node_modules/zod/dist/esm/v4/classic/iso.js +30 -0
  195. package/node_modules/zod/dist/esm/v4/classic/parse.js +6 -0
  196. package/node_modules/zod/dist/esm/v4/classic/schemas.js +998 -0
  197. package/node_modules/zod/dist/esm/v4/core/api.js +889 -0
  198. package/node_modules/zod/dist/esm/v4/core/checks.js +554 -0
  199. package/node_modules/zod/dist/esm/v4/core/config.js +6 -0
  200. package/node_modules/zod/dist/esm/v4/core/core.js +57 -0
  201. package/node_modules/zod/dist/esm/v4/core/doc.js +35 -0
  202. package/node_modules/zod/dist/esm/v4/core/errors.js +191 -0
  203. package/node_modules/zod/dist/esm/v4/core/function.js +75 -0
  204. package/node_modules/zod/dist/esm/v4/core/index.js +15 -0
  205. package/node_modules/zod/dist/esm/v4/core/json-schema.js +1 -0
  206. package/node_modules/zod/dist/esm/v4/core/parse.js +57 -0
  207. package/node_modules/zod/dist/esm/v4/core/regexes.js +95 -0
  208. package/node_modules/zod/dist/esm/v4/core/registries.js +42 -0
  209. package/node_modules/zod/dist/esm/v4/core/schemas.js +1688 -0
  210. package/node_modules/zod/dist/esm/v4/core/standard-schema.js +1 -0
  211. package/node_modules/zod/dist/esm/v4/core/to-json-schema.js +828 -0
  212. package/node_modules/zod/dist/esm/v4/core/util.js +491 -0
  213. package/node_modules/zod/dist/esm/v4/core/versions.js +5 -0
  214. package/node_modules/zod/dist/esm/v4/core/zsf.js +171 -0
  215. package/node_modules/zod/dist/esm/v4/index.js +3 -0
  216. package/node_modules/zod/dist/esm/v4/locales/ar.js +116 -0
  217. package/node_modules/zod/dist/esm/v4/locales/az.js +115 -0
  218. package/node_modules/zod/dist/esm/v4/locales/be.js +164 -0
  219. package/node_modules/zod/dist/esm/v4/locales/ca.js +118 -0
  220. package/node_modules/zod/dist/esm/v4/locales/cs.js +135 -0
  221. package/node_modules/zod/dist/esm/v4/locales/de.js +116 -0
  222. package/node_modules/zod/dist/esm/v4/locales/en.js +117 -0
  223. package/node_modules/zod/dist/esm/v4/locales/es.js +117 -0
  224. package/node_modules/zod/dist/esm/v4/locales/fa.js +122 -0
  225. package/node_modules/zod/dist/esm/v4/locales/fi.js +122 -0
  226. package/node_modules/zod/dist/esm/v4/locales/fr-CA.js +117 -0
  227. package/node_modules/zod/dist/esm/v4/locales/fr.js +116 -0
  228. package/node_modules/zod/dist/esm/v4/locales/he.js +117 -0
  229. package/node_modules/zod/dist/esm/v4/locales/hu.js +117 -0
  230. package/node_modules/zod/dist/esm/v4/locales/id.js +116 -0
  231. package/node_modules/zod/dist/esm/v4/locales/index.js +38 -0
  232. package/node_modules/zod/dist/esm/v4/locales/it.js +117 -0
  233. package/node_modules/zod/dist/esm/v4/locales/ja.js +115 -0
  234. package/node_modules/zod/dist/esm/v4/locales/kh.js +117 -0
  235. package/node_modules/zod/dist/esm/v4/locales/ko.js +121 -0
  236. package/node_modules/zod/dist/esm/v4/locales/mk.js +118 -0
  237. package/node_modules/zod/dist/esm/v4/locales/ms.js +116 -0
  238. package/node_modules/zod/dist/esm/v4/locales/nl.js +117 -0
  239. package/node_modules/zod/dist/esm/v4/locales/no.js +116 -0
  240. package/node_modules/zod/dist/esm/v4/locales/ota.js +117 -0
  241. package/node_modules/zod/dist/esm/v4/locales/pl.js +117 -0
  242. package/node_modules/zod/dist/esm/v4/locales/ps.js +122 -0
  243. package/node_modules/zod/dist/esm/v4/locales/pt.js +116 -0
  244. package/node_modules/zod/dist/esm/v4/locales/ru.js +164 -0
  245. package/node_modules/zod/dist/esm/v4/locales/sl.js +117 -0
  246. package/node_modules/zod/dist/esm/v4/locales/sv.js +118 -0
  247. package/node_modules/zod/dist/esm/v4/locales/ta.js +117 -0
  248. package/node_modules/zod/dist/esm/v4/locales/th.js +117 -0
  249. package/node_modules/zod/dist/esm/v4/locales/tr.js +115 -0
  250. package/node_modules/zod/dist/esm/v4/locales/ua.js +117 -0
  251. package/node_modules/zod/dist/esm/v4/locales/ur.js +117 -0
  252. package/node_modules/zod/dist/esm/v4/locales/vi.js +116 -0
  253. package/node_modules/zod/dist/esm/v4/locales/zh-CN.js +116 -0
  254. package/node_modules/zod/dist/esm/v4/locales/zh-TW.js +117 -0
  255. package/node_modules/zod/dist/esm/v4/mini/checks.js +1 -0
  256. package/node_modules/zod/dist/esm/v4/mini/coerce.js +17 -0
  257. package/node_modules/zod/dist/esm/v4/mini/external.js +13 -0
  258. package/node_modules/zod/dist/esm/v4/mini/index.js +3 -0
  259. package/node_modules/zod/dist/esm/v4/mini/iso.js +30 -0
  260. package/node_modules/zod/dist/esm/v4/mini/parse.js +1 -0
  261. package/node_modules/zod/dist/esm/v4/mini/schemas.js +725 -0
  262. package/node_modules/zod/dist/types/index.d.ts +3 -0
  263. package/node_modules/zod/dist/types/package.json +3 -0
  264. package/node_modules/zod/{lib → dist/types/v3}/ZodError.d.ts +7 -7
  265. package/node_modules/zod/dist/types/v3/benchmarks/index.d.ts +1 -0
  266. package/node_modules/zod/{lib → dist/types/v3}/errors.d.ts +2 -2
  267. package/node_modules/zod/dist/types/v3/external.d.ts +6 -0
  268. package/node_modules/zod/{lib → dist/types/v3}/helpers/errorUtil.d.ts +1 -1
  269. package/node_modules/zod/{lib → dist/types/v3}/helpers/parseUtil.d.ts +4 -4
  270. package/node_modules/zod/{lib → dist/types/v3}/helpers/partialUtil.d.ts +1 -1
  271. package/node_modules/zod/{lib → dist/types/v3}/helpers/util.d.ts +14 -11
  272. package/node_modules/zod/dist/types/v3/index.d.ts +4 -0
  273. package/node_modules/zod/{lib → dist/types/v3}/locales/en.d.ts +1 -1
  274. package/node_modules/zod/{lib/__tests__ → dist/types/v3/tests}/Mocker.d.ts +6 -6
  275. package/node_modules/zod/{lib → dist/types/v3}/types.d.ts +120 -151
  276. package/node_modules/zod/dist/types/v4/classic/checks.d.ts +1 -0
  277. package/node_modules/zod/dist/types/v4/classic/coerce.d.ts +17 -0
  278. package/node_modules/zod/dist/types/v4/classic/compat.d.ts +48 -0
  279. package/node_modules/zod/dist/types/v4/classic/errors.d.ts +30 -0
  280. package/node_modules/zod/dist/types/v4/classic/external.d.ts +13 -0
  281. package/node_modules/zod/dist/types/v4/classic/index.d.ts +4 -0
  282. package/node_modules/zod/dist/types/v4/classic/iso.d.ts +22 -0
  283. package/node_modules/zod/dist/types/v4/classic/parse.d.ts +23 -0
  284. package/node_modules/zod/dist/types/v4/classic/schemas.d.ts +624 -0
  285. package/node_modules/zod/dist/types/v4/core/api.d.ts +281 -0
  286. package/node_modules/zod/dist/types/v4/core/checks.d.ts +277 -0
  287. package/node_modules/zod/dist/types/v4/core/config.d.ts +9 -0
  288. package/node_modules/zod/dist/types/v4/core/core.d.ts +47 -0
  289. package/node_modules/zod/dist/types/v4/core/doc.d.ts +14 -0
  290. package/node_modules/zod/dist/types/v4/core/errors.d.ts +204 -0
  291. package/node_modules/zod/dist/types/v4/core/function.d.ts +52 -0
  292. package/node_modules/zod/dist/types/v4/core/index.d.ts +15 -0
  293. package/node_modules/zod/dist/types/v4/core/json-schema.d.ts +87 -0
  294. package/node_modules/zod/dist/types/v4/core/parse.d.ts +25 -0
  295. package/node_modules/zod/dist/types/v4/core/regexes.d.ts +62 -0
  296. package/node_modules/zod/dist/types/v4/core/registries.d.ts +39 -0
  297. package/node_modules/zod/dist/types/v4/core/schemas.d.ts +1005 -0
  298. package/node_modules/zod/dist/types/v4/core/standard-schema.d.ts +55 -0
  299. package/node_modules/zod/dist/types/v4/core/to-json-schema.d.ts +84 -0
  300. package/node_modules/zod/dist/types/v4/core/util.d.ts +183 -0
  301. package/node_modules/zod/dist/types/v4/core/versions.d.ts +5 -0
  302. package/node_modules/zod/dist/types/v4/core/zsf.d.ts +91 -0
  303. package/node_modules/zod/dist/types/v4/index.d.ts +3 -0
  304. package/node_modules/zod/dist/types/v4/locales/ar.d.ts +4 -0
  305. package/node_modules/zod/dist/types/v4/locales/az.d.ts +4 -0
  306. package/node_modules/zod/dist/types/v4/locales/be.d.ts +4 -0
  307. package/node_modules/zod/dist/types/v4/locales/ca.d.ts +4 -0
  308. package/node_modules/zod/dist/types/v4/locales/cs.d.ts +4 -0
  309. package/node_modules/zod/dist/types/v4/locales/de.d.ts +4 -0
  310. package/node_modules/zod/dist/types/v4/locales/en.d.ts +5 -0
  311. package/node_modules/zod/dist/types/v4/locales/es.d.ts +4 -0
  312. package/node_modules/zod/dist/types/v4/locales/fa.d.ts +4 -0
  313. package/node_modules/zod/dist/types/v4/locales/fi.d.ts +4 -0
  314. package/node_modules/zod/dist/types/v4/locales/fr-CA.d.ts +4 -0
  315. package/node_modules/zod/dist/types/v4/locales/fr.d.ts +4 -0
  316. package/node_modules/zod/dist/types/v4/locales/he.d.ts +4 -0
  317. package/node_modules/zod/dist/types/v4/locales/hu.d.ts +4 -0
  318. package/node_modules/zod/dist/types/v4/locales/id.d.ts +4 -0
  319. package/node_modules/zod/dist/types/v4/locales/index.d.ts +38 -0
  320. package/node_modules/zod/dist/types/v4/locales/it.d.ts +4 -0
  321. package/node_modules/zod/dist/types/v4/locales/ja.d.ts +4 -0
  322. package/node_modules/zod/dist/types/v4/locales/kh.d.ts +4 -0
  323. package/node_modules/zod/dist/types/v4/locales/ko.d.ts +4 -0
  324. package/node_modules/zod/dist/types/v4/locales/mk.d.ts +4 -0
  325. package/node_modules/zod/dist/types/v4/locales/ms.d.ts +4 -0
  326. package/node_modules/zod/dist/types/v4/locales/nl.d.ts +4 -0
  327. package/node_modules/zod/dist/types/v4/locales/no.d.ts +4 -0
  328. package/node_modules/zod/dist/types/v4/locales/ota.d.ts +4 -0
  329. package/node_modules/zod/dist/types/v4/locales/pl.d.ts +4 -0
  330. package/node_modules/zod/dist/types/v4/locales/ps.d.ts +4 -0
  331. package/node_modules/zod/dist/types/v4/locales/pt.d.ts +4 -0
  332. package/node_modules/zod/dist/types/v4/locales/ru.d.ts +4 -0
  333. package/node_modules/zod/dist/types/v4/locales/sl.d.ts +4 -0
  334. package/node_modules/zod/dist/types/v4/locales/sv.d.ts +4 -0
  335. package/node_modules/zod/dist/types/v4/locales/ta.d.ts +4 -0
  336. package/node_modules/zod/dist/types/v4/locales/th.d.ts +4 -0
  337. package/node_modules/zod/dist/types/v4/locales/tr.d.ts +5 -0
  338. package/node_modules/zod/dist/types/v4/locales/ua.d.ts +4 -0
  339. package/node_modules/zod/dist/types/v4/locales/ur.d.ts +4 -0
  340. package/node_modules/zod/dist/types/v4/locales/vi.d.ts +4 -0
  341. package/node_modules/zod/dist/types/v4/locales/zh-CN.d.ts +4 -0
  342. package/node_modules/zod/dist/types/v4/locales/zh-TW.d.ts +4 -0
  343. package/node_modules/zod/dist/types/v4/mini/checks.d.ts +1 -0
  344. package/node_modules/zod/dist/types/v4/mini/coerce.d.ts +7 -0
  345. package/node_modules/zod/dist/types/v4/mini/external.d.ts +11 -0
  346. package/node_modules/zod/dist/types/v4/mini/index.d.ts +3 -0
  347. package/node_modules/zod/dist/types/v4/mini/iso.d.ts +22 -0
  348. package/node_modules/zod/dist/types/v4/mini/parse.d.ts +1 -0
  349. package/node_modules/zod/dist/types/v4/mini/schemas.d.ts +351 -0
  350. package/node_modules/zod/package.json +105 -107
  351. package/node_modules/zod/v3/index.d.ts +3 -0
  352. package/node_modules/zod/v3/index.js +1 -0
  353. package/node_modules/zod/v4/core/index.d.ts +1 -0
  354. package/node_modules/zod/v4/core/index.js +1 -0
  355. package/node_modules/zod/v4/index.d.ts +3 -0
  356. package/node_modules/zod/v4/index.js +1 -0
  357. package/node_modules/zod/v4/locales/en.d.ts +2 -0
  358. package/node_modules/zod/v4/locales/en.js +2 -0
  359. package/node_modules/zod/v4/locales/index.d.ts +1 -0
  360. package/node_modules/zod/v4/locales/index.js +1 -0
  361. package/node_modules/zod/v4-mini/index.d.ts +1 -0
  362. package/node_modules/zod/v4-mini/index.js +1 -0
  363. package/package.json +16 -16
  364. package/node_modules/zod/index.d.ts +0 -2
  365. package/node_modules/zod/lib/benchmarks/index.js +0 -59
  366. package/node_modules/zod/lib/external.d.ts +0 -6
  367. package/node_modules/zod/lib/index.d.ts +0 -4
  368. package/node_modules/zod/lib/index.umd.js +0 -4520
  369. /package/node_modules/zod/{lib → dist/cjs/v3}/benchmarks/ipv4.js +0 -0
  370. /package/node_modules/zod/{lib → dist/cjs/v3}/helpers/enumUtil.js +0 -0
  371. /package/node_modules/zod/{lib → dist/cjs/v3}/helpers/partialUtil.js +0 -0
  372. /package/node_modules/zod/{lib → dist/cjs/v3}/helpers/typeAliases.js +0 -0
  373. /package/node_modules/zod/{lib → dist/cjs/v3}/standard-schema.js +0 -0
  374. /package/node_modules/zod/{lib/__tests__ → dist/cjs/v3/tests}/Mocker.js +0 -0
  375. /package/node_modules/zod/{lib/benchmarks/index.d.ts → dist/esm/v3/helpers/enumUtil.js} +0 -0
  376. /package/node_modules/zod/{lib → dist/types/v3}/benchmarks/datetime.d.ts +0 -0
  377. /package/node_modules/zod/{lib → dist/types/v3}/benchmarks/discriminatedUnion.d.ts +0 -0
  378. /package/node_modules/zod/{lib → dist/types/v3}/benchmarks/ipv4.d.ts +0 -0
  379. /package/node_modules/zod/{lib → dist/types/v3}/benchmarks/object.d.ts +0 -0
  380. /package/node_modules/zod/{lib → dist/types/v3}/benchmarks/primitives.d.ts +0 -0
  381. /package/node_modules/zod/{lib → dist/types/v3}/benchmarks/realworld.d.ts +0 -0
  382. /package/node_modules/zod/{lib → dist/types/v3}/benchmarks/string.d.ts +0 -0
  383. /package/node_modules/zod/{lib → dist/types/v3}/benchmarks/union.d.ts +0 -0
  384. /package/node_modules/zod/{lib → dist/types/v3}/helpers/enumUtil.d.ts +0 -0
  385. /package/node_modules/zod/{lib → dist/types/v3}/helpers/typeAliases.d.ts +0 -0
  386. /package/node_modules/zod/{lib → dist/types/v3}/standard-schema.d.ts +0 -0
@@ -1,24 +1,14 @@
1
1
  "use strict";
2
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
3
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
4
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
5
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
6
- };
7
- var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
8
- if (kind === "m") throw new TypeError("Private method is not writable");
9
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
10
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
11
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
12
- };
13
- var _ZodEnum_cache, _ZodNativeEnum_cache;
14
2
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.boolean = exports.bigint = exports.array = exports.any = exports.coerce = exports.ZodFirstPartyTypeKind = exports.late = exports.ZodSchema = exports.Schema = exports.custom = exports.ZodReadonly = exports.ZodPipeline = exports.ZodBranded = exports.BRAND = exports.ZodNaN = exports.ZodCatch = exports.ZodDefault = exports.ZodNullable = exports.ZodOptional = exports.ZodTransformer = exports.ZodEffects = exports.ZodPromise = exports.ZodNativeEnum = exports.ZodEnum = exports.ZodLiteral = exports.ZodLazy = exports.ZodFunction = exports.ZodSet = exports.ZodMap = exports.ZodRecord = exports.ZodTuple = exports.ZodIntersection = exports.ZodDiscriminatedUnion = exports.ZodUnion = exports.ZodObject = exports.ZodArray = exports.ZodVoid = exports.ZodNever = exports.ZodUnknown = exports.ZodAny = exports.ZodNull = exports.ZodUndefined = exports.ZodSymbol = exports.ZodDate = exports.ZodBoolean = exports.ZodBigInt = exports.ZodNumber = exports.ZodString = exports.datetimeRegex = exports.ZodType = void 0;
16
- exports.NEVER = exports.void = exports.unknown = exports.union = exports.undefined = exports.tuple = exports.transformer = exports.symbol = exports.string = exports.strictObject = exports.set = exports.record = exports.promise = exports.preprocess = exports.pipeline = exports.ostring = exports.optional = exports.onumber = exports.oboolean = exports.object = exports.number = exports.nullable = exports.null = exports.never = exports.nativeEnum = exports.nan = exports.map = exports.literal = exports.lazy = exports.intersection = exports.instanceof = exports.function = exports.enum = exports.effect = exports.discriminatedUnion = exports.date = void 0;
17
- const errors_1 = require("./errors");
18
- const errorUtil_1 = require("./helpers/errorUtil");
19
- const parseUtil_1 = require("./helpers/parseUtil");
20
- const util_1 = require("./helpers/util");
21
- const ZodError_1 = require("./ZodError");
3
+ exports.discriminatedUnion = exports.date = exports.boolean = exports.bigint = exports.array = exports.any = exports.coerce = exports.ZodFirstPartyTypeKind = exports.late = exports.ZodSchema = exports.Schema = exports.ZodReadonly = exports.ZodPipeline = exports.ZodBranded = exports.BRAND = exports.ZodNaN = exports.ZodCatch = exports.ZodDefault = exports.ZodNullable = exports.ZodOptional = exports.ZodTransformer = exports.ZodEffects = exports.ZodPromise = exports.ZodNativeEnum = exports.ZodEnum = exports.ZodLiteral = exports.ZodLazy = exports.ZodFunction = exports.ZodSet = exports.ZodMap = exports.ZodRecord = exports.ZodTuple = exports.ZodIntersection = exports.ZodDiscriminatedUnion = exports.ZodUnion = exports.ZodObject = exports.ZodArray = exports.ZodVoid = exports.ZodNever = exports.ZodUnknown = exports.ZodAny = exports.ZodNull = exports.ZodUndefined = exports.ZodSymbol = exports.ZodDate = exports.ZodBoolean = exports.ZodBigInt = exports.ZodNumber = exports.ZodString = exports.ZodType = void 0;
4
+ exports.NEVER = exports.void = exports.unknown = exports.union = exports.undefined = exports.tuple = exports.transformer = exports.symbol = exports.string = exports.strictObject = exports.set = exports.record = exports.promise = exports.preprocess = exports.pipeline = exports.ostring = exports.optional = exports.onumber = exports.oboolean = exports.object = exports.number = exports.nullable = exports.null = exports.never = exports.nativeEnum = exports.nan = exports.map = exports.literal = exports.lazy = exports.intersection = exports.instanceof = exports.function = exports.enum = exports.effect = void 0;
5
+ exports.datetimeRegex = datetimeRegex;
6
+ exports.custom = custom;
7
+ const ZodError_js_1 = require("./ZodError.js");
8
+ const errors_js_1 = require("./errors.js");
9
+ const errorUtil_js_1 = require("./helpers/errorUtil.js");
10
+ const parseUtil_js_1 = require("./helpers/parseUtil.js");
11
+ const util_js_1 = require("./helpers/util.js");
22
12
  class ParseInputLazyPath {
23
13
  constructor(parent, value, path, key) {
24
14
  this._cachedPath = [];
@@ -29,7 +19,7 @@ class ParseInputLazyPath {
29
19
  }
30
20
  get path() {
31
21
  if (!this._cachedPath.length) {
32
- if (this._key instanceof Array) {
22
+ if (Array.isArray(this._key)) {
33
23
  this._cachedPath.push(...this._path, ...this._key);
34
24
  }
35
25
  else {
@@ -40,7 +30,7 @@ class ParseInputLazyPath {
40
30
  }
41
31
  }
42
32
  const handleResult = (ctx, result) => {
43
- if ((0, parseUtil_1.isValid)(result)) {
33
+ if ((0, parseUtil_js_1.isValid)(result)) {
44
34
  return { success: true, data: result.value };
45
35
  }
46
36
  else {
@@ -52,7 +42,7 @@ const handleResult = (ctx, result) => {
52
42
  get error() {
53
43
  if (this._error)
54
44
  return this._error;
55
- const error = new ZodError_1.ZodError(ctx.common.issues);
45
+ const error = new ZodError_js_1.ZodError(ctx.common.issues);
56
46
  this._error = error;
57
47
  return this._error;
58
48
  },
@@ -69,17 +59,16 @@ function processCreateParams(params) {
69
59
  if (errorMap)
70
60
  return { errorMap: errorMap, description };
71
61
  const customMap = (iss, ctx) => {
72
- var _a, _b;
73
62
  const { message } = params;
74
63
  if (iss.code === "invalid_enum_value") {
75
- return { message: message !== null && message !== void 0 ? message : ctx.defaultError };
64
+ return { message: message ?? ctx.defaultError };
76
65
  }
77
66
  if (typeof ctx.data === "undefined") {
78
- return { message: (_a = message !== null && message !== void 0 ? message : required_error) !== null && _a !== void 0 ? _a : ctx.defaultError };
67
+ return { message: message ?? required_error ?? ctx.defaultError };
79
68
  }
80
69
  if (iss.code !== "invalid_type")
81
70
  return { message: ctx.defaultError };
82
- return { message: (_b = message !== null && message !== void 0 ? message : invalid_type_error) !== null && _b !== void 0 ? _b : ctx.defaultError };
71
+ return { message: message ?? invalid_type_error ?? ctx.defaultError };
83
72
  };
84
73
  return { errorMap: customMap, description };
85
74
  }
@@ -88,13 +77,13 @@ class ZodType {
88
77
  return this._def.description;
89
78
  }
90
79
  _getType(input) {
91
- return (0, util_1.getParsedType)(input.data);
80
+ return (0, util_js_1.getParsedType)(input.data);
92
81
  }
93
82
  _getOrReturnCtx(input, ctx) {
94
83
  return (ctx || {
95
84
  common: input.parent.common,
96
85
  data: input.data,
97
- parsedType: (0, util_1.getParsedType)(input.data),
86
+ parsedType: (0, util_js_1.getParsedType)(input.data),
98
87
  schemaErrorMap: this._def.errorMap,
99
88
  path: input.path,
100
89
  parent: input.parent,
@@ -102,11 +91,11 @@ class ZodType {
102
91
  }
103
92
  _processInputParams(input) {
104
93
  return {
105
- status: new parseUtil_1.ParseStatus(),
94
+ status: new parseUtil_js_1.ParseStatus(),
106
95
  ctx: {
107
96
  common: input.parent.common,
108
97
  data: input.data,
109
- parsedType: (0, util_1.getParsedType)(input.data),
98
+ parsedType: (0, util_js_1.getParsedType)(input.data),
110
99
  schemaErrorMap: this._def.errorMap,
111
100
  path: input.path,
112
101
  parent: input.parent,
@@ -115,7 +104,7 @@ class ZodType {
115
104
  }
116
105
  _parseSync(input) {
117
106
  const result = this._parse(input);
118
- if ((0, parseUtil_1.isAsync)(result)) {
107
+ if ((0, parseUtil_js_1.isAsync)(result)) {
119
108
  throw new Error("Synchronous parse encountered promise.");
120
109
  }
121
110
  return result;
@@ -131,24 +120,22 @@ class ZodType {
131
120
  throw result.error;
132
121
  }
133
122
  safeParse(data, params) {
134
- var _a;
135
123
  const ctx = {
136
124
  common: {
137
125
  issues: [],
138
- async: (_a = params === null || params === void 0 ? void 0 : params.async) !== null && _a !== void 0 ? _a : false,
139
- contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap,
126
+ async: params?.async ?? false,
127
+ contextualErrorMap: params?.errorMap,
140
128
  },
141
- path: (params === null || params === void 0 ? void 0 : params.path) || [],
129
+ path: params?.path || [],
142
130
  schemaErrorMap: this._def.errorMap,
143
131
  parent: null,
144
132
  data,
145
- parsedType: (0, util_1.getParsedType)(data),
133
+ parsedType: (0, util_js_1.getParsedType)(data),
146
134
  };
147
135
  const result = this._parseSync({ data, path: ctx.path, parent: ctx });
148
136
  return handleResult(ctx, result);
149
137
  }
150
138
  "~validate"(data) {
151
- var _a, _b;
152
139
  const ctx = {
153
140
  common: {
154
141
  issues: [],
@@ -158,12 +145,12 @@ class ZodType {
158
145
  schemaErrorMap: this._def.errorMap,
159
146
  parent: null,
160
147
  data,
161
- parsedType: (0, util_1.getParsedType)(data),
148
+ parsedType: (0, util_js_1.getParsedType)(data),
162
149
  };
163
150
  if (!this["~standard"].async) {
164
151
  try {
165
152
  const result = this._parseSync({ data, path: [], parent: ctx });
166
- return (0, parseUtil_1.isValid)(result)
153
+ return (0, parseUtil_js_1.isValid)(result)
167
154
  ? {
168
155
  value: result.value,
169
156
  }
@@ -172,7 +159,7 @@ class ZodType {
172
159
  };
173
160
  }
174
161
  catch (err) {
175
- if ((_b = (_a = err === null || err === void 0 ? void 0 : err.message) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === null || _b === void 0 ? void 0 : _b.includes("encountered")) {
162
+ if (err?.message?.toLowerCase()?.includes("encountered")) {
176
163
  this["~standard"].async = true;
177
164
  }
178
165
  ctx.common = {
@@ -181,7 +168,7 @@ class ZodType {
181
168
  };
182
169
  }
183
170
  }
184
- return this._parseAsync({ data, path: [], parent: ctx }).then((result) => (0, parseUtil_1.isValid)(result)
171
+ return this._parseAsync({ data, path: [], parent: ctx }).then((result) => (0, parseUtil_js_1.isValid)(result)
185
172
  ? {
186
173
  value: result.value,
187
174
  }
@@ -199,19 +186,17 @@ class ZodType {
199
186
  const ctx = {
200
187
  common: {
201
188
  issues: [],
202
- contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap,
189
+ contextualErrorMap: params?.errorMap,
203
190
  async: true,
204
191
  },
205
- path: (params === null || params === void 0 ? void 0 : params.path) || [],
192
+ path: params?.path || [],
206
193
  schemaErrorMap: this._def.errorMap,
207
194
  parent: null,
208
195
  data,
209
- parsedType: (0, util_1.getParsedType)(data),
196
+ parsedType: (0, util_js_1.getParsedType)(data),
210
197
  };
211
198
  const maybeAsyncResult = this._parse({ data, path: ctx.path, parent: ctx });
212
- const result = await ((0, parseUtil_1.isAsync)(maybeAsyncResult)
213
- ? maybeAsyncResult
214
- : Promise.resolve(maybeAsyncResult));
199
+ const result = await ((0, parseUtil_js_1.isAsync)(maybeAsyncResult) ? maybeAsyncResult : Promise.resolve(maybeAsyncResult));
215
200
  return handleResult(ctx, result);
216
201
  }
217
202
  refine(check, message) {
@@ -229,7 +214,7 @@ class ZodType {
229
214
  return this._refinement((val, ctx) => {
230
215
  const result = check(val);
231
216
  const setError = () => ctx.addIssue({
232
- code: ZodError_1.ZodIssueCode.custom,
217
+ code: ZodError_js_1.ZodIssueCode.custom,
233
218
  ...getIssueProperties(val),
234
219
  });
235
220
  if (typeof Promise !== "undefined" && result instanceof Promise) {
@@ -255,9 +240,7 @@ class ZodType {
255
240
  refinement(check, refinementData) {
256
241
  return this._refinement((val, ctx) => {
257
242
  if (!check(val)) {
258
- ctx.addIssue(typeof refinementData === "function"
259
- ? refinementData(val, ctx)
260
- : refinementData);
243
+ ctx.addIssue(typeof refinementData === "function" ? refinementData(val, ctx) : refinementData);
261
244
  return false;
262
245
  }
263
246
  else {
@@ -432,15 +415,15 @@ const base64urlRegex = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z
432
415
  const dateRegexSource = `((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`;
433
416
  const dateRegex = new RegExp(`^${dateRegexSource}$`);
434
417
  function timeRegexSource(args) {
435
- // let regex = `\\d{2}:\\d{2}:\\d{2}`;
436
- let regex = `([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d`;
418
+ let secondsRegexSource = `[0-5]\\d`;
437
419
  if (args.precision) {
438
- regex = `${regex}\\.\\d{${args.precision}}`;
420
+ secondsRegexSource = `${secondsRegexSource}\\.\\d{${args.precision}}`;
439
421
  }
440
422
  else if (args.precision == null) {
441
- regex = `${regex}(\\.\\d+)?`;
423
+ secondsRegexSource = `${secondsRegexSource}(\\.\\d+)?`;
442
424
  }
443
- return regex;
425
+ const secondsQuantifier = args.precision ? "+" : "?"; // require seconds if precision is nonzero
426
+ return `([01]\\d|2[0-3]):[0-5]\\d(:${secondsRegexSource})${secondsQuantifier}`;
444
427
  }
445
428
  function timeRegex(args) {
446
429
  return new RegExp(`^${timeRegexSource(args)}$`);
@@ -455,7 +438,6 @@ function datetimeRegex(args) {
455
438
  regex = `${regex}(${opts.join("|")})`;
456
439
  return new RegExp(`^${regex}$`);
457
440
  }
458
- exports.datetimeRegex = datetimeRegex;
459
441
  function isValidIP(ip, version) {
460
442
  if ((version === "v4" || !version) && ipv4Regex.test(ip)) {
461
443
  return true;
@@ -478,13 +460,15 @@ function isValidJWT(jwt, alg) {
478
460
  const decoded = JSON.parse(atob(base64));
479
461
  if (typeof decoded !== "object" || decoded === null)
480
462
  return false;
481
- if (!decoded.typ || !decoded.alg)
463
+ if ("typ" in decoded && decoded?.typ !== "JWT")
464
+ return false;
465
+ if (!decoded.alg)
482
466
  return false;
483
467
  if (alg && decoded.alg !== alg)
484
468
  return false;
485
469
  return true;
486
470
  }
487
- catch (_a) {
471
+ catch {
488
472
  return false;
489
473
  }
490
474
  }
@@ -503,23 +487,23 @@ class ZodString extends ZodType {
503
487
  input.data = String(input.data);
504
488
  }
505
489
  const parsedType = this._getType(input);
506
- if (parsedType !== util_1.ZodParsedType.string) {
490
+ if (parsedType !== util_js_1.ZodParsedType.string) {
507
491
  const ctx = this._getOrReturnCtx(input);
508
- (0, parseUtil_1.addIssueToContext)(ctx, {
509
- code: ZodError_1.ZodIssueCode.invalid_type,
510
- expected: util_1.ZodParsedType.string,
492
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
493
+ code: ZodError_js_1.ZodIssueCode.invalid_type,
494
+ expected: util_js_1.ZodParsedType.string,
511
495
  received: ctx.parsedType,
512
496
  });
513
- return parseUtil_1.INVALID;
497
+ return parseUtil_js_1.INVALID;
514
498
  }
515
- const status = new parseUtil_1.ParseStatus();
499
+ const status = new parseUtil_js_1.ParseStatus();
516
500
  let ctx = undefined;
517
501
  for (const check of this._def.checks) {
518
502
  if (check.kind === "min") {
519
503
  if (input.data.length < check.value) {
520
504
  ctx = this._getOrReturnCtx(input, ctx);
521
- (0, parseUtil_1.addIssueToContext)(ctx, {
522
- code: ZodError_1.ZodIssueCode.too_small,
505
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
506
+ code: ZodError_js_1.ZodIssueCode.too_small,
523
507
  minimum: check.value,
524
508
  type: "string",
525
509
  inclusive: true,
@@ -532,8 +516,8 @@ class ZodString extends ZodType {
532
516
  else if (check.kind === "max") {
533
517
  if (input.data.length > check.value) {
534
518
  ctx = this._getOrReturnCtx(input, ctx);
535
- (0, parseUtil_1.addIssueToContext)(ctx, {
536
- code: ZodError_1.ZodIssueCode.too_big,
519
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
520
+ code: ZodError_js_1.ZodIssueCode.too_big,
537
521
  maximum: check.value,
538
522
  type: "string",
539
523
  inclusive: true,
@@ -549,8 +533,8 @@ class ZodString extends ZodType {
549
533
  if (tooBig || tooSmall) {
550
534
  ctx = this._getOrReturnCtx(input, ctx);
551
535
  if (tooBig) {
552
- (0, parseUtil_1.addIssueToContext)(ctx, {
553
- code: ZodError_1.ZodIssueCode.too_big,
536
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
537
+ code: ZodError_js_1.ZodIssueCode.too_big,
554
538
  maximum: check.value,
555
539
  type: "string",
556
540
  inclusive: true,
@@ -559,8 +543,8 @@ class ZodString extends ZodType {
559
543
  });
560
544
  }
561
545
  else if (tooSmall) {
562
- (0, parseUtil_1.addIssueToContext)(ctx, {
563
- code: ZodError_1.ZodIssueCode.too_small,
546
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
547
+ code: ZodError_js_1.ZodIssueCode.too_small,
564
548
  minimum: check.value,
565
549
  type: "string",
566
550
  inclusive: true,
@@ -574,9 +558,9 @@ class ZodString extends ZodType {
574
558
  else if (check.kind === "email") {
575
559
  if (!emailRegex.test(input.data)) {
576
560
  ctx = this._getOrReturnCtx(input, ctx);
577
- (0, parseUtil_1.addIssueToContext)(ctx, {
561
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
578
562
  validation: "email",
579
- code: ZodError_1.ZodIssueCode.invalid_string,
563
+ code: ZodError_js_1.ZodIssueCode.invalid_string,
580
564
  message: check.message,
581
565
  });
582
566
  status.dirty();
@@ -588,9 +572,9 @@ class ZodString extends ZodType {
588
572
  }
589
573
  if (!emojiRegex.test(input.data)) {
590
574
  ctx = this._getOrReturnCtx(input, ctx);
591
- (0, parseUtil_1.addIssueToContext)(ctx, {
575
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
592
576
  validation: "emoji",
593
- code: ZodError_1.ZodIssueCode.invalid_string,
577
+ code: ZodError_js_1.ZodIssueCode.invalid_string,
594
578
  message: check.message,
595
579
  });
596
580
  status.dirty();
@@ -599,9 +583,9 @@ class ZodString extends ZodType {
599
583
  else if (check.kind === "uuid") {
600
584
  if (!uuidRegex.test(input.data)) {
601
585
  ctx = this._getOrReturnCtx(input, ctx);
602
- (0, parseUtil_1.addIssueToContext)(ctx, {
586
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
603
587
  validation: "uuid",
604
- code: ZodError_1.ZodIssueCode.invalid_string,
588
+ code: ZodError_js_1.ZodIssueCode.invalid_string,
605
589
  message: check.message,
606
590
  });
607
591
  status.dirty();
@@ -610,9 +594,9 @@ class ZodString extends ZodType {
610
594
  else if (check.kind === "nanoid") {
611
595
  if (!nanoidRegex.test(input.data)) {
612
596
  ctx = this._getOrReturnCtx(input, ctx);
613
- (0, parseUtil_1.addIssueToContext)(ctx, {
597
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
614
598
  validation: "nanoid",
615
- code: ZodError_1.ZodIssueCode.invalid_string,
599
+ code: ZodError_js_1.ZodIssueCode.invalid_string,
616
600
  message: check.message,
617
601
  });
618
602
  status.dirty();
@@ -621,9 +605,9 @@ class ZodString extends ZodType {
621
605
  else if (check.kind === "cuid") {
622
606
  if (!cuidRegex.test(input.data)) {
623
607
  ctx = this._getOrReturnCtx(input, ctx);
624
- (0, parseUtil_1.addIssueToContext)(ctx, {
608
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
625
609
  validation: "cuid",
626
- code: ZodError_1.ZodIssueCode.invalid_string,
610
+ code: ZodError_js_1.ZodIssueCode.invalid_string,
627
611
  message: check.message,
628
612
  });
629
613
  status.dirty();
@@ -632,9 +616,9 @@ class ZodString extends ZodType {
632
616
  else if (check.kind === "cuid2") {
633
617
  if (!cuid2Regex.test(input.data)) {
634
618
  ctx = this._getOrReturnCtx(input, ctx);
635
- (0, parseUtil_1.addIssueToContext)(ctx, {
619
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
636
620
  validation: "cuid2",
637
- code: ZodError_1.ZodIssueCode.invalid_string,
621
+ code: ZodError_js_1.ZodIssueCode.invalid_string,
638
622
  message: check.message,
639
623
  });
640
624
  status.dirty();
@@ -643,9 +627,9 @@ class ZodString extends ZodType {
643
627
  else if (check.kind === "ulid") {
644
628
  if (!ulidRegex.test(input.data)) {
645
629
  ctx = this._getOrReturnCtx(input, ctx);
646
- (0, parseUtil_1.addIssueToContext)(ctx, {
630
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
647
631
  validation: "ulid",
648
- code: ZodError_1.ZodIssueCode.invalid_string,
632
+ code: ZodError_js_1.ZodIssueCode.invalid_string,
649
633
  message: check.message,
650
634
  });
651
635
  status.dirty();
@@ -655,11 +639,11 @@ class ZodString extends ZodType {
655
639
  try {
656
640
  new URL(input.data);
657
641
  }
658
- catch (_a) {
642
+ catch {
659
643
  ctx = this._getOrReturnCtx(input, ctx);
660
- (0, parseUtil_1.addIssueToContext)(ctx, {
644
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
661
645
  validation: "url",
662
- code: ZodError_1.ZodIssueCode.invalid_string,
646
+ code: ZodError_js_1.ZodIssueCode.invalid_string,
663
647
  message: check.message,
664
648
  });
665
649
  status.dirty();
@@ -670,9 +654,9 @@ class ZodString extends ZodType {
670
654
  const testResult = check.regex.test(input.data);
671
655
  if (!testResult) {
672
656
  ctx = this._getOrReturnCtx(input, ctx);
673
- (0, parseUtil_1.addIssueToContext)(ctx, {
657
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
674
658
  validation: "regex",
675
- code: ZodError_1.ZodIssueCode.invalid_string,
659
+ code: ZodError_js_1.ZodIssueCode.invalid_string,
676
660
  message: check.message,
677
661
  });
678
662
  status.dirty();
@@ -684,8 +668,8 @@ class ZodString extends ZodType {
684
668
  else if (check.kind === "includes") {
685
669
  if (!input.data.includes(check.value, check.position)) {
686
670
  ctx = this._getOrReturnCtx(input, ctx);
687
- (0, parseUtil_1.addIssueToContext)(ctx, {
688
- code: ZodError_1.ZodIssueCode.invalid_string,
671
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
672
+ code: ZodError_js_1.ZodIssueCode.invalid_string,
689
673
  validation: { includes: check.value, position: check.position },
690
674
  message: check.message,
691
675
  });
@@ -701,8 +685,8 @@ class ZodString extends ZodType {
701
685
  else if (check.kind === "startsWith") {
702
686
  if (!input.data.startsWith(check.value)) {
703
687
  ctx = this._getOrReturnCtx(input, ctx);
704
- (0, parseUtil_1.addIssueToContext)(ctx, {
705
- code: ZodError_1.ZodIssueCode.invalid_string,
688
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
689
+ code: ZodError_js_1.ZodIssueCode.invalid_string,
706
690
  validation: { startsWith: check.value },
707
691
  message: check.message,
708
692
  });
@@ -712,8 +696,8 @@ class ZodString extends ZodType {
712
696
  else if (check.kind === "endsWith") {
713
697
  if (!input.data.endsWith(check.value)) {
714
698
  ctx = this._getOrReturnCtx(input, ctx);
715
- (0, parseUtil_1.addIssueToContext)(ctx, {
716
- code: ZodError_1.ZodIssueCode.invalid_string,
699
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
700
+ code: ZodError_js_1.ZodIssueCode.invalid_string,
717
701
  validation: { endsWith: check.value },
718
702
  message: check.message,
719
703
  });
@@ -724,8 +708,8 @@ class ZodString extends ZodType {
724
708
  const regex = datetimeRegex(check);
725
709
  if (!regex.test(input.data)) {
726
710
  ctx = this._getOrReturnCtx(input, ctx);
727
- (0, parseUtil_1.addIssueToContext)(ctx, {
728
- code: ZodError_1.ZodIssueCode.invalid_string,
711
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
712
+ code: ZodError_js_1.ZodIssueCode.invalid_string,
729
713
  validation: "datetime",
730
714
  message: check.message,
731
715
  });
@@ -736,8 +720,8 @@ class ZodString extends ZodType {
736
720
  const regex = dateRegex;
737
721
  if (!regex.test(input.data)) {
738
722
  ctx = this._getOrReturnCtx(input, ctx);
739
- (0, parseUtil_1.addIssueToContext)(ctx, {
740
- code: ZodError_1.ZodIssueCode.invalid_string,
723
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
724
+ code: ZodError_js_1.ZodIssueCode.invalid_string,
741
725
  validation: "date",
742
726
  message: check.message,
743
727
  });
@@ -748,8 +732,8 @@ class ZodString extends ZodType {
748
732
  const regex = timeRegex(check);
749
733
  if (!regex.test(input.data)) {
750
734
  ctx = this._getOrReturnCtx(input, ctx);
751
- (0, parseUtil_1.addIssueToContext)(ctx, {
752
- code: ZodError_1.ZodIssueCode.invalid_string,
735
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
736
+ code: ZodError_js_1.ZodIssueCode.invalid_string,
753
737
  validation: "time",
754
738
  message: check.message,
755
739
  });
@@ -759,9 +743,9 @@ class ZodString extends ZodType {
759
743
  else if (check.kind === "duration") {
760
744
  if (!durationRegex.test(input.data)) {
761
745
  ctx = this._getOrReturnCtx(input, ctx);
762
- (0, parseUtil_1.addIssueToContext)(ctx, {
746
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
763
747
  validation: "duration",
764
- code: ZodError_1.ZodIssueCode.invalid_string,
748
+ code: ZodError_js_1.ZodIssueCode.invalid_string,
765
749
  message: check.message,
766
750
  });
767
751
  status.dirty();
@@ -770,9 +754,9 @@ class ZodString extends ZodType {
770
754
  else if (check.kind === "ip") {
771
755
  if (!isValidIP(input.data, check.version)) {
772
756
  ctx = this._getOrReturnCtx(input, ctx);
773
- (0, parseUtil_1.addIssueToContext)(ctx, {
757
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
774
758
  validation: "ip",
775
- code: ZodError_1.ZodIssueCode.invalid_string,
759
+ code: ZodError_js_1.ZodIssueCode.invalid_string,
776
760
  message: check.message,
777
761
  });
778
762
  status.dirty();
@@ -781,9 +765,9 @@ class ZodString extends ZodType {
781
765
  else if (check.kind === "jwt") {
782
766
  if (!isValidJWT(input.data, check.alg)) {
783
767
  ctx = this._getOrReturnCtx(input, ctx);
784
- (0, parseUtil_1.addIssueToContext)(ctx, {
768
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
785
769
  validation: "jwt",
786
- code: ZodError_1.ZodIssueCode.invalid_string,
770
+ code: ZodError_js_1.ZodIssueCode.invalid_string,
787
771
  message: check.message,
788
772
  });
789
773
  status.dirty();
@@ -792,9 +776,9 @@ class ZodString extends ZodType {
792
776
  else if (check.kind === "cidr") {
793
777
  if (!isValidCidr(input.data, check.version)) {
794
778
  ctx = this._getOrReturnCtx(input, ctx);
795
- (0, parseUtil_1.addIssueToContext)(ctx, {
779
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
796
780
  validation: "cidr",
797
- code: ZodError_1.ZodIssueCode.invalid_string,
781
+ code: ZodError_js_1.ZodIssueCode.invalid_string,
798
782
  message: check.message,
799
783
  });
800
784
  status.dirty();
@@ -803,9 +787,9 @@ class ZodString extends ZodType {
803
787
  else if (check.kind === "base64") {
804
788
  if (!base64Regex.test(input.data)) {
805
789
  ctx = this._getOrReturnCtx(input, ctx);
806
- (0, parseUtil_1.addIssueToContext)(ctx, {
790
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
807
791
  validation: "base64",
808
- code: ZodError_1.ZodIssueCode.invalid_string,
792
+ code: ZodError_js_1.ZodIssueCode.invalid_string,
809
793
  message: check.message,
810
794
  });
811
795
  status.dirty();
@@ -814,16 +798,16 @@ class ZodString extends ZodType {
814
798
  else if (check.kind === "base64url") {
815
799
  if (!base64urlRegex.test(input.data)) {
816
800
  ctx = this._getOrReturnCtx(input, ctx);
817
- (0, parseUtil_1.addIssueToContext)(ctx, {
801
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
818
802
  validation: "base64url",
819
- code: ZodError_1.ZodIssueCode.invalid_string,
803
+ code: ZodError_js_1.ZodIssueCode.invalid_string,
820
804
  message: check.message,
821
805
  });
822
806
  status.dirty();
823
807
  }
824
808
  }
825
809
  else {
826
- util_1.util.assertNever(check);
810
+ util_js_1.util.assertNever(check);
827
811
  }
828
812
  }
829
813
  return { status: status.value, value: input.data };
@@ -831,8 +815,8 @@ class ZodString extends ZodType {
831
815
  _regex(regex, validation, message) {
832
816
  return this.refinement((data) => regex.test(data), {
833
817
  validation,
834
- code: ZodError_1.ZodIssueCode.invalid_string,
835
- ...errorUtil_1.errorUtil.errToObj(message),
818
+ code: ZodError_js_1.ZodIssueCode.invalid_string,
819
+ ...errorUtil_js_1.errorUtil.errToObj(message),
836
820
  });
837
821
  }
838
822
  _addCheck(check) {
@@ -842,50 +826,49 @@ class ZodString extends ZodType {
842
826
  });
843
827
  }
844
828
  email(message) {
845
- return this._addCheck({ kind: "email", ...errorUtil_1.errorUtil.errToObj(message) });
829
+ return this._addCheck({ kind: "email", ...errorUtil_js_1.errorUtil.errToObj(message) });
846
830
  }
847
831
  url(message) {
848
- return this._addCheck({ kind: "url", ...errorUtil_1.errorUtil.errToObj(message) });
832
+ return this._addCheck({ kind: "url", ...errorUtil_js_1.errorUtil.errToObj(message) });
849
833
  }
850
834
  emoji(message) {
851
- return this._addCheck({ kind: "emoji", ...errorUtil_1.errorUtil.errToObj(message) });
835
+ return this._addCheck({ kind: "emoji", ...errorUtil_js_1.errorUtil.errToObj(message) });
852
836
  }
853
837
  uuid(message) {
854
- return this._addCheck({ kind: "uuid", ...errorUtil_1.errorUtil.errToObj(message) });
838
+ return this._addCheck({ kind: "uuid", ...errorUtil_js_1.errorUtil.errToObj(message) });
855
839
  }
856
840
  nanoid(message) {
857
- return this._addCheck({ kind: "nanoid", ...errorUtil_1.errorUtil.errToObj(message) });
841
+ return this._addCheck({ kind: "nanoid", ...errorUtil_js_1.errorUtil.errToObj(message) });
858
842
  }
859
843
  cuid(message) {
860
- return this._addCheck({ kind: "cuid", ...errorUtil_1.errorUtil.errToObj(message) });
844
+ return this._addCheck({ kind: "cuid", ...errorUtil_js_1.errorUtil.errToObj(message) });
861
845
  }
862
846
  cuid2(message) {
863
- return this._addCheck({ kind: "cuid2", ...errorUtil_1.errorUtil.errToObj(message) });
847
+ return this._addCheck({ kind: "cuid2", ...errorUtil_js_1.errorUtil.errToObj(message) });
864
848
  }
865
849
  ulid(message) {
866
- return this._addCheck({ kind: "ulid", ...errorUtil_1.errorUtil.errToObj(message) });
850
+ return this._addCheck({ kind: "ulid", ...errorUtil_js_1.errorUtil.errToObj(message) });
867
851
  }
868
852
  base64(message) {
869
- return this._addCheck({ kind: "base64", ...errorUtil_1.errorUtil.errToObj(message) });
853
+ return this._addCheck({ kind: "base64", ...errorUtil_js_1.errorUtil.errToObj(message) });
870
854
  }
871
855
  base64url(message) {
872
856
  // base64url encoding is a modification of base64 that can safely be used in URLs and filenames
873
857
  return this._addCheck({
874
858
  kind: "base64url",
875
- ...errorUtil_1.errorUtil.errToObj(message),
859
+ ...errorUtil_js_1.errorUtil.errToObj(message),
876
860
  });
877
861
  }
878
862
  jwt(options) {
879
- return this._addCheck({ kind: "jwt", ...errorUtil_1.errorUtil.errToObj(options) });
863
+ return this._addCheck({ kind: "jwt", ...errorUtil_js_1.errorUtil.errToObj(options) });
880
864
  }
881
865
  ip(options) {
882
- return this._addCheck({ kind: "ip", ...errorUtil_1.errorUtil.errToObj(options) });
866
+ return this._addCheck({ kind: "ip", ...errorUtil_js_1.errorUtil.errToObj(options) });
883
867
  }
884
868
  cidr(options) {
885
- return this._addCheck({ kind: "cidr", ...errorUtil_1.errorUtil.errToObj(options) });
869
+ return this._addCheck({ kind: "cidr", ...errorUtil_js_1.errorUtil.errToObj(options) });
886
870
  }
887
871
  datetime(options) {
888
- var _a, _b;
889
872
  if (typeof options === "string") {
890
873
  return this._addCheck({
891
874
  kind: "datetime",
@@ -897,10 +880,10 @@ class ZodString extends ZodType {
897
880
  }
898
881
  return this._addCheck({
899
882
  kind: "datetime",
900
- precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
901
- offset: (_a = options === null || options === void 0 ? void 0 : options.offset) !== null && _a !== void 0 ? _a : false,
902
- local: (_b = options === null || options === void 0 ? void 0 : options.local) !== null && _b !== void 0 ? _b : false,
903
- ...errorUtil_1.errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message),
883
+ precision: typeof options?.precision === "undefined" ? null : options?.precision,
884
+ offset: options?.offset ?? false,
885
+ local: options?.local ?? false,
886
+ ...errorUtil_js_1.errorUtil.errToObj(options?.message),
904
887
  });
905
888
  }
906
889
  date(message) {
@@ -916,68 +899,68 @@ class ZodString extends ZodType {
916
899
  }
917
900
  return this._addCheck({
918
901
  kind: "time",
919
- precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
920
- ...errorUtil_1.errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message),
902
+ precision: typeof options?.precision === "undefined" ? null : options?.precision,
903
+ ...errorUtil_js_1.errorUtil.errToObj(options?.message),
921
904
  });
922
905
  }
923
906
  duration(message) {
924
- return this._addCheck({ kind: "duration", ...errorUtil_1.errorUtil.errToObj(message) });
907
+ return this._addCheck({ kind: "duration", ...errorUtil_js_1.errorUtil.errToObj(message) });
925
908
  }
926
909
  regex(regex, message) {
927
910
  return this._addCheck({
928
911
  kind: "regex",
929
912
  regex: regex,
930
- ...errorUtil_1.errorUtil.errToObj(message),
913
+ ...errorUtil_js_1.errorUtil.errToObj(message),
931
914
  });
932
915
  }
933
916
  includes(value, options) {
934
917
  return this._addCheck({
935
918
  kind: "includes",
936
919
  value: value,
937
- position: options === null || options === void 0 ? void 0 : options.position,
938
- ...errorUtil_1.errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message),
920
+ position: options?.position,
921
+ ...errorUtil_js_1.errorUtil.errToObj(options?.message),
939
922
  });
940
923
  }
941
924
  startsWith(value, message) {
942
925
  return this._addCheck({
943
926
  kind: "startsWith",
944
927
  value: value,
945
- ...errorUtil_1.errorUtil.errToObj(message),
928
+ ...errorUtil_js_1.errorUtil.errToObj(message),
946
929
  });
947
930
  }
948
931
  endsWith(value, message) {
949
932
  return this._addCheck({
950
933
  kind: "endsWith",
951
934
  value: value,
952
- ...errorUtil_1.errorUtil.errToObj(message),
935
+ ...errorUtil_js_1.errorUtil.errToObj(message),
953
936
  });
954
937
  }
955
938
  min(minLength, message) {
956
939
  return this._addCheck({
957
940
  kind: "min",
958
941
  value: minLength,
959
- ...errorUtil_1.errorUtil.errToObj(message),
942
+ ...errorUtil_js_1.errorUtil.errToObj(message),
960
943
  });
961
944
  }
962
945
  max(maxLength, message) {
963
946
  return this._addCheck({
964
947
  kind: "max",
965
948
  value: maxLength,
966
- ...errorUtil_1.errorUtil.errToObj(message),
949
+ ...errorUtil_js_1.errorUtil.errToObj(message),
967
950
  });
968
951
  }
969
952
  length(len, message) {
970
953
  return this._addCheck({
971
954
  kind: "length",
972
955
  value: len,
973
- ...errorUtil_1.errorUtil.errToObj(message),
956
+ ...errorUtil_js_1.errorUtil.errToObj(message),
974
957
  });
975
958
  }
976
959
  /**
977
960
  * Equivalent to `.min(1)`
978
961
  */
979
962
  nonempty(message) {
980
- return this.min(1, errorUtil_1.errorUtil.errToObj(message));
963
+ return this.min(1, errorUtil_js_1.errorUtil.errToObj(message));
981
964
  }
982
965
  trim() {
983
966
  return new ZodString({
@@ -1069,11 +1052,10 @@ class ZodString extends ZodType {
1069
1052
  }
1070
1053
  exports.ZodString = ZodString;
1071
1054
  ZodString.create = (params) => {
1072
- var _a;
1073
1055
  return new ZodString({
1074
1056
  checks: [],
1075
1057
  typeName: ZodFirstPartyTypeKind.ZodString,
1076
- coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false,
1058
+ coerce: params?.coerce ?? false,
1077
1059
  ...processCreateParams(params),
1078
1060
  });
1079
1061
  };
@@ -1082,9 +1064,9 @@ function floatSafeRemainder(val, step) {
1082
1064
  const valDecCount = (val.toString().split(".")[1] || "").length;
1083
1065
  const stepDecCount = (step.toString().split(".")[1] || "").length;
1084
1066
  const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
1085
- const valInt = parseInt(val.toFixed(decCount).replace(".", ""));
1086
- const stepInt = parseInt(step.toFixed(decCount).replace(".", ""));
1087
- return (valInt % stepInt) / Math.pow(10, decCount);
1067
+ const valInt = Number.parseInt(val.toFixed(decCount).replace(".", ""));
1068
+ const stepInt = Number.parseInt(step.toFixed(decCount).replace(".", ""));
1069
+ return (valInt % stepInt) / 10 ** decCount;
1088
1070
  }
1089
1071
  class ZodNumber extends ZodType {
1090
1072
  constructor() {
@@ -1098,23 +1080,23 @@ class ZodNumber extends ZodType {
1098
1080
  input.data = Number(input.data);
1099
1081
  }
1100
1082
  const parsedType = this._getType(input);
1101
- if (parsedType !== util_1.ZodParsedType.number) {
1083
+ if (parsedType !== util_js_1.ZodParsedType.number) {
1102
1084
  const ctx = this._getOrReturnCtx(input);
1103
- (0, parseUtil_1.addIssueToContext)(ctx, {
1104
- code: ZodError_1.ZodIssueCode.invalid_type,
1105
- expected: util_1.ZodParsedType.number,
1085
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
1086
+ code: ZodError_js_1.ZodIssueCode.invalid_type,
1087
+ expected: util_js_1.ZodParsedType.number,
1106
1088
  received: ctx.parsedType,
1107
1089
  });
1108
- return parseUtil_1.INVALID;
1090
+ return parseUtil_js_1.INVALID;
1109
1091
  }
1110
1092
  let ctx = undefined;
1111
- const status = new parseUtil_1.ParseStatus();
1093
+ const status = new parseUtil_js_1.ParseStatus();
1112
1094
  for (const check of this._def.checks) {
1113
1095
  if (check.kind === "int") {
1114
- if (!util_1.util.isInteger(input.data)) {
1096
+ if (!util_js_1.util.isInteger(input.data)) {
1115
1097
  ctx = this._getOrReturnCtx(input, ctx);
1116
- (0, parseUtil_1.addIssueToContext)(ctx, {
1117
- code: ZodError_1.ZodIssueCode.invalid_type,
1098
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
1099
+ code: ZodError_js_1.ZodIssueCode.invalid_type,
1118
1100
  expected: "integer",
1119
1101
  received: "float",
1120
1102
  message: check.message,
@@ -1123,13 +1105,11 @@ class ZodNumber extends ZodType {
1123
1105
  }
1124
1106
  }
1125
1107
  else if (check.kind === "min") {
1126
- const tooSmall = check.inclusive
1127
- ? input.data < check.value
1128
- : input.data <= check.value;
1108
+ const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value;
1129
1109
  if (tooSmall) {
1130
1110
  ctx = this._getOrReturnCtx(input, ctx);
1131
- (0, parseUtil_1.addIssueToContext)(ctx, {
1132
- code: ZodError_1.ZodIssueCode.too_small,
1111
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
1112
+ code: ZodError_js_1.ZodIssueCode.too_small,
1133
1113
  minimum: check.value,
1134
1114
  type: "number",
1135
1115
  inclusive: check.inclusive,
@@ -1140,13 +1120,11 @@ class ZodNumber extends ZodType {
1140
1120
  }
1141
1121
  }
1142
1122
  else if (check.kind === "max") {
1143
- const tooBig = check.inclusive
1144
- ? input.data > check.value
1145
- : input.data >= check.value;
1123
+ const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value;
1146
1124
  if (tooBig) {
1147
1125
  ctx = this._getOrReturnCtx(input, ctx);
1148
- (0, parseUtil_1.addIssueToContext)(ctx, {
1149
- code: ZodError_1.ZodIssueCode.too_big,
1126
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
1127
+ code: ZodError_js_1.ZodIssueCode.too_big,
1150
1128
  maximum: check.value,
1151
1129
  type: "number",
1152
1130
  inclusive: check.inclusive,
@@ -1159,8 +1137,8 @@ class ZodNumber extends ZodType {
1159
1137
  else if (check.kind === "multipleOf") {
1160
1138
  if (floatSafeRemainder(input.data, check.value) !== 0) {
1161
1139
  ctx = this._getOrReturnCtx(input, ctx);
1162
- (0, parseUtil_1.addIssueToContext)(ctx, {
1163
- code: ZodError_1.ZodIssueCode.not_multiple_of,
1140
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
1141
+ code: ZodError_js_1.ZodIssueCode.not_multiple_of,
1164
1142
  multipleOf: check.value,
1165
1143
  message: check.message,
1166
1144
  });
@@ -1170,30 +1148,30 @@ class ZodNumber extends ZodType {
1170
1148
  else if (check.kind === "finite") {
1171
1149
  if (!Number.isFinite(input.data)) {
1172
1150
  ctx = this._getOrReturnCtx(input, ctx);
1173
- (0, parseUtil_1.addIssueToContext)(ctx, {
1174
- code: ZodError_1.ZodIssueCode.not_finite,
1151
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
1152
+ code: ZodError_js_1.ZodIssueCode.not_finite,
1175
1153
  message: check.message,
1176
1154
  });
1177
1155
  status.dirty();
1178
1156
  }
1179
1157
  }
1180
1158
  else {
1181
- util_1.util.assertNever(check);
1159
+ util_js_1.util.assertNever(check);
1182
1160
  }
1183
1161
  }
1184
1162
  return { status: status.value, value: input.data };
1185
1163
  }
1186
1164
  gte(value, message) {
1187
- return this.setLimit("min", value, true, errorUtil_1.errorUtil.toString(message));
1165
+ return this.setLimit("min", value, true, errorUtil_js_1.errorUtil.toString(message));
1188
1166
  }
1189
1167
  gt(value, message) {
1190
- return this.setLimit("min", value, false, errorUtil_1.errorUtil.toString(message));
1168
+ return this.setLimit("min", value, false, errorUtil_js_1.errorUtil.toString(message));
1191
1169
  }
1192
1170
  lte(value, message) {
1193
- return this.setLimit("max", value, true, errorUtil_1.errorUtil.toString(message));
1171
+ return this.setLimit("max", value, true, errorUtil_js_1.errorUtil.toString(message));
1194
1172
  }
1195
1173
  lt(value, message) {
1196
- return this.setLimit("max", value, false, errorUtil_1.errorUtil.toString(message));
1174
+ return this.setLimit("max", value, false, errorUtil_js_1.errorUtil.toString(message));
1197
1175
  }
1198
1176
  setLimit(kind, value, inclusive, message) {
1199
1177
  return new ZodNumber({
@@ -1204,7 +1182,7 @@ class ZodNumber extends ZodType {
1204
1182
  kind,
1205
1183
  value,
1206
1184
  inclusive,
1207
- message: errorUtil_1.errorUtil.toString(message),
1185
+ message: errorUtil_js_1.errorUtil.toString(message),
1208
1186
  },
1209
1187
  ],
1210
1188
  });
@@ -1218,7 +1196,7 @@ class ZodNumber extends ZodType {
1218
1196
  int(message) {
1219
1197
  return this._addCheck({
1220
1198
  kind: "int",
1221
- message: errorUtil_1.errorUtil.toString(message),
1199
+ message: errorUtil_js_1.errorUtil.toString(message),
1222
1200
  });
1223
1201
  }
1224
1202
  positive(message) {
@@ -1226,7 +1204,7 @@ class ZodNumber extends ZodType {
1226
1204
  kind: "min",
1227
1205
  value: 0,
1228
1206
  inclusive: false,
1229
- message: errorUtil_1.errorUtil.toString(message),
1207
+ message: errorUtil_js_1.errorUtil.toString(message),
1230
1208
  });
1231
1209
  }
1232
1210
  negative(message) {
@@ -1234,7 +1212,7 @@ class ZodNumber extends ZodType {
1234
1212
  kind: "max",
1235
1213
  value: 0,
1236
1214
  inclusive: false,
1237
- message: errorUtil_1.errorUtil.toString(message),
1215
+ message: errorUtil_js_1.errorUtil.toString(message),
1238
1216
  });
1239
1217
  }
1240
1218
  nonpositive(message) {
@@ -1242,7 +1220,7 @@ class ZodNumber extends ZodType {
1242
1220
  kind: "max",
1243
1221
  value: 0,
1244
1222
  inclusive: true,
1245
- message: errorUtil_1.errorUtil.toString(message),
1223
+ message: errorUtil_js_1.errorUtil.toString(message),
1246
1224
  });
1247
1225
  }
1248
1226
  nonnegative(message) {
@@ -1250,20 +1228,20 @@ class ZodNumber extends ZodType {
1250
1228
  kind: "min",
1251
1229
  value: 0,
1252
1230
  inclusive: true,
1253
- message: errorUtil_1.errorUtil.toString(message),
1231
+ message: errorUtil_js_1.errorUtil.toString(message),
1254
1232
  });
1255
1233
  }
1256
1234
  multipleOf(value, message) {
1257
1235
  return this._addCheck({
1258
1236
  kind: "multipleOf",
1259
1237
  value: value,
1260
- message: errorUtil_1.errorUtil.toString(message),
1238
+ message: errorUtil_js_1.errorUtil.toString(message),
1261
1239
  });
1262
1240
  }
1263
1241
  finite(message) {
1264
1242
  return this._addCheck({
1265
1243
  kind: "finite",
1266
- message: errorUtil_1.errorUtil.toString(message),
1244
+ message: errorUtil_js_1.errorUtil.toString(message),
1267
1245
  });
1268
1246
  }
1269
1247
  safe(message) {
@@ -1271,12 +1249,12 @@ class ZodNumber extends ZodType {
1271
1249
  kind: "min",
1272
1250
  inclusive: true,
1273
1251
  value: Number.MIN_SAFE_INTEGER,
1274
- message: errorUtil_1.errorUtil.toString(message),
1252
+ message: errorUtil_js_1.errorUtil.toString(message),
1275
1253
  })._addCheck({
1276
1254
  kind: "max",
1277
1255
  inclusive: true,
1278
1256
  value: Number.MAX_SAFE_INTEGER,
1279
- message: errorUtil_1.errorUtil.toString(message),
1257
+ message: errorUtil_js_1.errorUtil.toString(message),
1280
1258
  });
1281
1259
  }
1282
1260
  get minValue() {
@@ -1300,15 +1278,13 @@ class ZodNumber extends ZodType {
1300
1278
  return max;
1301
1279
  }
1302
1280
  get isInt() {
1303
- return !!this._def.checks.find((ch) => ch.kind === "int" ||
1304
- (ch.kind === "multipleOf" && util_1.util.isInteger(ch.value)));
1281
+ return !!this._def.checks.find((ch) => ch.kind === "int" || (ch.kind === "multipleOf" && util_js_1.util.isInteger(ch.value)));
1305
1282
  }
1306
1283
  get isFinite() {
1307
- let max = null, min = null;
1284
+ let max = null;
1285
+ let min = null;
1308
1286
  for (const ch of this._def.checks) {
1309
- if (ch.kind === "finite" ||
1310
- ch.kind === "int" ||
1311
- ch.kind === "multipleOf") {
1287
+ if (ch.kind === "finite" || ch.kind === "int" || ch.kind === "multipleOf") {
1312
1288
  return true;
1313
1289
  }
1314
1290
  else if (ch.kind === "min") {
@@ -1328,7 +1304,7 @@ ZodNumber.create = (params) => {
1328
1304
  return new ZodNumber({
1329
1305
  checks: [],
1330
1306
  typeName: ZodFirstPartyTypeKind.ZodNumber,
1331
- coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
1307
+ coerce: params?.coerce || false,
1332
1308
  ...processCreateParams(params),
1333
1309
  });
1334
1310
  };
@@ -1343,25 +1319,23 @@ class ZodBigInt extends ZodType {
1343
1319
  try {
1344
1320
  input.data = BigInt(input.data);
1345
1321
  }
1346
- catch (_a) {
1322
+ catch {
1347
1323
  return this._getInvalidInput(input);
1348
1324
  }
1349
1325
  }
1350
1326
  const parsedType = this._getType(input);
1351
- if (parsedType !== util_1.ZodParsedType.bigint) {
1327
+ if (parsedType !== util_js_1.ZodParsedType.bigint) {
1352
1328
  return this._getInvalidInput(input);
1353
1329
  }
1354
1330
  let ctx = undefined;
1355
- const status = new parseUtil_1.ParseStatus();
1331
+ const status = new parseUtil_js_1.ParseStatus();
1356
1332
  for (const check of this._def.checks) {
1357
1333
  if (check.kind === "min") {
1358
- const tooSmall = check.inclusive
1359
- ? input.data < check.value
1360
- : input.data <= check.value;
1334
+ const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value;
1361
1335
  if (tooSmall) {
1362
1336
  ctx = this._getOrReturnCtx(input, ctx);
1363
- (0, parseUtil_1.addIssueToContext)(ctx, {
1364
- code: ZodError_1.ZodIssueCode.too_small,
1337
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
1338
+ code: ZodError_js_1.ZodIssueCode.too_small,
1365
1339
  type: "bigint",
1366
1340
  minimum: check.value,
1367
1341
  inclusive: check.inclusive,
@@ -1371,13 +1345,11 @@ class ZodBigInt extends ZodType {
1371
1345
  }
1372
1346
  }
1373
1347
  else if (check.kind === "max") {
1374
- const tooBig = check.inclusive
1375
- ? input.data > check.value
1376
- : input.data >= check.value;
1348
+ const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value;
1377
1349
  if (tooBig) {
1378
1350
  ctx = this._getOrReturnCtx(input, ctx);
1379
- (0, parseUtil_1.addIssueToContext)(ctx, {
1380
- code: ZodError_1.ZodIssueCode.too_big,
1351
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
1352
+ code: ZodError_js_1.ZodIssueCode.too_big,
1381
1353
  type: "bigint",
1382
1354
  maximum: check.value,
1383
1355
  inclusive: check.inclusive,
@@ -1389,8 +1361,8 @@ class ZodBigInt extends ZodType {
1389
1361
  else if (check.kind === "multipleOf") {
1390
1362
  if (input.data % check.value !== BigInt(0)) {
1391
1363
  ctx = this._getOrReturnCtx(input, ctx);
1392
- (0, parseUtil_1.addIssueToContext)(ctx, {
1393
- code: ZodError_1.ZodIssueCode.not_multiple_of,
1364
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
1365
+ code: ZodError_js_1.ZodIssueCode.not_multiple_of,
1394
1366
  multipleOf: check.value,
1395
1367
  message: check.message,
1396
1368
  });
@@ -1398,31 +1370,31 @@ class ZodBigInt extends ZodType {
1398
1370
  }
1399
1371
  }
1400
1372
  else {
1401
- util_1.util.assertNever(check);
1373
+ util_js_1.util.assertNever(check);
1402
1374
  }
1403
1375
  }
1404
1376
  return { status: status.value, value: input.data };
1405
1377
  }
1406
1378
  _getInvalidInput(input) {
1407
1379
  const ctx = this._getOrReturnCtx(input);
1408
- (0, parseUtil_1.addIssueToContext)(ctx, {
1409
- code: ZodError_1.ZodIssueCode.invalid_type,
1410
- expected: util_1.ZodParsedType.bigint,
1380
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
1381
+ code: ZodError_js_1.ZodIssueCode.invalid_type,
1382
+ expected: util_js_1.ZodParsedType.bigint,
1411
1383
  received: ctx.parsedType,
1412
1384
  });
1413
- return parseUtil_1.INVALID;
1385
+ return parseUtil_js_1.INVALID;
1414
1386
  }
1415
1387
  gte(value, message) {
1416
- return this.setLimit("min", value, true, errorUtil_1.errorUtil.toString(message));
1388
+ return this.setLimit("min", value, true, errorUtil_js_1.errorUtil.toString(message));
1417
1389
  }
1418
1390
  gt(value, message) {
1419
- return this.setLimit("min", value, false, errorUtil_1.errorUtil.toString(message));
1391
+ return this.setLimit("min", value, false, errorUtil_js_1.errorUtil.toString(message));
1420
1392
  }
1421
1393
  lte(value, message) {
1422
- return this.setLimit("max", value, true, errorUtil_1.errorUtil.toString(message));
1394
+ return this.setLimit("max", value, true, errorUtil_js_1.errorUtil.toString(message));
1423
1395
  }
1424
1396
  lt(value, message) {
1425
- return this.setLimit("max", value, false, errorUtil_1.errorUtil.toString(message));
1397
+ return this.setLimit("max", value, false, errorUtil_js_1.errorUtil.toString(message));
1426
1398
  }
1427
1399
  setLimit(kind, value, inclusive, message) {
1428
1400
  return new ZodBigInt({
@@ -1433,7 +1405,7 @@ class ZodBigInt extends ZodType {
1433
1405
  kind,
1434
1406
  value,
1435
1407
  inclusive,
1436
- message: errorUtil_1.errorUtil.toString(message),
1408
+ message: errorUtil_js_1.errorUtil.toString(message),
1437
1409
  },
1438
1410
  ],
1439
1411
  });
@@ -1449,7 +1421,7 @@ class ZodBigInt extends ZodType {
1449
1421
  kind: "min",
1450
1422
  value: BigInt(0),
1451
1423
  inclusive: false,
1452
- message: errorUtil_1.errorUtil.toString(message),
1424
+ message: errorUtil_js_1.errorUtil.toString(message),
1453
1425
  });
1454
1426
  }
1455
1427
  negative(message) {
@@ -1457,7 +1429,7 @@ class ZodBigInt extends ZodType {
1457
1429
  kind: "max",
1458
1430
  value: BigInt(0),
1459
1431
  inclusive: false,
1460
- message: errorUtil_1.errorUtil.toString(message),
1432
+ message: errorUtil_js_1.errorUtil.toString(message),
1461
1433
  });
1462
1434
  }
1463
1435
  nonpositive(message) {
@@ -1465,7 +1437,7 @@ class ZodBigInt extends ZodType {
1465
1437
  kind: "max",
1466
1438
  value: BigInt(0),
1467
1439
  inclusive: true,
1468
- message: errorUtil_1.errorUtil.toString(message),
1440
+ message: errorUtil_js_1.errorUtil.toString(message),
1469
1441
  });
1470
1442
  }
1471
1443
  nonnegative(message) {
@@ -1473,14 +1445,14 @@ class ZodBigInt extends ZodType {
1473
1445
  kind: "min",
1474
1446
  value: BigInt(0),
1475
1447
  inclusive: true,
1476
- message: errorUtil_1.errorUtil.toString(message),
1448
+ message: errorUtil_js_1.errorUtil.toString(message),
1477
1449
  });
1478
1450
  }
1479
1451
  multipleOf(value, message) {
1480
1452
  return this._addCheck({
1481
1453
  kind: "multipleOf",
1482
1454
  value,
1483
- message: errorUtil_1.errorUtil.toString(message),
1455
+ message: errorUtil_js_1.errorUtil.toString(message),
1484
1456
  });
1485
1457
  }
1486
1458
  get minValue() {
@@ -1506,11 +1478,10 @@ class ZodBigInt extends ZodType {
1506
1478
  }
1507
1479
  exports.ZodBigInt = ZodBigInt;
1508
1480
  ZodBigInt.create = (params) => {
1509
- var _a;
1510
1481
  return new ZodBigInt({
1511
1482
  checks: [],
1512
1483
  typeName: ZodFirstPartyTypeKind.ZodBigInt,
1513
- coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false,
1484
+ coerce: params?.coerce ?? false,
1514
1485
  ...processCreateParams(params),
1515
1486
  });
1516
1487
  };
@@ -1520,23 +1491,23 @@ class ZodBoolean extends ZodType {
1520
1491
  input.data = Boolean(input.data);
1521
1492
  }
1522
1493
  const parsedType = this._getType(input);
1523
- if (parsedType !== util_1.ZodParsedType.boolean) {
1494
+ if (parsedType !== util_js_1.ZodParsedType.boolean) {
1524
1495
  const ctx = this._getOrReturnCtx(input);
1525
- (0, parseUtil_1.addIssueToContext)(ctx, {
1526
- code: ZodError_1.ZodIssueCode.invalid_type,
1527
- expected: util_1.ZodParsedType.boolean,
1496
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
1497
+ code: ZodError_js_1.ZodIssueCode.invalid_type,
1498
+ expected: util_js_1.ZodParsedType.boolean,
1528
1499
  received: ctx.parsedType,
1529
1500
  });
1530
- return parseUtil_1.INVALID;
1501
+ return parseUtil_js_1.INVALID;
1531
1502
  }
1532
- return (0, parseUtil_1.OK)(input.data);
1503
+ return (0, parseUtil_js_1.OK)(input.data);
1533
1504
  }
1534
1505
  }
1535
1506
  exports.ZodBoolean = ZodBoolean;
1536
1507
  ZodBoolean.create = (params) => {
1537
1508
  return new ZodBoolean({
1538
1509
  typeName: ZodFirstPartyTypeKind.ZodBoolean,
1539
- coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
1510
+ coerce: params?.coerce || false,
1540
1511
  ...processCreateParams(params),
1541
1512
  });
1542
1513
  };
@@ -1546,30 +1517,30 @@ class ZodDate extends ZodType {
1546
1517
  input.data = new Date(input.data);
1547
1518
  }
1548
1519
  const parsedType = this._getType(input);
1549
- if (parsedType !== util_1.ZodParsedType.date) {
1520
+ if (parsedType !== util_js_1.ZodParsedType.date) {
1550
1521
  const ctx = this._getOrReturnCtx(input);
1551
- (0, parseUtil_1.addIssueToContext)(ctx, {
1552
- code: ZodError_1.ZodIssueCode.invalid_type,
1553
- expected: util_1.ZodParsedType.date,
1522
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
1523
+ code: ZodError_js_1.ZodIssueCode.invalid_type,
1524
+ expected: util_js_1.ZodParsedType.date,
1554
1525
  received: ctx.parsedType,
1555
1526
  });
1556
- return parseUtil_1.INVALID;
1527
+ return parseUtil_js_1.INVALID;
1557
1528
  }
1558
- if (isNaN(input.data.getTime())) {
1529
+ if (Number.isNaN(input.data.getTime())) {
1559
1530
  const ctx = this._getOrReturnCtx(input);
1560
- (0, parseUtil_1.addIssueToContext)(ctx, {
1561
- code: ZodError_1.ZodIssueCode.invalid_date,
1531
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
1532
+ code: ZodError_js_1.ZodIssueCode.invalid_date,
1562
1533
  });
1563
- return parseUtil_1.INVALID;
1534
+ return parseUtil_js_1.INVALID;
1564
1535
  }
1565
- const status = new parseUtil_1.ParseStatus();
1536
+ const status = new parseUtil_js_1.ParseStatus();
1566
1537
  let ctx = undefined;
1567
1538
  for (const check of this._def.checks) {
1568
1539
  if (check.kind === "min") {
1569
1540
  if (input.data.getTime() < check.value) {
1570
1541
  ctx = this._getOrReturnCtx(input, ctx);
1571
- (0, parseUtil_1.addIssueToContext)(ctx, {
1572
- code: ZodError_1.ZodIssueCode.too_small,
1542
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
1543
+ code: ZodError_js_1.ZodIssueCode.too_small,
1573
1544
  message: check.message,
1574
1545
  inclusive: true,
1575
1546
  exact: false,
@@ -1582,8 +1553,8 @@ class ZodDate extends ZodType {
1582
1553
  else if (check.kind === "max") {
1583
1554
  if (input.data.getTime() > check.value) {
1584
1555
  ctx = this._getOrReturnCtx(input, ctx);
1585
- (0, parseUtil_1.addIssueToContext)(ctx, {
1586
- code: ZodError_1.ZodIssueCode.too_big,
1556
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
1557
+ code: ZodError_js_1.ZodIssueCode.too_big,
1587
1558
  message: check.message,
1588
1559
  inclusive: true,
1589
1560
  exact: false,
@@ -1594,7 +1565,7 @@ class ZodDate extends ZodType {
1594
1565
  }
1595
1566
  }
1596
1567
  else {
1597
- util_1.util.assertNever(check);
1568
+ util_js_1.util.assertNever(check);
1598
1569
  }
1599
1570
  }
1600
1571
  return {
@@ -1612,14 +1583,14 @@ class ZodDate extends ZodType {
1612
1583
  return this._addCheck({
1613
1584
  kind: "min",
1614
1585
  value: minDate.getTime(),
1615
- message: errorUtil_1.errorUtil.toString(message),
1586
+ message: errorUtil_js_1.errorUtil.toString(message),
1616
1587
  });
1617
1588
  }
1618
1589
  max(maxDate, message) {
1619
1590
  return this._addCheck({
1620
1591
  kind: "max",
1621
1592
  value: maxDate.getTime(),
1622
- message: errorUtil_1.errorUtil.toString(message),
1593
+ message: errorUtil_js_1.errorUtil.toString(message),
1623
1594
  });
1624
1595
  }
1625
1596
  get minDate() {
@@ -1647,7 +1618,7 @@ exports.ZodDate = ZodDate;
1647
1618
  ZodDate.create = (params) => {
1648
1619
  return new ZodDate({
1649
1620
  checks: [],
1650
- coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
1621
+ coerce: params?.coerce || false,
1651
1622
  typeName: ZodFirstPartyTypeKind.ZodDate,
1652
1623
  ...processCreateParams(params),
1653
1624
  });
@@ -1655,16 +1626,16 @@ ZodDate.create = (params) => {
1655
1626
  class ZodSymbol extends ZodType {
1656
1627
  _parse(input) {
1657
1628
  const parsedType = this._getType(input);
1658
- if (parsedType !== util_1.ZodParsedType.symbol) {
1629
+ if (parsedType !== util_js_1.ZodParsedType.symbol) {
1659
1630
  const ctx = this._getOrReturnCtx(input);
1660
- (0, parseUtil_1.addIssueToContext)(ctx, {
1661
- code: ZodError_1.ZodIssueCode.invalid_type,
1662
- expected: util_1.ZodParsedType.symbol,
1631
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
1632
+ code: ZodError_js_1.ZodIssueCode.invalid_type,
1633
+ expected: util_js_1.ZodParsedType.symbol,
1663
1634
  received: ctx.parsedType,
1664
1635
  });
1665
- return parseUtil_1.INVALID;
1636
+ return parseUtil_js_1.INVALID;
1666
1637
  }
1667
- return (0, parseUtil_1.OK)(input.data);
1638
+ return (0, parseUtil_js_1.OK)(input.data);
1668
1639
  }
1669
1640
  }
1670
1641
  exports.ZodSymbol = ZodSymbol;
@@ -1677,16 +1648,16 @@ ZodSymbol.create = (params) => {
1677
1648
  class ZodUndefined extends ZodType {
1678
1649
  _parse(input) {
1679
1650
  const parsedType = this._getType(input);
1680
- if (parsedType !== util_1.ZodParsedType.undefined) {
1651
+ if (parsedType !== util_js_1.ZodParsedType.undefined) {
1681
1652
  const ctx = this._getOrReturnCtx(input);
1682
- (0, parseUtil_1.addIssueToContext)(ctx, {
1683
- code: ZodError_1.ZodIssueCode.invalid_type,
1684
- expected: util_1.ZodParsedType.undefined,
1653
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
1654
+ code: ZodError_js_1.ZodIssueCode.invalid_type,
1655
+ expected: util_js_1.ZodParsedType.undefined,
1685
1656
  received: ctx.parsedType,
1686
1657
  });
1687
- return parseUtil_1.INVALID;
1658
+ return parseUtil_js_1.INVALID;
1688
1659
  }
1689
- return (0, parseUtil_1.OK)(input.data);
1660
+ return (0, parseUtil_js_1.OK)(input.data);
1690
1661
  }
1691
1662
  }
1692
1663
  exports.ZodUndefined = ZodUndefined;
@@ -1699,16 +1670,16 @@ ZodUndefined.create = (params) => {
1699
1670
  class ZodNull extends ZodType {
1700
1671
  _parse(input) {
1701
1672
  const parsedType = this._getType(input);
1702
- if (parsedType !== util_1.ZodParsedType.null) {
1673
+ if (parsedType !== util_js_1.ZodParsedType.null) {
1703
1674
  const ctx = this._getOrReturnCtx(input);
1704
- (0, parseUtil_1.addIssueToContext)(ctx, {
1705
- code: ZodError_1.ZodIssueCode.invalid_type,
1706
- expected: util_1.ZodParsedType.null,
1675
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
1676
+ code: ZodError_js_1.ZodIssueCode.invalid_type,
1677
+ expected: util_js_1.ZodParsedType.null,
1707
1678
  received: ctx.parsedType,
1708
1679
  });
1709
- return parseUtil_1.INVALID;
1680
+ return parseUtil_js_1.INVALID;
1710
1681
  }
1711
- return (0, parseUtil_1.OK)(input.data);
1682
+ return (0, parseUtil_js_1.OK)(input.data);
1712
1683
  }
1713
1684
  }
1714
1685
  exports.ZodNull = ZodNull;
@@ -1725,7 +1696,7 @@ class ZodAny extends ZodType {
1725
1696
  this._any = true;
1726
1697
  }
1727
1698
  _parse(input) {
1728
- return (0, parseUtil_1.OK)(input.data);
1699
+ return (0, parseUtil_js_1.OK)(input.data);
1729
1700
  }
1730
1701
  }
1731
1702
  exports.ZodAny = ZodAny;
@@ -1742,7 +1713,7 @@ class ZodUnknown extends ZodType {
1742
1713
  this._unknown = true;
1743
1714
  }
1744
1715
  _parse(input) {
1745
- return (0, parseUtil_1.OK)(input.data);
1716
+ return (0, parseUtil_js_1.OK)(input.data);
1746
1717
  }
1747
1718
  }
1748
1719
  exports.ZodUnknown = ZodUnknown;
@@ -1755,12 +1726,12 @@ ZodUnknown.create = (params) => {
1755
1726
  class ZodNever extends ZodType {
1756
1727
  _parse(input) {
1757
1728
  const ctx = this._getOrReturnCtx(input);
1758
- (0, parseUtil_1.addIssueToContext)(ctx, {
1759
- code: ZodError_1.ZodIssueCode.invalid_type,
1760
- expected: util_1.ZodParsedType.never,
1729
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
1730
+ code: ZodError_js_1.ZodIssueCode.invalid_type,
1731
+ expected: util_js_1.ZodParsedType.never,
1761
1732
  received: ctx.parsedType,
1762
1733
  });
1763
- return parseUtil_1.INVALID;
1734
+ return parseUtil_js_1.INVALID;
1764
1735
  }
1765
1736
  }
1766
1737
  exports.ZodNever = ZodNever;
@@ -1773,16 +1744,16 @@ ZodNever.create = (params) => {
1773
1744
  class ZodVoid extends ZodType {
1774
1745
  _parse(input) {
1775
1746
  const parsedType = this._getType(input);
1776
- if (parsedType !== util_1.ZodParsedType.undefined) {
1747
+ if (parsedType !== util_js_1.ZodParsedType.undefined) {
1777
1748
  const ctx = this._getOrReturnCtx(input);
1778
- (0, parseUtil_1.addIssueToContext)(ctx, {
1779
- code: ZodError_1.ZodIssueCode.invalid_type,
1780
- expected: util_1.ZodParsedType.void,
1749
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
1750
+ code: ZodError_js_1.ZodIssueCode.invalid_type,
1751
+ expected: util_js_1.ZodParsedType.void,
1781
1752
  received: ctx.parsedType,
1782
1753
  });
1783
- return parseUtil_1.INVALID;
1754
+ return parseUtil_js_1.INVALID;
1784
1755
  }
1785
- return (0, parseUtil_1.OK)(input.data);
1756
+ return (0, parseUtil_js_1.OK)(input.data);
1786
1757
  }
1787
1758
  }
1788
1759
  exports.ZodVoid = ZodVoid;
@@ -1796,20 +1767,20 @@ class ZodArray extends ZodType {
1796
1767
  _parse(input) {
1797
1768
  const { ctx, status } = this._processInputParams(input);
1798
1769
  const def = this._def;
1799
- if (ctx.parsedType !== util_1.ZodParsedType.array) {
1800
- (0, parseUtil_1.addIssueToContext)(ctx, {
1801
- code: ZodError_1.ZodIssueCode.invalid_type,
1802
- expected: util_1.ZodParsedType.array,
1770
+ if (ctx.parsedType !== util_js_1.ZodParsedType.array) {
1771
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
1772
+ code: ZodError_js_1.ZodIssueCode.invalid_type,
1773
+ expected: util_js_1.ZodParsedType.array,
1803
1774
  received: ctx.parsedType,
1804
1775
  });
1805
- return parseUtil_1.INVALID;
1776
+ return parseUtil_js_1.INVALID;
1806
1777
  }
1807
1778
  if (def.exactLength !== null) {
1808
1779
  const tooBig = ctx.data.length > def.exactLength.value;
1809
1780
  const tooSmall = ctx.data.length < def.exactLength.value;
1810
1781
  if (tooBig || tooSmall) {
1811
- (0, parseUtil_1.addIssueToContext)(ctx, {
1812
- code: tooBig ? ZodError_1.ZodIssueCode.too_big : ZodError_1.ZodIssueCode.too_small,
1782
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
1783
+ code: tooBig ? ZodError_js_1.ZodIssueCode.too_big : ZodError_js_1.ZodIssueCode.too_small,
1813
1784
  minimum: (tooSmall ? def.exactLength.value : undefined),
1814
1785
  maximum: (tooBig ? def.exactLength.value : undefined),
1815
1786
  type: "array",
@@ -1822,8 +1793,8 @@ class ZodArray extends ZodType {
1822
1793
  }
1823
1794
  if (def.minLength !== null) {
1824
1795
  if (ctx.data.length < def.minLength.value) {
1825
- (0, parseUtil_1.addIssueToContext)(ctx, {
1826
- code: ZodError_1.ZodIssueCode.too_small,
1796
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
1797
+ code: ZodError_js_1.ZodIssueCode.too_small,
1827
1798
  minimum: def.minLength.value,
1828
1799
  type: "array",
1829
1800
  inclusive: true,
@@ -1835,8 +1806,8 @@ class ZodArray extends ZodType {
1835
1806
  }
1836
1807
  if (def.maxLength !== null) {
1837
1808
  if (ctx.data.length > def.maxLength.value) {
1838
- (0, parseUtil_1.addIssueToContext)(ctx, {
1839
- code: ZodError_1.ZodIssueCode.too_big,
1809
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
1810
+ code: ZodError_js_1.ZodIssueCode.too_big,
1840
1811
  maximum: def.maxLength.value,
1841
1812
  type: "array",
1842
1813
  inclusive: true,
@@ -1850,13 +1821,13 @@ class ZodArray extends ZodType {
1850
1821
  return Promise.all([...ctx.data].map((item, i) => {
1851
1822
  return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i));
1852
1823
  })).then((result) => {
1853
- return parseUtil_1.ParseStatus.mergeArray(status, result);
1824
+ return parseUtil_js_1.ParseStatus.mergeArray(status, result);
1854
1825
  });
1855
1826
  }
1856
1827
  const result = [...ctx.data].map((item, i) => {
1857
1828
  return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i));
1858
1829
  });
1859
- return parseUtil_1.ParseStatus.mergeArray(status, result);
1830
+ return parseUtil_js_1.ParseStatus.mergeArray(status, result);
1860
1831
  }
1861
1832
  get element() {
1862
1833
  return this._def.type;
@@ -1864,19 +1835,19 @@ class ZodArray extends ZodType {
1864
1835
  min(minLength, message) {
1865
1836
  return new ZodArray({
1866
1837
  ...this._def,
1867
- minLength: { value: minLength, message: errorUtil_1.errorUtil.toString(message) },
1838
+ minLength: { value: minLength, message: errorUtil_js_1.errorUtil.toString(message) },
1868
1839
  });
1869
1840
  }
1870
1841
  max(maxLength, message) {
1871
1842
  return new ZodArray({
1872
1843
  ...this._def,
1873
- maxLength: { value: maxLength, message: errorUtil_1.errorUtil.toString(message) },
1844
+ maxLength: { value: maxLength, message: errorUtil_js_1.errorUtil.toString(message) },
1874
1845
  });
1875
1846
  }
1876
1847
  length(len, message) {
1877
1848
  return new ZodArray({
1878
1849
  ...this._def,
1879
- exactLength: { value: len, message: errorUtil_1.errorUtil.toString(message) },
1850
+ exactLength: { value: len, message: errorUtil_js_1.errorUtil.toString(message) },
1880
1851
  });
1881
1852
  }
1882
1853
  nonempty(message) {
@@ -1976,25 +1947,25 @@ class ZodObject extends ZodType {
1976
1947
  if (this._cached !== null)
1977
1948
  return this._cached;
1978
1949
  const shape = this._def.shape();
1979
- const keys = util_1.util.objectKeys(shape);
1980
- return (this._cached = { shape, keys });
1950
+ const keys = util_js_1.util.objectKeys(shape);
1951
+ this._cached = { shape, keys };
1952
+ return this._cached;
1981
1953
  }
1982
1954
  _parse(input) {
1983
1955
  const parsedType = this._getType(input);
1984
- if (parsedType !== util_1.ZodParsedType.object) {
1956
+ if (parsedType !== util_js_1.ZodParsedType.object) {
1985
1957
  const ctx = this._getOrReturnCtx(input);
1986
- (0, parseUtil_1.addIssueToContext)(ctx, {
1987
- code: ZodError_1.ZodIssueCode.invalid_type,
1988
- expected: util_1.ZodParsedType.object,
1958
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
1959
+ code: ZodError_js_1.ZodIssueCode.invalid_type,
1960
+ expected: util_js_1.ZodParsedType.object,
1989
1961
  received: ctx.parsedType,
1990
1962
  });
1991
- return parseUtil_1.INVALID;
1963
+ return parseUtil_js_1.INVALID;
1992
1964
  }
1993
1965
  const { status, ctx } = this._processInputParams(input);
1994
1966
  const { shape, keys: shapeKeys } = this._getCached();
1995
1967
  const extraKeys = [];
1996
- if (!(this._def.catchall instanceof ZodNever &&
1997
- this._def.unknownKeys === "strip")) {
1968
+ if (!(this._def.catchall instanceof ZodNever && this._def.unknownKeys === "strip")) {
1998
1969
  for (const key in ctx.data) {
1999
1970
  if (!shapeKeys.includes(key)) {
2000
1971
  extraKeys.push(key);
@@ -2023,8 +1994,8 @@ class ZodObject extends ZodType {
2023
1994
  }
2024
1995
  else if (unknownKeys === "strict") {
2025
1996
  if (extraKeys.length > 0) {
2026
- (0, parseUtil_1.addIssueToContext)(ctx, {
2027
- code: ZodError_1.ZodIssueCode.unrecognized_keys,
1997
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
1998
+ code: ZodError_js_1.ZodIssueCode.unrecognized_keys,
2028
1999
  keys: extraKeys,
2029
2000
  });
2030
2001
  status.dirty();
@@ -2065,29 +2036,28 @@ class ZodObject extends ZodType {
2065
2036
  return syncPairs;
2066
2037
  })
2067
2038
  .then((syncPairs) => {
2068
- return parseUtil_1.ParseStatus.mergeObjectSync(status, syncPairs);
2039
+ return parseUtil_js_1.ParseStatus.mergeObjectSync(status, syncPairs);
2069
2040
  });
2070
2041
  }
2071
2042
  else {
2072
- return parseUtil_1.ParseStatus.mergeObjectSync(status, pairs);
2043
+ return parseUtil_js_1.ParseStatus.mergeObjectSync(status, pairs);
2073
2044
  }
2074
2045
  }
2075
2046
  get shape() {
2076
2047
  return this._def.shape();
2077
2048
  }
2078
2049
  strict(message) {
2079
- errorUtil_1.errorUtil.errToObj;
2050
+ errorUtil_js_1.errorUtil.errToObj;
2080
2051
  return new ZodObject({
2081
2052
  ...this._def,
2082
2053
  unknownKeys: "strict",
2083
2054
  ...(message !== undefined
2084
2055
  ? {
2085
2056
  errorMap: (issue, ctx) => {
2086
- var _a, _b, _c, _d;
2087
- const defaultError = (_c = (_b = (_a = this._def).errorMap) === null || _b === void 0 ? void 0 : _b.call(_a, issue, ctx).message) !== null && _c !== void 0 ? _c : ctx.defaultError;
2057
+ const defaultError = this._def.errorMap?.(issue, ctx).message ?? ctx.defaultError;
2088
2058
  if (issue.code === "unrecognized_keys")
2089
2059
  return {
2090
- message: (_d = errorUtil_1.errorUtil.errToObj(message).message) !== null && _d !== void 0 ? _d : defaultError,
2060
+ message: errorUtil_js_1.errorUtil.errToObj(message).message ?? defaultError,
2091
2061
  };
2092
2062
  return {
2093
2063
  message: defaultError,
@@ -2219,11 +2189,11 @@ class ZodObject extends ZodType {
2219
2189
  }
2220
2190
  pick(mask) {
2221
2191
  const shape = {};
2222
- util_1.util.objectKeys(mask).forEach((key) => {
2192
+ for (const key of util_js_1.util.objectKeys(mask)) {
2223
2193
  if (mask[key] && this.shape[key]) {
2224
2194
  shape[key] = this.shape[key];
2225
2195
  }
2226
- });
2196
+ }
2227
2197
  return new ZodObject({
2228
2198
  ...this._def,
2229
2199
  shape: () => shape,
@@ -2231,11 +2201,11 @@ class ZodObject extends ZodType {
2231
2201
  }
2232
2202
  omit(mask) {
2233
2203
  const shape = {};
2234
- util_1.util.objectKeys(this.shape).forEach((key) => {
2204
+ for (const key of util_js_1.util.objectKeys(this.shape)) {
2235
2205
  if (!mask[key]) {
2236
2206
  shape[key] = this.shape[key];
2237
2207
  }
2238
- });
2208
+ }
2239
2209
  return new ZodObject({
2240
2210
  ...this._def,
2241
2211
  shape: () => shape,
@@ -2249,7 +2219,7 @@ class ZodObject extends ZodType {
2249
2219
  }
2250
2220
  partial(mask) {
2251
2221
  const newShape = {};
2252
- util_1.util.objectKeys(this.shape).forEach((key) => {
2222
+ for (const key of util_js_1.util.objectKeys(this.shape)) {
2253
2223
  const fieldSchema = this.shape[key];
2254
2224
  if (mask && !mask[key]) {
2255
2225
  newShape[key] = fieldSchema;
@@ -2257,7 +2227,7 @@ class ZodObject extends ZodType {
2257
2227
  else {
2258
2228
  newShape[key] = fieldSchema.optional();
2259
2229
  }
2260
- });
2230
+ }
2261
2231
  return new ZodObject({
2262
2232
  ...this._def,
2263
2233
  shape: () => newShape,
@@ -2265,7 +2235,7 @@ class ZodObject extends ZodType {
2265
2235
  }
2266
2236
  required(mask) {
2267
2237
  const newShape = {};
2268
- util_1.util.objectKeys(this.shape).forEach((key) => {
2238
+ for (const key of util_js_1.util.objectKeys(this.shape)) {
2269
2239
  if (mask && !mask[key]) {
2270
2240
  newShape[key] = this.shape[key];
2271
2241
  }
@@ -2277,14 +2247,14 @@ class ZodObject extends ZodType {
2277
2247
  }
2278
2248
  newShape[key] = newField;
2279
2249
  }
2280
- });
2250
+ }
2281
2251
  return new ZodObject({
2282
2252
  ...this._def,
2283
2253
  shape: () => newShape,
2284
2254
  });
2285
2255
  }
2286
2256
  keyof() {
2287
- return createZodEnum(util_1.util.objectKeys(this.shape));
2257
+ return createZodEnum(util_js_1.util.objectKeys(this.shape));
2288
2258
  }
2289
2259
  }
2290
2260
  exports.ZodObject = ZodObject;
@@ -2334,12 +2304,12 @@ class ZodUnion extends ZodType {
2334
2304
  }
2335
2305
  }
2336
2306
  // return invalid
2337
- const unionErrors = results.map((result) => new ZodError_1.ZodError(result.ctx.common.issues));
2338
- (0, parseUtil_1.addIssueToContext)(ctx, {
2339
- code: ZodError_1.ZodIssueCode.invalid_union,
2307
+ const unionErrors = results.map((result) => new ZodError_js_1.ZodError(result.ctx.common.issues));
2308
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
2309
+ code: ZodError_js_1.ZodIssueCode.invalid_union,
2340
2310
  unionErrors,
2341
2311
  });
2342
- return parseUtil_1.INVALID;
2312
+ return parseUtil_js_1.INVALID;
2343
2313
  }
2344
2314
  if (ctx.common.async) {
2345
2315
  return Promise.all(options.map(async (option) => {
@@ -2392,12 +2362,12 @@ class ZodUnion extends ZodType {
2392
2362
  ctx.common.issues.push(...dirty.ctx.common.issues);
2393
2363
  return dirty.result;
2394
2364
  }
2395
- const unionErrors = issues.map((issues) => new ZodError_1.ZodError(issues));
2396
- (0, parseUtil_1.addIssueToContext)(ctx, {
2397
- code: ZodError_1.ZodIssueCode.invalid_union,
2365
+ const unionErrors = issues.map((issues) => new ZodError_js_1.ZodError(issues));
2366
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
2367
+ code: ZodError_js_1.ZodIssueCode.invalid_union,
2398
2368
  unionErrors,
2399
2369
  });
2400
- return parseUtil_1.INVALID;
2370
+ return parseUtil_js_1.INVALID;
2401
2371
  }
2402
2372
  }
2403
2373
  get options() {
@@ -2434,7 +2404,7 @@ const getDiscriminator = (type) => {
2434
2404
  }
2435
2405
  else if (type instanceof ZodNativeEnum) {
2436
2406
  // eslint-disable-next-line ban/ban
2437
- return util_1.util.objectValues(type.enum);
2407
+ return util_js_1.util.objectValues(type.enum);
2438
2408
  }
2439
2409
  else if (type instanceof ZodDefault) {
2440
2410
  return getDiscriminator(type._def.innerType);
@@ -2467,24 +2437,24 @@ const getDiscriminator = (type) => {
2467
2437
  class ZodDiscriminatedUnion extends ZodType {
2468
2438
  _parse(input) {
2469
2439
  const { ctx } = this._processInputParams(input);
2470
- if (ctx.parsedType !== util_1.ZodParsedType.object) {
2471
- (0, parseUtil_1.addIssueToContext)(ctx, {
2472
- code: ZodError_1.ZodIssueCode.invalid_type,
2473
- expected: util_1.ZodParsedType.object,
2440
+ if (ctx.parsedType !== util_js_1.ZodParsedType.object) {
2441
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
2442
+ code: ZodError_js_1.ZodIssueCode.invalid_type,
2443
+ expected: util_js_1.ZodParsedType.object,
2474
2444
  received: ctx.parsedType,
2475
2445
  });
2476
- return parseUtil_1.INVALID;
2446
+ return parseUtil_js_1.INVALID;
2477
2447
  }
2478
2448
  const discriminator = this.discriminator;
2479
2449
  const discriminatorValue = ctx.data[discriminator];
2480
2450
  const option = this.optionsMap.get(discriminatorValue);
2481
2451
  if (!option) {
2482
- (0, parseUtil_1.addIssueToContext)(ctx, {
2483
- code: ZodError_1.ZodIssueCode.invalid_union_discriminator,
2452
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
2453
+ code: ZodError_js_1.ZodIssueCode.invalid_union_discriminator,
2484
2454
  options: Array.from(this.optionsMap.keys()),
2485
2455
  path: [discriminator],
2486
2456
  });
2487
- return parseUtil_1.INVALID;
2457
+ return parseUtil_js_1.INVALID;
2488
2458
  }
2489
2459
  if (ctx.common.async) {
2490
2460
  return option._parseAsync({
@@ -2545,16 +2515,14 @@ class ZodDiscriminatedUnion extends ZodType {
2545
2515
  }
2546
2516
  exports.ZodDiscriminatedUnion = ZodDiscriminatedUnion;
2547
2517
  function mergeValues(a, b) {
2548
- const aType = (0, util_1.getParsedType)(a);
2549
- const bType = (0, util_1.getParsedType)(b);
2518
+ const aType = (0, util_js_1.getParsedType)(a);
2519
+ const bType = (0, util_js_1.getParsedType)(b);
2550
2520
  if (a === b) {
2551
2521
  return { valid: true, data: a };
2552
2522
  }
2553
- else if (aType === util_1.ZodParsedType.object && bType === util_1.ZodParsedType.object) {
2554
- const bKeys = util_1.util.objectKeys(b);
2555
- const sharedKeys = util_1.util
2556
- .objectKeys(a)
2557
- .filter((key) => bKeys.indexOf(key) !== -1);
2523
+ else if (aType === util_js_1.ZodParsedType.object && bType === util_js_1.ZodParsedType.object) {
2524
+ const bKeys = util_js_1.util.objectKeys(b);
2525
+ const sharedKeys = util_js_1.util.objectKeys(a).filter((key) => bKeys.indexOf(key) !== -1);
2558
2526
  const newObj = { ...a, ...b };
2559
2527
  for (const key of sharedKeys) {
2560
2528
  const sharedValue = mergeValues(a[key], b[key]);
@@ -2565,7 +2533,7 @@ function mergeValues(a, b) {
2565
2533
  }
2566
2534
  return { valid: true, data: newObj };
2567
2535
  }
2568
- else if (aType === util_1.ZodParsedType.array && bType === util_1.ZodParsedType.array) {
2536
+ else if (aType === util_js_1.ZodParsedType.array && bType === util_js_1.ZodParsedType.array) {
2569
2537
  if (a.length !== b.length) {
2570
2538
  return { valid: false };
2571
2539
  }
@@ -2581,9 +2549,7 @@ function mergeValues(a, b) {
2581
2549
  }
2582
2550
  return { valid: true, data: newArray };
2583
2551
  }
2584
- else if (aType === util_1.ZodParsedType.date &&
2585
- bType === util_1.ZodParsedType.date &&
2586
- +a === +b) {
2552
+ else if (aType === util_js_1.ZodParsedType.date && bType === util_js_1.ZodParsedType.date && +a === +b) {
2587
2553
  return { valid: true, data: a };
2588
2554
  }
2589
2555
  else {
@@ -2594,17 +2560,17 @@ class ZodIntersection extends ZodType {
2594
2560
  _parse(input) {
2595
2561
  const { status, ctx } = this._processInputParams(input);
2596
2562
  const handleParsed = (parsedLeft, parsedRight) => {
2597
- if ((0, parseUtil_1.isAborted)(parsedLeft) || (0, parseUtil_1.isAborted)(parsedRight)) {
2598
- return parseUtil_1.INVALID;
2563
+ if ((0, parseUtil_js_1.isAborted)(parsedLeft) || (0, parseUtil_js_1.isAborted)(parsedRight)) {
2564
+ return parseUtil_js_1.INVALID;
2599
2565
  }
2600
2566
  const merged = mergeValues(parsedLeft.value, parsedRight.value);
2601
2567
  if (!merged.valid) {
2602
- (0, parseUtil_1.addIssueToContext)(ctx, {
2603
- code: ZodError_1.ZodIssueCode.invalid_intersection_types,
2568
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
2569
+ code: ZodError_js_1.ZodIssueCode.invalid_intersection_types,
2604
2570
  });
2605
- return parseUtil_1.INVALID;
2571
+ return parseUtil_js_1.INVALID;
2606
2572
  }
2607
- if ((0, parseUtil_1.isDirty)(parsedLeft) || (0, parseUtil_1.isDirty)(parsedRight)) {
2573
+ if ((0, parseUtil_js_1.isDirty)(parsedLeft) || (0, parseUtil_js_1.isDirty)(parsedRight)) {
2608
2574
  status.dirty();
2609
2575
  }
2610
2576
  return { status: status.value, value: merged.data };
@@ -2645,31 +2611,32 @@ ZodIntersection.create = (left, right, params) => {
2645
2611
  ...processCreateParams(params),
2646
2612
  });
2647
2613
  };
2614
+ // type ZodTupleItems = [ZodTypeAny, ...ZodTypeAny[]];
2648
2615
  class ZodTuple extends ZodType {
2649
2616
  _parse(input) {
2650
2617
  const { status, ctx } = this._processInputParams(input);
2651
- if (ctx.parsedType !== util_1.ZodParsedType.array) {
2652
- (0, parseUtil_1.addIssueToContext)(ctx, {
2653
- code: ZodError_1.ZodIssueCode.invalid_type,
2654
- expected: util_1.ZodParsedType.array,
2618
+ if (ctx.parsedType !== util_js_1.ZodParsedType.array) {
2619
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
2620
+ code: ZodError_js_1.ZodIssueCode.invalid_type,
2621
+ expected: util_js_1.ZodParsedType.array,
2655
2622
  received: ctx.parsedType,
2656
2623
  });
2657
- return parseUtil_1.INVALID;
2624
+ return parseUtil_js_1.INVALID;
2658
2625
  }
2659
2626
  if (ctx.data.length < this._def.items.length) {
2660
- (0, parseUtil_1.addIssueToContext)(ctx, {
2661
- code: ZodError_1.ZodIssueCode.too_small,
2627
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
2628
+ code: ZodError_js_1.ZodIssueCode.too_small,
2662
2629
  minimum: this._def.items.length,
2663
2630
  inclusive: true,
2664
2631
  exact: false,
2665
2632
  type: "array",
2666
2633
  });
2667
- return parseUtil_1.INVALID;
2634
+ return parseUtil_js_1.INVALID;
2668
2635
  }
2669
2636
  const rest = this._def.rest;
2670
2637
  if (!rest && ctx.data.length > this._def.items.length) {
2671
- (0, parseUtil_1.addIssueToContext)(ctx, {
2672
- code: ZodError_1.ZodIssueCode.too_big,
2638
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
2639
+ code: ZodError_js_1.ZodIssueCode.too_big,
2673
2640
  maximum: this._def.items.length,
2674
2641
  inclusive: true,
2675
2642
  exact: false,
@@ -2687,11 +2654,11 @@ class ZodTuple extends ZodType {
2687
2654
  .filter((x) => !!x); // filter nulls
2688
2655
  if (ctx.common.async) {
2689
2656
  return Promise.all(items).then((results) => {
2690
- return parseUtil_1.ParseStatus.mergeArray(status, results);
2657
+ return parseUtil_js_1.ParseStatus.mergeArray(status, results);
2691
2658
  });
2692
2659
  }
2693
2660
  else {
2694
- return parseUtil_1.ParseStatus.mergeArray(status, items);
2661
+ return parseUtil_js_1.ParseStatus.mergeArray(status, items);
2695
2662
  }
2696
2663
  }
2697
2664
  get items() {
@@ -2725,13 +2692,13 @@ class ZodRecord extends ZodType {
2725
2692
  }
2726
2693
  _parse(input) {
2727
2694
  const { status, ctx } = this._processInputParams(input);
2728
- if (ctx.parsedType !== util_1.ZodParsedType.object) {
2729
- (0, parseUtil_1.addIssueToContext)(ctx, {
2730
- code: ZodError_1.ZodIssueCode.invalid_type,
2731
- expected: util_1.ZodParsedType.object,
2695
+ if (ctx.parsedType !== util_js_1.ZodParsedType.object) {
2696
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
2697
+ code: ZodError_js_1.ZodIssueCode.invalid_type,
2698
+ expected: util_js_1.ZodParsedType.object,
2732
2699
  received: ctx.parsedType,
2733
2700
  });
2734
- return parseUtil_1.INVALID;
2701
+ return parseUtil_js_1.INVALID;
2735
2702
  }
2736
2703
  const pairs = [];
2737
2704
  const keyType = this._def.keyType;
@@ -2744,10 +2711,10 @@ class ZodRecord extends ZodType {
2744
2711
  });
2745
2712
  }
2746
2713
  if (ctx.common.async) {
2747
- return parseUtil_1.ParseStatus.mergeObjectAsync(status, pairs);
2714
+ return parseUtil_js_1.ParseStatus.mergeObjectAsync(status, pairs);
2748
2715
  }
2749
2716
  else {
2750
- return parseUtil_1.ParseStatus.mergeObjectSync(status, pairs);
2717
+ return parseUtil_js_1.ParseStatus.mergeObjectSync(status, pairs);
2751
2718
  }
2752
2719
  }
2753
2720
  get element() {
@@ -2780,13 +2747,13 @@ class ZodMap extends ZodType {
2780
2747
  }
2781
2748
  _parse(input) {
2782
2749
  const { status, ctx } = this._processInputParams(input);
2783
- if (ctx.parsedType !== util_1.ZodParsedType.map) {
2784
- (0, parseUtil_1.addIssueToContext)(ctx, {
2785
- code: ZodError_1.ZodIssueCode.invalid_type,
2786
- expected: util_1.ZodParsedType.map,
2750
+ if (ctx.parsedType !== util_js_1.ZodParsedType.map) {
2751
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
2752
+ code: ZodError_js_1.ZodIssueCode.invalid_type,
2753
+ expected: util_js_1.ZodParsedType.map,
2787
2754
  received: ctx.parsedType,
2788
2755
  });
2789
- return parseUtil_1.INVALID;
2756
+ return parseUtil_js_1.INVALID;
2790
2757
  }
2791
2758
  const keyType = this._def.keyType;
2792
2759
  const valueType = this._def.valueType;
@@ -2803,7 +2770,7 @@ class ZodMap extends ZodType {
2803
2770
  const key = await pair.key;
2804
2771
  const value = await pair.value;
2805
2772
  if (key.status === "aborted" || value.status === "aborted") {
2806
- return parseUtil_1.INVALID;
2773
+ return parseUtil_js_1.INVALID;
2807
2774
  }
2808
2775
  if (key.status === "dirty" || value.status === "dirty") {
2809
2776
  status.dirty();
@@ -2819,7 +2786,7 @@ class ZodMap extends ZodType {
2819
2786
  const key = pair.key;
2820
2787
  const value = pair.value;
2821
2788
  if (key.status === "aborted" || value.status === "aborted") {
2822
- return parseUtil_1.INVALID;
2789
+ return parseUtil_js_1.INVALID;
2823
2790
  }
2824
2791
  if (key.status === "dirty" || value.status === "dirty") {
2825
2792
  status.dirty();
@@ -2842,19 +2809,19 @@ ZodMap.create = (keyType, valueType, params) => {
2842
2809
  class ZodSet extends ZodType {
2843
2810
  _parse(input) {
2844
2811
  const { status, ctx } = this._processInputParams(input);
2845
- if (ctx.parsedType !== util_1.ZodParsedType.set) {
2846
- (0, parseUtil_1.addIssueToContext)(ctx, {
2847
- code: ZodError_1.ZodIssueCode.invalid_type,
2848
- expected: util_1.ZodParsedType.set,
2812
+ if (ctx.parsedType !== util_js_1.ZodParsedType.set) {
2813
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
2814
+ code: ZodError_js_1.ZodIssueCode.invalid_type,
2815
+ expected: util_js_1.ZodParsedType.set,
2849
2816
  received: ctx.parsedType,
2850
2817
  });
2851
- return parseUtil_1.INVALID;
2818
+ return parseUtil_js_1.INVALID;
2852
2819
  }
2853
2820
  const def = this._def;
2854
2821
  if (def.minSize !== null) {
2855
2822
  if (ctx.data.size < def.minSize.value) {
2856
- (0, parseUtil_1.addIssueToContext)(ctx, {
2857
- code: ZodError_1.ZodIssueCode.too_small,
2823
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
2824
+ code: ZodError_js_1.ZodIssueCode.too_small,
2858
2825
  minimum: def.minSize.value,
2859
2826
  type: "set",
2860
2827
  inclusive: true,
@@ -2866,8 +2833,8 @@ class ZodSet extends ZodType {
2866
2833
  }
2867
2834
  if (def.maxSize !== null) {
2868
2835
  if (ctx.data.size > def.maxSize.value) {
2869
- (0, parseUtil_1.addIssueToContext)(ctx, {
2870
- code: ZodError_1.ZodIssueCode.too_big,
2836
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
2837
+ code: ZodError_js_1.ZodIssueCode.too_big,
2871
2838
  maximum: def.maxSize.value,
2872
2839
  type: "set",
2873
2840
  inclusive: true,
@@ -2882,7 +2849,7 @@ class ZodSet extends ZodType {
2882
2849
  const parsedSet = new Set();
2883
2850
  for (const element of elements) {
2884
2851
  if (element.status === "aborted")
2885
- return parseUtil_1.INVALID;
2852
+ return parseUtil_js_1.INVALID;
2886
2853
  if (element.status === "dirty")
2887
2854
  status.dirty();
2888
2855
  parsedSet.add(element.value);
@@ -2900,13 +2867,13 @@ class ZodSet extends ZodType {
2900
2867
  min(minSize, message) {
2901
2868
  return new ZodSet({
2902
2869
  ...this._def,
2903
- minSize: { value: minSize, message: errorUtil_1.errorUtil.toString(message) },
2870
+ minSize: { value: minSize, message: errorUtil_js_1.errorUtil.toString(message) },
2904
2871
  });
2905
2872
  }
2906
2873
  max(maxSize, message) {
2907
2874
  return new ZodSet({
2908
2875
  ...this._def,
2909
- maxSize: { value: maxSize, message: errorUtil_1.errorUtil.toString(message) },
2876
+ maxSize: { value: maxSize, message: errorUtil_js_1.errorUtil.toString(message) },
2910
2877
  });
2911
2878
  }
2912
2879
  size(size, message) {
@@ -2933,42 +2900,32 @@ class ZodFunction extends ZodType {
2933
2900
  }
2934
2901
  _parse(input) {
2935
2902
  const { ctx } = this._processInputParams(input);
2936
- if (ctx.parsedType !== util_1.ZodParsedType.function) {
2937
- (0, parseUtil_1.addIssueToContext)(ctx, {
2938
- code: ZodError_1.ZodIssueCode.invalid_type,
2939
- expected: util_1.ZodParsedType.function,
2903
+ if (ctx.parsedType !== util_js_1.ZodParsedType.function) {
2904
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
2905
+ code: ZodError_js_1.ZodIssueCode.invalid_type,
2906
+ expected: util_js_1.ZodParsedType.function,
2940
2907
  received: ctx.parsedType,
2941
2908
  });
2942
- return parseUtil_1.INVALID;
2909
+ return parseUtil_js_1.INVALID;
2943
2910
  }
2944
2911
  function makeArgsIssue(args, error) {
2945
- return (0, parseUtil_1.makeIssue)({
2912
+ return (0, parseUtil_js_1.makeIssue)({
2946
2913
  data: args,
2947
2914
  path: ctx.path,
2948
- errorMaps: [
2949
- ctx.common.contextualErrorMap,
2950
- ctx.schemaErrorMap,
2951
- (0, errors_1.getErrorMap)(),
2952
- errors_1.defaultErrorMap,
2953
- ].filter((x) => !!x),
2915
+ errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, (0, errors_js_1.getErrorMap)(), errors_js_1.defaultErrorMap].filter((x) => !!x),
2954
2916
  issueData: {
2955
- code: ZodError_1.ZodIssueCode.invalid_arguments,
2917
+ code: ZodError_js_1.ZodIssueCode.invalid_arguments,
2956
2918
  argumentsError: error,
2957
2919
  },
2958
2920
  });
2959
2921
  }
2960
2922
  function makeReturnsIssue(returns, error) {
2961
- return (0, parseUtil_1.makeIssue)({
2923
+ return (0, parseUtil_js_1.makeIssue)({
2962
2924
  data: returns,
2963
2925
  path: ctx.path,
2964
- errorMaps: [
2965
- ctx.common.contextualErrorMap,
2966
- ctx.schemaErrorMap,
2967
- (0, errors_1.getErrorMap)(),
2968
- errors_1.defaultErrorMap,
2969
- ].filter((x) => !!x),
2926
+ errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, (0, errors_js_1.getErrorMap)(), errors_js_1.defaultErrorMap].filter((x) => !!x),
2970
2927
  issueData: {
2971
- code: ZodError_1.ZodIssueCode.invalid_return_type,
2928
+ code: ZodError_js_1.ZodIssueCode.invalid_return_type,
2972
2929
  returnTypeError: error,
2973
2930
  },
2974
2931
  });
@@ -2980,11 +2937,9 @@ class ZodFunction extends ZodType {
2980
2937
  // an alias (using an arrow function was what caused 2651).
2981
2938
  // eslint-disable-next-line @typescript-eslint/no-this-alias
2982
2939
  const me = this;
2983
- return (0, parseUtil_1.OK)(async function (...args) {
2984
- const error = new ZodError_1.ZodError([]);
2985
- const parsedArgs = await me._def.args
2986
- .parseAsync(args, params)
2987
- .catch((e) => {
2940
+ return (0, parseUtil_js_1.OK)(async function (...args) {
2941
+ const error = new ZodError_js_1.ZodError([]);
2942
+ const parsedArgs = await me._def.args.parseAsync(args, params).catch((e) => {
2988
2943
  error.addIssue(makeArgsIssue(args, e));
2989
2944
  throw error;
2990
2945
  });
@@ -3003,15 +2958,15 @@ class ZodFunction extends ZodType {
3003
2958
  // an alias (using an arrow function was what caused 2651).
3004
2959
  // eslint-disable-next-line @typescript-eslint/no-this-alias
3005
2960
  const me = this;
3006
- return (0, parseUtil_1.OK)(function (...args) {
2961
+ return (0, parseUtil_js_1.OK)(function (...args) {
3007
2962
  const parsedArgs = me._def.args.safeParse(args, params);
3008
2963
  if (!parsedArgs.success) {
3009
- throw new ZodError_1.ZodError([makeArgsIssue(args, parsedArgs.error)]);
2964
+ throw new ZodError_js_1.ZodError([makeArgsIssue(args, parsedArgs.error)]);
3010
2965
  }
3011
2966
  const result = Reflect.apply(fn, this, parsedArgs.data);
3012
2967
  const parsedReturns = me._def.returns.safeParse(result, params);
3013
2968
  if (!parsedReturns.success) {
3014
- throw new ZodError_1.ZodError([makeReturnsIssue(result, parsedReturns.error)]);
2969
+ throw new ZodError_js_1.ZodError([makeReturnsIssue(result, parsedReturns.error)]);
3015
2970
  }
3016
2971
  return parsedReturns.data;
3017
2972
  });
@@ -3045,9 +3000,7 @@ class ZodFunction extends ZodType {
3045
3000
  }
3046
3001
  static create(args, returns, params) {
3047
3002
  return new ZodFunction({
3048
- args: (args
3049
- ? args
3050
- : ZodTuple.create([]).rest(ZodUnknown.create())),
3003
+ args: (args ? args : ZodTuple.create([]).rest(ZodUnknown.create())),
3051
3004
  returns: returns || ZodUnknown.create(),
3052
3005
  typeName: ZodFirstPartyTypeKind.ZodFunction,
3053
3006
  ...processCreateParams(params),
@@ -3077,12 +3030,12 @@ class ZodLiteral extends ZodType {
3077
3030
  _parse(input) {
3078
3031
  if (input.data !== this._def.value) {
3079
3032
  const ctx = this._getOrReturnCtx(input);
3080
- (0, parseUtil_1.addIssueToContext)(ctx, {
3033
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
3081
3034
  received: ctx.data,
3082
- code: ZodError_1.ZodIssueCode.invalid_literal,
3035
+ code: ZodError_js_1.ZodIssueCode.invalid_literal,
3083
3036
  expected: this._def.value,
3084
3037
  });
3085
- return parseUtil_1.INVALID;
3038
+ return parseUtil_js_1.INVALID;
3086
3039
  }
3087
3040
  return { status: "valid", value: input.data };
3088
3041
  }
@@ -3106,35 +3059,31 @@ function createZodEnum(values, params) {
3106
3059
  });
3107
3060
  }
3108
3061
  class ZodEnum extends ZodType {
3109
- constructor() {
3110
- super(...arguments);
3111
- _ZodEnum_cache.set(this, void 0);
3112
- }
3113
3062
  _parse(input) {
3114
3063
  if (typeof input.data !== "string") {
3115
3064
  const ctx = this._getOrReturnCtx(input);
3116
3065
  const expectedValues = this._def.values;
3117
- (0, parseUtil_1.addIssueToContext)(ctx, {
3118
- expected: util_1.util.joinValues(expectedValues),
3066
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
3067
+ expected: util_js_1.util.joinValues(expectedValues),
3119
3068
  received: ctx.parsedType,
3120
- code: ZodError_1.ZodIssueCode.invalid_type,
3069
+ code: ZodError_js_1.ZodIssueCode.invalid_type,
3121
3070
  });
3122
- return parseUtil_1.INVALID;
3071
+ return parseUtil_js_1.INVALID;
3123
3072
  }
3124
- if (!__classPrivateFieldGet(this, _ZodEnum_cache, "f")) {
3125
- __classPrivateFieldSet(this, _ZodEnum_cache, new Set(this._def.values), "f");
3073
+ if (!this._cache) {
3074
+ this._cache = new Set(this._def.values);
3126
3075
  }
3127
- if (!__classPrivateFieldGet(this, _ZodEnum_cache, "f").has(input.data)) {
3076
+ if (!this._cache.has(input.data)) {
3128
3077
  const ctx = this._getOrReturnCtx(input);
3129
3078
  const expectedValues = this._def.values;
3130
- (0, parseUtil_1.addIssueToContext)(ctx, {
3079
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
3131
3080
  received: ctx.data,
3132
- code: ZodError_1.ZodIssueCode.invalid_enum_value,
3081
+ code: ZodError_js_1.ZodIssueCode.invalid_enum_value,
3133
3082
  options: expectedValues,
3134
3083
  });
3135
- return parseUtil_1.INVALID;
3084
+ return parseUtil_js_1.INVALID;
3136
3085
  }
3137
- return (0, parseUtil_1.OK)(input.data);
3086
+ return (0, parseUtil_js_1.OK)(input.data);
3138
3087
  }
3139
3088
  get options() {
3140
3089
  return this._def.values;
@@ -3174,46 +3123,39 @@ class ZodEnum extends ZodType {
3174
3123
  }
3175
3124
  }
3176
3125
  exports.ZodEnum = ZodEnum;
3177
- _ZodEnum_cache = new WeakMap();
3178
3126
  ZodEnum.create = createZodEnum;
3179
3127
  class ZodNativeEnum extends ZodType {
3180
- constructor() {
3181
- super(...arguments);
3182
- _ZodNativeEnum_cache.set(this, void 0);
3183
- }
3184
3128
  _parse(input) {
3185
- const nativeEnumValues = util_1.util.getValidEnumValues(this._def.values);
3129
+ const nativeEnumValues = util_js_1.util.getValidEnumValues(this._def.values);
3186
3130
  const ctx = this._getOrReturnCtx(input);
3187
- if (ctx.parsedType !== util_1.ZodParsedType.string &&
3188
- ctx.parsedType !== util_1.ZodParsedType.number) {
3189
- const expectedValues = util_1.util.objectValues(nativeEnumValues);
3190
- (0, parseUtil_1.addIssueToContext)(ctx, {
3191
- expected: util_1.util.joinValues(expectedValues),
3131
+ if (ctx.parsedType !== util_js_1.ZodParsedType.string && ctx.parsedType !== util_js_1.ZodParsedType.number) {
3132
+ const expectedValues = util_js_1.util.objectValues(nativeEnumValues);
3133
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
3134
+ expected: util_js_1.util.joinValues(expectedValues),
3192
3135
  received: ctx.parsedType,
3193
- code: ZodError_1.ZodIssueCode.invalid_type,
3136
+ code: ZodError_js_1.ZodIssueCode.invalid_type,
3194
3137
  });
3195
- return parseUtil_1.INVALID;
3138
+ return parseUtil_js_1.INVALID;
3196
3139
  }
3197
- if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache, "f")) {
3198
- __classPrivateFieldSet(this, _ZodNativeEnum_cache, new Set(util_1.util.getValidEnumValues(this._def.values)), "f");
3140
+ if (!this._cache) {
3141
+ this._cache = new Set(util_js_1.util.getValidEnumValues(this._def.values));
3199
3142
  }
3200
- if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache, "f").has(input.data)) {
3201
- const expectedValues = util_1.util.objectValues(nativeEnumValues);
3202
- (0, parseUtil_1.addIssueToContext)(ctx, {
3143
+ if (!this._cache.has(input.data)) {
3144
+ const expectedValues = util_js_1.util.objectValues(nativeEnumValues);
3145
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
3203
3146
  received: ctx.data,
3204
- code: ZodError_1.ZodIssueCode.invalid_enum_value,
3147
+ code: ZodError_js_1.ZodIssueCode.invalid_enum_value,
3205
3148
  options: expectedValues,
3206
3149
  });
3207
- return parseUtil_1.INVALID;
3150
+ return parseUtil_js_1.INVALID;
3208
3151
  }
3209
- return (0, parseUtil_1.OK)(input.data);
3152
+ return (0, parseUtil_js_1.OK)(input.data);
3210
3153
  }
3211
3154
  get enum() {
3212
3155
  return this._def.values;
3213
3156
  }
3214
3157
  }
3215
3158
  exports.ZodNativeEnum = ZodNativeEnum;
3216
- _ZodNativeEnum_cache = new WeakMap();
3217
3159
  ZodNativeEnum.create = (values, params) => {
3218
3160
  return new ZodNativeEnum({
3219
3161
  values: values,
@@ -3227,19 +3169,16 @@ class ZodPromise extends ZodType {
3227
3169
  }
3228
3170
  _parse(input) {
3229
3171
  const { ctx } = this._processInputParams(input);
3230
- if (ctx.parsedType !== util_1.ZodParsedType.promise &&
3231
- ctx.common.async === false) {
3232
- (0, parseUtil_1.addIssueToContext)(ctx, {
3233
- code: ZodError_1.ZodIssueCode.invalid_type,
3234
- expected: util_1.ZodParsedType.promise,
3172
+ if (ctx.parsedType !== util_js_1.ZodParsedType.promise && ctx.common.async === false) {
3173
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
3174
+ code: ZodError_js_1.ZodIssueCode.invalid_type,
3175
+ expected: util_js_1.ZodParsedType.promise,
3235
3176
  received: ctx.parsedType,
3236
3177
  });
3237
- return parseUtil_1.INVALID;
3178
+ return parseUtil_js_1.INVALID;
3238
3179
  }
3239
- const promisified = ctx.parsedType === util_1.ZodParsedType.promise
3240
- ? ctx.data
3241
- : Promise.resolve(ctx.data);
3242
- return (0, parseUtil_1.OK)(promisified.then((data) => {
3180
+ const promisified = ctx.parsedType === util_js_1.ZodParsedType.promise ? ctx.data : Promise.resolve(ctx.data);
3181
+ return (0, parseUtil_js_1.OK)(promisified.then((data) => {
3243
3182
  return this._def.type.parseAsync(data, {
3244
3183
  path: ctx.path,
3245
3184
  errorMap: ctx.common.contextualErrorMap,
@@ -3269,7 +3208,7 @@ class ZodEffects extends ZodType {
3269
3208
  const effect = this._def.effect || null;
3270
3209
  const checkCtx = {
3271
3210
  addIssue: (arg) => {
3272
- (0, parseUtil_1.addIssueToContext)(ctx, arg);
3211
+ (0, parseUtil_js_1.addIssueToContext)(ctx, arg);
3273
3212
  if (arg.fatal) {
3274
3213
  status.abort();
3275
3214
  }
@@ -3287,35 +3226,35 @@ class ZodEffects extends ZodType {
3287
3226
  if (ctx.common.async) {
3288
3227
  return Promise.resolve(processed).then(async (processed) => {
3289
3228
  if (status.value === "aborted")
3290
- return parseUtil_1.INVALID;
3229
+ return parseUtil_js_1.INVALID;
3291
3230
  const result = await this._def.schema._parseAsync({
3292
3231
  data: processed,
3293
3232
  path: ctx.path,
3294
3233
  parent: ctx,
3295
3234
  });
3296
3235
  if (result.status === "aborted")
3297
- return parseUtil_1.INVALID;
3236
+ return parseUtil_js_1.INVALID;
3298
3237
  if (result.status === "dirty")
3299
- return (0, parseUtil_1.DIRTY)(result.value);
3238
+ return (0, parseUtil_js_1.DIRTY)(result.value);
3300
3239
  if (status.value === "dirty")
3301
- return (0, parseUtil_1.DIRTY)(result.value);
3240
+ return (0, parseUtil_js_1.DIRTY)(result.value);
3302
3241
  return result;
3303
3242
  });
3304
3243
  }
3305
3244
  else {
3306
3245
  if (status.value === "aborted")
3307
- return parseUtil_1.INVALID;
3246
+ return parseUtil_js_1.INVALID;
3308
3247
  const result = this._def.schema._parseSync({
3309
3248
  data: processed,
3310
3249
  path: ctx.path,
3311
3250
  parent: ctx,
3312
3251
  });
3313
3252
  if (result.status === "aborted")
3314
- return parseUtil_1.INVALID;
3253
+ return parseUtil_js_1.INVALID;
3315
3254
  if (result.status === "dirty")
3316
- return (0, parseUtil_1.DIRTY)(result.value);
3255
+ return (0, parseUtil_js_1.DIRTY)(result.value);
3317
3256
  if (status.value === "dirty")
3318
- return (0, parseUtil_1.DIRTY)(result.value);
3257
+ return (0, parseUtil_js_1.DIRTY)(result.value);
3319
3258
  return result;
3320
3259
  }
3321
3260
  }
@@ -3337,7 +3276,7 @@ class ZodEffects extends ZodType {
3337
3276
  parent: ctx,
3338
3277
  });
3339
3278
  if (inner.status === "aborted")
3340
- return parseUtil_1.INVALID;
3279
+ return parseUtil_js_1.INVALID;
3341
3280
  if (inner.status === "dirty")
3342
3281
  status.dirty();
3343
3282
  // return value is ignored
@@ -3345,11 +3284,9 @@ class ZodEffects extends ZodType {
3345
3284
  return { status: status.value, value: inner.value };
3346
3285
  }
3347
3286
  else {
3348
- return this._def.schema
3349
- ._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx })
3350
- .then((inner) => {
3287
+ return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((inner) => {
3351
3288
  if (inner.status === "aborted")
3352
- return parseUtil_1.INVALID;
3289
+ return parseUtil_js_1.INVALID;
3353
3290
  if (inner.status === "dirty")
3354
3291
  status.dirty();
3355
3292
  return executeRefinement(inner.value).then(() => {
@@ -3365,8 +3302,8 @@ class ZodEffects extends ZodType {
3365
3302
  path: ctx.path,
3366
3303
  parent: ctx,
3367
3304
  });
3368
- if (!(0, parseUtil_1.isValid)(base))
3369
- return base;
3305
+ if (!(0, parseUtil_js_1.isValid)(base))
3306
+ return parseUtil_js_1.INVALID;
3370
3307
  const result = effect.transform(base.value, checkCtx);
3371
3308
  if (result instanceof Promise) {
3372
3309
  throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);
@@ -3374,16 +3311,17 @@ class ZodEffects extends ZodType {
3374
3311
  return { status: status.value, value: result };
3375
3312
  }
3376
3313
  else {
3377
- return this._def.schema
3378
- ._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx })
3379
- .then((base) => {
3380
- if (!(0, parseUtil_1.isValid)(base))
3381
- return base;
3382
- return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({ status: status.value, value: result }));
3314
+ return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((base) => {
3315
+ if (!(0, parseUtil_js_1.isValid)(base))
3316
+ return parseUtil_js_1.INVALID;
3317
+ return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({
3318
+ status: status.value,
3319
+ value: result,
3320
+ }));
3383
3321
  });
3384
3322
  }
3385
3323
  }
3386
- util_1.util.assertNever(effect);
3324
+ util_js_1.util.assertNever(effect);
3387
3325
  }
3388
3326
  }
3389
3327
  exports.ZodEffects = ZodEffects;
@@ -3407,8 +3345,8 @@ ZodEffects.createWithPreprocess = (preprocess, schema, params) => {
3407
3345
  class ZodOptional extends ZodType {
3408
3346
  _parse(input) {
3409
3347
  const parsedType = this._getType(input);
3410
- if (parsedType === util_1.ZodParsedType.undefined) {
3411
- return (0, parseUtil_1.OK)(undefined);
3348
+ if (parsedType === util_js_1.ZodParsedType.undefined) {
3349
+ return (0, parseUtil_js_1.OK)(undefined);
3412
3350
  }
3413
3351
  return this._def.innerType._parse(input);
3414
3352
  }
@@ -3427,8 +3365,8 @@ ZodOptional.create = (type, params) => {
3427
3365
  class ZodNullable extends ZodType {
3428
3366
  _parse(input) {
3429
3367
  const parsedType = this._getType(input);
3430
- if (parsedType === util_1.ZodParsedType.null) {
3431
- return (0, parseUtil_1.OK)(null);
3368
+ if (parsedType === util_js_1.ZodParsedType.null) {
3369
+ return (0, parseUtil_js_1.OK)(null);
3432
3370
  }
3433
3371
  return this._def.innerType._parse(input);
3434
3372
  }
@@ -3448,7 +3386,7 @@ class ZodDefault extends ZodType {
3448
3386
  _parse(input) {
3449
3387
  const { ctx } = this._processInputParams(input);
3450
3388
  let data = ctx.data;
3451
- if (ctx.parsedType === util_1.ZodParsedType.undefined) {
3389
+ if (ctx.parsedType === util_js_1.ZodParsedType.undefined) {
3452
3390
  data = this._def.defaultValue();
3453
3391
  }
3454
3392
  return this._def.innerType._parse({
@@ -3466,9 +3404,7 @@ ZodDefault.create = (type, params) => {
3466
3404
  return new ZodDefault({
3467
3405
  innerType: type,
3468
3406
  typeName: ZodFirstPartyTypeKind.ZodDefault,
3469
- defaultValue: typeof params.default === "function"
3470
- ? params.default
3471
- : () => params.default,
3407
+ defaultValue: typeof params.default === "function" ? params.default : () => params.default,
3472
3408
  ...processCreateParams(params),
3473
3409
  });
3474
3410
  };
@@ -3490,7 +3426,7 @@ class ZodCatch extends ZodType {
3490
3426
  ...newCtx,
3491
3427
  },
3492
3428
  });
3493
- if ((0, parseUtil_1.isAsync)(result)) {
3429
+ if ((0, parseUtil_js_1.isAsync)(result)) {
3494
3430
  return result.then((result) => {
3495
3431
  return {
3496
3432
  status: "valid",
@@ -3498,7 +3434,7 @@ class ZodCatch extends ZodType {
3498
3434
  ? result.value
3499
3435
  : this._def.catchValue({
3500
3436
  get error() {
3501
- return new ZodError_1.ZodError(newCtx.common.issues);
3437
+ return new ZodError_js_1.ZodError(newCtx.common.issues);
3502
3438
  },
3503
3439
  input: newCtx.data,
3504
3440
  }),
@@ -3512,7 +3448,7 @@ class ZodCatch extends ZodType {
3512
3448
  ? result.value
3513
3449
  : this._def.catchValue({
3514
3450
  get error() {
3515
- return new ZodError_1.ZodError(newCtx.common.issues);
3451
+ return new ZodError_js_1.ZodError(newCtx.common.issues);
3516
3452
  },
3517
3453
  input: newCtx.data,
3518
3454
  }),
@@ -3535,14 +3471,14 @@ ZodCatch.create = (type, params) => {
3535
3471
  class ZodNaN extends ZodType {
3536
3472
  _parse(input) {
3537
3473
  const parsedType = this._getType(input);
3538
- if (parsedType !== util_1.ZodParsedType.nan) {
3474
+ if (parsedType !== util_js_1.ZodParsedType.nan) {
3539
3475
  const ctx = this._getOrReturnCtx(input);
3540
- (0, parseUtil_1.addIssueToContext)(ctx, {
3541
- code: ZodError_1.ZodIssueCode.invalid_type,
3542
- expected: util_1.ZodParsedType.nan,
3476
+ (0, parseUtil_js_1.addIssueToContext)(ctx, {
3477
+ code: ZodError_js_1.ZodIssueCode.invalid_type,
3478
+ expected: util_js_1.ZodParsedType.nan,
3543
3479
  received: ctx.parsedType,
3544
3480
  });
3545
- return parseUtil_1.INVALID;
3481
+ return parseUtil_js_1.INVALID;
3546
3482
  }
3547
3483
  return { status: "valid", value: input.data };
3548
3484
  }
@@ -3581,10 +3517,10 @@ class ZodPipeline extends ZodType {
3581
3517
  parent: ctx,
3582
3518
  });
3583
3519
  if (inResult.status === "aborted")
3584
- return parseUtil_1.INVALID;
3520
+ return parseUtil_js_1.INVALID;
3585
3521
  if (inResult.status === "dirty") {
3586
3522
  status.dirty();
3587
- return (0, parseUtil_1.DIRTY)(inResult.value);
3523
+ return (0, parseUtil_js_1.DIRTY)(inResult.value);
3588
3524
  }
3589
3525
  else {
3590
3526
  return this._def.out._parseAsync({
@@ -3603,7 +3539,7 @@ class ZodPipeline extends ZodType {
3603
3539
  parent: ctx,
3604
3540
  });
3605
3541
  if (inResult.status === "aborted")
3606
- return parseUtil_1.INVALID;
3542
+ return parseUtil_js_1.INVALID;
3607
3543
  if (inResult.status === "dirty") {
3608
3544
  status.dirty();
3609
3545
  return {
@@ -3633,14 +3569,12 @@ class ZodReadonly extends ZodType {
3633
3569
  _parse(input) {
3634
3570
  const result = this._def.innerType._parse(input);
3635
3571
  const freeze = (data) => {
3636
- if ((0, parseUtil_1.isValid)(data)) {
3572
+ if ((0, parseUtil_js_1.isValid)(data)) {
3637
3573
  data.value = Object.freeze(data.value);
3638
3574
  }
3639
3575
  return data;
3640
3576
  };
3641
- return (0, parseUtil_1.isAsync)(result)
3642
- ? result.then((data) => freeze(data))
3643
- : freeze(result);
3577
+ return (0, parseUtil_js_1.isAsync)(result) ? result.then((data) => freeze(data)) : freeze(result);
3644
3578
  }
3645
3579
  unwrap() {
3646
3580
  return this._def.innerType;
@@ -3662,11 +3596,7 @@ ZodReadonly.create = (type, params) => {
3662
3596
  ////////////////////////////////////////
3663
3597
  ////////////////////////////////////////
3664
3598
  function cleanParams(params, data) {
3665
- const p = typeof params === "function"
3666
- ? params(data)
3667
- : typeof params === "string"
3668
- ? { message: params }
3669
- : params;
3599
+ const p = typeof params === "function" ? params(data) : typeof params === "string" ? { message: params } : params;
3670
3600
  const p2 = typeof p === "string" ? { message: p } : p;
3671
3601
  return p2;
3672
3602
  }
@@ -3684,28 +3614,25 @@ function custom(check, _params = {},
3684
3614
  fatal) {
3685
3615
  if (check)
3686
3616
  return ZodAny.create().superRefine((data, ctx) => {
3687
- var _a, _b;
3688
3617
  const r = check(data);
3689
3618
  if (r instanceof Promise) {
3690
3619
  return r.then((r) => {
3691
- var _a, _b;
3692
3620
  if (!r) {
3693
3621
  const params = cleanParams(_params, data);
3694
- const _fatal = (_b = (_a = params.fatal) !== null && _a !== void 0 ? _a : fatal) !== null && _b !== void 0 ? _b : true;
3622
+ const _fatal = params.fatal ?? fatal ?? true;
3695
3623
  ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
3696
3624
  }
3697
3625
  });
3698
3626
  }
3699
3627
  if (!r) {
3700
3628
  const params = cleanParams(_params, data);
3701
- const _fatal = (_b = (_a = params.fatal) !== null && _a !== void 0 ? _a : fatal) !== null && _b !== void 0 ? _b : true;
3629
+ const _fatal = params.fatal ?? fatal ?? true;
3702
3630
  ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
3703
3631
  }
3704
3632
  return;
3705
3633
  });
3706
3634
  return ZodAny.create();
3707
3635
  }
3708
- exports.custom = custom;
3709
3636
  exports.late = {
3710
3637
  object: ZodObject.lazycreate,
3711
3638
  };
@@ -3843,4 +3770,4 @@ exports.coerce = {
3843
3770
  bigint: ((arg) => ZodBigInt.create({ ...arg, coerce: true })),
3844
3771
  date: ((arg) => ZodDate.create({ ...arg, coerce: true })),
3845
3772
  };
3846
- exports.NEVER = parseUtil_1.INVALID;
3773
+ exports.NEVER = parseUtil_js_1.INVALID;