zod 3.25.13 → 3.25.15

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 (655) hide show
  1. package/dist/{commonjs/v3 → v3}/index.js +7 -17
  2. package/dist/v3/tests/all-errors.test.js +147 -0
  3. package/dist/v3/tests/anyunknown.test.js +47 -0
  4. package/dist/v3/tests/array.test.js +80 -0
  5. package/dist/v3/tests/async-parsing.test.d.ts +1 -0
  6. package/dist/v3/tests/async-parsing.test.js +381 -0
  7. package/dist/v3/tests/async-refinements.test.d.ts +1 -0
  8. package/dist/v3/tests/async-refinements.test.js +60 -0
  9. package/dist/v3/tests/base.test.d.ts +1 -0
  10. package/dist/v3/tests/base.test.js +47 -0
  11. package/dist/v3/tests/bigint.test.d.ts +1 -0
  12. package/dist/v3/tests/bigint.test.js +74 -0
  13. package/dist/v3/tests/branded.test.d.ts +1 -0
  14. package/dist/v3/tests/branded.test.js +58 -0
  15. package/dist/v3/tests/catch.test.d.ts +1 -0
  16. package/dist/v3/tests/catch.test.js +181 -0
  17. package/dist/v3/tests/coerce.test.d.ts +1 -0
  18. package/dist/v3/tests/coerce.test.js +152 -0
  19. package/dist/v3/tests/complex.test.d.ts +1 -0
  20. package/dist/v3/tests/complex.test.js +78 -0
  21. package/dist/v3/tests/custom.test.d.ts +1 -0
  22. package/dist/v3/tests/custom.test.js +51 -0
  23. package/dist/v3/tests/date.test.d.ts +1 -0
  24. package/dist/v3/tests/date.test.js +49 -0
  25. package/dist/v3/tests/deepmasking.test.d.ts +1 -0
  26. package/dist/v3/tests/deepmasking.test.js +187 -0
  27. package/dist/v3/tests/default.test.d.ts +1 -0
  28. package/dist/v3/tests/default.test.js +86 -0
  29. package/dist/v3/tests/description.test.d.ts +1 -0
  30. package/dist/v3/tests/description.test.js +51 -0
  31. package/dist/v3/tests/discriminated-unions.test.d.ts +1 -0
  32. package/dist/v3/tests/discriminated-unions.test.js +321 -0
  33. package/dist/v3/tests/enum.test.d.ts +1 -0
  34. package/dist/v3/tests/enum.test.js +91 -0
  35. package/dist/v3/tests/error.test.d.ts +1 -0
  36. package/dist/v3/tests/error.test.js +526 -0
  37. package/dist/v3/tests/firstparty.test.d.ts +1 -0
  38. package/dist/v3/tests/firstparty.test.js +109 -0
  39. package/dist/v3/tests/firstpartyschematypes.test.d.ts +1 -0
  40. package/dist/v3/tests/firstpartyschematypes.test.js +8 -0
  41. package/dist/v3/tests/function.test.d.ts +1 -0
  42. package/dist/v3/tests/function.test.js +236 -0
  43. package/dist/v3/tests/generics.test.d.ts +1 -0
  44. package/dist/v3/tests/generics.test.js +67 -0
  45. package/dist/v3/tests/instanceof.test.d.ts +1 -0
  46. package/dist/v3/tests/instanceof.test.js +60 -0
  47. package/dist/v3/tests/intersection.test.d.ts +1 -0
  48. package/dist/v3/tests/intersection.test.js +111 -0
  49. package/dist/{commonjs/v3 → v3}/tests/language-server.source.js +7 -17
  50. package/dist/v3/tests/language-server.test.d.ts +1 -0
  51. package/dist/v3/tests/language-server.test.js +177 -0
  52. package/dist/v3/tests/literal.test.d.ts +1 -0
  53. package/dist/v3/tests/literal.test.js +55 -0
  54. package/dist/v3/tests/map.test.d.ts +1 -0
  55. package/dist/v3/tests/map.test.js +112 -0
  56. package/dist/v3/tests/masking.test.d.ts +1 -0
  57. package/dist/v3/tests/masking.test.js +5 -0
  58. package/dist/v3/tests/mocker.test.d.ts +1 -0
  59. package/dist/v3/tests/mocker.test.js +19 -0
  60. package/dist/v3/tests/nan.test.d.ts +1 -0
  61. package/dist/v3/tests/nan.test.js +42 -0
  62. package/dist/v3/tests/nativeEnum.test.d.ts +1 -0
  63. package/dist/v3/tests/nativeEnum.test.js +100 -0
  64. package/dist/v3/tests/nullable.test.d.ts +1 -0
  65. package/dist/v3/tests/nullable.test.js +65 -0
  66. package/dist/v3/tests/number.test.d.ts +1 -0
  67. package/dist/v3/tests/number.test.js +189 -0
  68. package/dist/v3/tests/object-augmentation.test.d.ts +1 -0
  69. package/dist/v3/tests/object-augmentation.test.js +50 -0
  70. package/dist/v3/tests/object-in-es5-env.test.d.ts +1 -0
  71. package/dist/v3/tests/object-in-es5-env.test.js +49 -0
  72. package/dist/v3/tests/object.test.d.ts +1 -0
  73. package/dist/v3/tests/object.test.js +352 -0
  74. package/dist/v3/tests/optional.test.d.ts +1 -0
  75. package/dist/v3/tests/optional.test.js +65 -0
  76. package/dist/v3/tests/parseUtil.test.d.ts +1 -0
  77. package/dist/v3/tests/parseUtil.test.js +20 -0
  78. package/dist/v3/tests/parser.test.d.ts +1 -0
  79. package/dist/v3/tests/parser.test.js +55 -0
  80. package/dist/v3/tests/partials.test.d.ts +1 -0
  81. package/dist/v3/tests/partials.test.js +201 -0
  82. package/dist/v3/tests/pickomit.test.d.ts +1 -0
  83. package/dist/v3/tests/pickomit.test.js +113 -0
  84. package/dist/v3/tests/pipeline.test.d.ts +1 -0
  85. package/dist/v3/tests/pipeline.test.js +50 -0
  86. package/dist/v3/tests/preprocess.test.d.ts +1 -0
  87. package/dist/v3/tests/preprocess.test.js +181 -0
  88. package/dist/v3/tests/primitive.test.d.ts +1 -0
  89. package/dist/v3/tests/primitive.test.js +385 -0
  90. package/dist/v3/tests/promise.test.d.ts +1 -0
  91. package/dist/v3/tests/promise.test.js +98 -0
  92. package/dist/v3/tests/readonly.test.d.ts +1 -0
  93. package/dist/v3/tests/readonly.test.js +190 -0
  94. package/dist/v3/tests/record.test.d.ts +1 -0
  95. package/dist/v3/tests/record.test.js +153 -0
  96. package/dist/v3/tests/recursive.test.d.ts +1 -0
  97. package/dist/v3/tests/recursive.test.js +161 -0
  98. package/dist/v3/tests/refine.test.d.ts +1 -0
  99. package/dist/v3/tests/refine.test.js +279 -0
  100. package/dist/v3/tests/safeparse.test.d.ts +1 -0
  101. package/dist/v3/tests/safeparse.test.js +46 -0
  102. package/dist/v3/tests/set.test.d.ts +1 -0
  103. package/dist/v3/tests/set.test.js +144 -0
  104. package/dist/v3/tests/standard-schema.test.d.ts +1 -0
  105. package/dist/v3/tests/standard-schema.test.js +102 -0
  106. package/dist/v3/tests/string.test.d.ts +1 -0
  107. package/dist/v3/tests/string.test.js +842 -0
  108. package/dist/v3/tests/transformer.test.d.ts +1 -0
  109. package/dist/v3/tests/transformer.test.js +218 -0
  110. package/dist/v3/tests/tuple.test.d.ts +1 -0
  111. package/dist/v3/tests/tuple.test.js +97 -0
  112. package/dist/v3/tests/unions.test.d.ts +1 -0
  113. package/dist/v3/tests/unions.test.js +75 -0
  114. package/dist/v3/tests/validations.test.d.ts +1 -0
  115. package/dist/v3/tests/validations.test.js +155 -0
  116. package/dist/v3/tests/void.test.d.ts +1 -0
  117. package/dist/v3/tests/void.test.js +36 -0
  118. package/dist/{commonjs/v4 → v4}/classic/coerce.js +7 -17
  119. package/dist/{commonjs/v4 → v4}/classic/compat.js +7 -17
  120. package/dist/{commonjs/v4 → v4}/classic/errors.js +7 -17
  121. package/dist/{commonjs/v4 → v4}/classic/external.js +7 -17
  122. package/dist/{commonjs/v4 → v4}/classic/index.js +7 -17
  123. package/dist/{commonjs/v4 → v4}/classic/iso.js +7 -17
  124. package/dist/{commonjs/v4 → v4}/classic/parse.js +7 -17
  125. package/dist/{commonjs/v4 → v4}/classic/schemas.js +7 -17
  126. package/dist/v4/classic/tests/anyunknown.test.d.ts +1 -0
  127. package/dist/v4/classic/tests/anyunknown.test.js +45 -0
  128. package/dist/v4/classic/tests/array.test.d.ts +1 -0
  129. package/dist/v4/classic/tests/array.test.js +249 -0
  130. package/dist/v4/classic/tests/assignability.test.d.ts +1 -0
  131. package/dist/v4/classic/tests/assignability.test.js +110 -0
  132. package/dist/v4/classic/tests/async-parsing.test.d.ts +1 -0
  133. package/dist/v4/classic/tests/async-parsing.test.js +364 -0
  134. package/dist/v4/classic/tests/async-refinements.test.d.ts +1 -0
  135. package/dist/v4/classic/tests/async-refinements.test.js +82 -0
  136. package/dist/v4/classic/tests/base.test.d.ts +1 -0
  137. package/dist/v4/classic/tests/base.test.js +31 -0
  138. package/dist/v4/classic/tests/bigint.test.d.ts +1 -0
  139. package/dist/v4/classic/tests/bigint.test.js +73 -0
  140. package/dist/v4/classic/tests/brand.test.d.ts +1 -0
  141. package/dist/v4/classic/tests/brand.test.js +60 -0
  142. package/dist/v4/classic/tests/catch.test.d.ts +1 -0
  143. package/dist/v4/classic/tests/catch.test.js +214 -0
  144. package/dist/v4/classic/tests/coalesce.test.d.ts +1 -0
  145. package/dist/v4/classic/tests/coalesce.test.js +18 -0
  146. package/dist/v4/classic/tests/coerce.test.d.ts +1 -0
  147. package/dist/v4/classic/tests/coerce.test.js +175 -0
  148. package/dist/v4/classic/tests/custom.test.d.ts +1 -0
  149. package/dist/v4/classic/tests/custom.test.js +38 -0
  150. package/dist/v4/classic/tests/date.test.d.ts +1 -0
  151. package/dist/v4/classic/tests/date.test.js +48 -0
  152. package/dist/v4/classic/tests/default.test.d.ts +1 -0
  153. package/dist/v4/classic/tests/default.test.js +88 -0
  154. package/dist/v4/classic/tests/description.test.d.ts +1 -0
  155. package/dist/v4/classic/tests/description.test.js +51 -0
  156. package/dist/v4/classic/tests/discriminated-unions.test.d.ts +1 -0
  157. package/dist/v4/classic/tests/discriminated-unions.test.js +540 -0
  158. package/dist/v4/classic/tests/enum.test.d.ts +1 -0
  159. package/dist/v4/classic/tests/enum.test.js +260 -0
  160. package/dist/v4/classic/tests/error-utils.test.d.ts +1 -0
  161. package/dist/v4/classic/tests/error-utils.test.js +411 -0
  162. package/dist/v4/classic/tests/error.test.d.ts +1 -0
  163. package/dist/v4/classic/tests/error.test.js +651 -0
  164. package/dist/v4/classic/tests/file.test.d.ts +1 -0
  165. package/dist/v4/classic/tests/file.test.js +68 -0
  166. package/dist/v4/classic/tests/firstparty.test.d.ts +1 -0
  167. package/dist/v4/classic/tests/firstparty.test.js +198 -0
  168. package/dist/v4/classic/tests/function.test.d.ts +1 -0
  169. package/dist/v4/classic/tests/function.test.js +219 -0
  170. package/dist/v4/classic/tests/generics.test.d.ts +1 -0
  171. package/dist/v4/classic/tests/generics.test.js +72 -0
  172. package/dist/v4/classic/tests/index.test.d.ts +1 -0
  173. package/dist/v4/classic/tests/index.test.js +764 -0
  174. package/dist/v4/classic/tests/instanceof.test.d.ts +1 -0
  175. package/dist/v4/classic/tests/instanceof.test.js +58 -0
  176. package/dist/v4/classic/tests/intersection.test.d.ts +1 -0
  177. package/dist/v4/classic/tests/intersection.test.js +134 -0
  178. package/dist/v4/classic/tests/json-schema.test.d.ts +1 -0
  179. package/dist/v4/classic/tests/json-schema.test.js +1707 -0
  180. package/dist/v4/classic/tests/json.test.d.ts +1 -0
  181. package/dist/v4/classic/tests/json.test.js +105 -0
  182. package/dist/v4/classic/tests/lazy.test.d.ts +1 -0
  183. package/dist/v4/classic/tests/lazy.test.js +185 -0
  184. package/dist/v4/classic/tests/literal.test.d.ts +1 -0
  185. package/dist/v4/classic/tests/literal.test.js +94 -0
  186. package/dist/v4/classic/tests/map.test.d.ts +1 -0
  187. package/dist/v4/classic/tests/map.test.js +193 -0
  188. package/dist/v4/classic/tests/nan.test.d.ts +1 -0
  189. package/dist/v4/classic/tests/nan.test.js +42 -0
  190. package/dist/v4/classic/tests/nested-refine.test.d.ts +1 -0
  191. package/dist/v4/classic/tests/nested-refine.test.js +180 -0
  192. package/dist/v4/classic/tests/nonoptional.test.d.ts +1 -0
  193. package/dist/v4/classic/tests/nonoptional.test.js +80 -0
  194. package/dist/v4/classic/tests/nullable.test.d.ts +1 -0
  195. package/dist/v4/classic/tests/nullable.test.js +43 -0
  196. package/dist/v4/classic/tests/number.test.d.ts +1 -0
  197. package/dist/v4/classic/tests/number.test.js +241 -0
  198. package/dist/v4/classic/tests/object.test.d.ts +1 -0
  199. package/dist/v4/classic/tests/object.test.js +405 -0
  200. package/dist/v4/classic/tests/optional.test.d.ts +1 -0
  201. package/dist/v4/classic/tests/optional.test.js +98 -0
  202. package/dist/v4/classic/tests/partial.test.d.ts +1 -0
  203. package/dist/v4/classic/tests/partial.test.js +137 -0
  204. package/dist/v4/classic/tests/pickomit.test.d.ts +1 -0
  205. package/dist/v4/classic/tests/pickomit.test.js +125 -0
  206. package/dist/v4/classic/tests/pipe.test.d.ts +1 -0
  207. package/dist/v4/classic/tests/pipe.test.js +92 -0
  208. package/dist/v4/classic/tests/prefault.test.d.ts +1 -0
  209. package/dist/v4/classic/tests/prefault.test.js +22 -0
  210. package/dist/v4/classic/tests/preprocess.test.d.ts +1 -0
  211. package/dist/v4/classic/tests/preprocess.test.js +273 -0
  212. package/dist/v4/classic/tests/primitive.test.d.ts +1 -0
  213. package/dist/v4/classic/tests/primitive.test.js +184 -0
  214. package/dist/v4/classic/tests/promise.test.d.ts +1 -0
  215. package/dist/v4/classic/tests/promise.test.js +91 -0
  216. package/dist/v4/classic/tests/readonly.test.d.ts +1 -0
  217. package/dist/v4/classic/tests/readonly.test.js +241 -0
  218. package/dist/v4/classic/tests/record.test.d.ts +1 -0
  219. package/dist/v4/classic/tests/record.test.js +307 -0
  220. package/dist/v4/classic/tests/recursive-types.test.d.ts +1 -0
  221. package/dist/v4/classic/tests/recursive-types.test.js +108 -0
  222. package/dist/v4/classic/tests/refine.test.d.ts +1 -0
  223. package/dist/v4/classic/tests/refine.test.js +402 -0
  224. package/dist/v4/classic/tests/registries.test.d.ts +1 -0
  225. package/dist/v4/classic/tests/registries.test.js +155 -0
  226. package/dist/v4/classic/tests/set.test.d.ts +1 -0
  227. package/dist/v4/classic/tests/set.test.js +182 -0
  228. package/dist/v4/classic/tests/standard-schema.test.d.ts +1 -0
  229. package/dist/v4/classic/tests/standard-schema.test.js +77 -0
  230. package/dist/v4/classic/tests/string-formats.test.d.ts +1 -0
  231. package/dist/v4/classic/tests/string-formats.test.js +49 -0
  232. package/dist/v4/classic/tests/string.test.d.ts +1 -0
  233. package/dist/v4/classic/tests/string.test.js +980 -0
  234. package/dist/v4/classic/tests/template-literal.test.d.ts +1 -0
  235. package/dist/v4/classic/tests/template-literal.test.js +705 -0
  236. package/dist/v4/classic/tests/transform.test.d.ts +1 -0
  237. package/dist/v4/classic/tests/transform.test.js +239 -0
  238. package/dist/v4/classic/tests/tuple.test.d.ts +1 -0
  239. package/dist/v4/classic/tests/tuple.test.js +166 -0
  240. package/dist/v4/classic/tests/union.test.d.ts +1 -0
  241. package/dist/v4/classic/tests/union.test.js +107 -0
  242. package/dist/v4/classic/tests/validations.test.d.ts +1 -0
  243. package/dist/v4/classic/tests/validations.test.js +301 -0
  244. package/dist/v4/classic/tests/void.test.d.ts +1 -0
  245. package/dist/v4/classic/tests/void.test.js +34 -0
  246. package/dist/{commonjs/v4 → v4}/core/api.js +11 -17
  247. package/dist/{commonjs/v4 → v4}/core/checks.js +7 -17
  248. package/dist/{commonjs/v4 → v4}/core/errors.js +7 -17
  249. package/dist/{commonjs/v4 → v4}/core/function.js +7 -17
  250. package/dist/{commonjs/v4 → v4}/core/index.js +7 -17
  251. package/dist/v4/core/json-schema.mjs +1 -0
  252. package/dist/{commonjs/v4 → v4}/core/parse.js +7 -17
  253. package/dist/{commonjs/v4 → v4}/core/schemas.js +7 -17
  254. package/dist/v4/core/standard-schema.mjs +1 -0
  255. package/dist/v4/core/tests/index.test.d.ts +1 -0
  256. package/dist/v4/core/tests/index.test.js +66 -0
  257. package/dist/v4/core/tests/locales/be.test.d.ts +1 -0
  258. package/dist/v4/core/tests/locales/be.test.js +123 -0
  259. package/dist/v4/core/tests/locales/en.test.d.ts +1 -0
  260. package/dist/v4/core/tests/locales/en.test.js +21 -0
  261. package/dist/v4/core/tests/locales/ru.test.d.ts +1 -0
  262. package/dist/v4/core/tests/locales/ru.test.js +123 -0
  263. package/dist/v4/core/tests/locales/tr.test.d.ts +1 -0
  264. package/dist/v4/core/tests/locales/tr.test.js +79 -0
  265. package/dist/{commonjs/v4 → v4}/locales/ar.js +7 -17
  266. package/dist/{commonjs/v4 → v4}/locales/az.js +7 -17
  267. package/dist/{commonjs/v4 → v4}/locales/be.js +7 -17
  268. package/dist/{commonjs/v4 → v4}/locales/ca.js +7 -17
  269. package/dist/{commonjs/v4 → v4}/locales/cs.js +7 -17
  270. package/dist/{commonjs/v4 → v4}/locales/de.js +7 -17
  271. package/dist/{commonjs/v4 → v4}/locales/en.js +7 -17
  272. package/dist/{commonjs/v4 → v4}/locales/es.js +7 -17
  273. package/dist/{commonjs/v4 → v4}/locales/fa.js +7 -17
  274. package/dist/{commonjs/v4 → v4}/locales/fi.js +7 -17
  275. package/dist/{commonjs/v4 → v4}/locales/fr.js +7 -17
  276. package/dist/{commonjs/v4 → v4}/locales/frCA.js +7 -17
  277. package/dist/{commonjs/v4 → v4}/locales/he.js +7 -17
  278. package/dist/{commonjs/v4 → v4}/locales/hu.js +7 -17
  279. package/dist/{commonjs/v4 → v4}/locales/id.js +7 -17
  280. package/dist/{commonjs/v4 → v4}/locales/it.js +7 -17
  281. package/dist/{commonjs/v4 → v4}/locales/ja.js +7 -17
  282. package/dist/{commonjs/v4 → v4}/locales/ko.js +7 -17
  283. package/dist/{commonjs/v4 → v4}/locales/mk.js +7 -17
  284. package/dist/{commonjs/v4 → v4}/locales/ms.js +7 -17
  285. package/dist/{commonjs/v4 → v4}/locales/no.js +7 -17
  286. package/dist/{commonjs/v4 → v4}/locales/ota.js +7 -17
  287. package/dist/{commonjs/v4 → v4}/locales/pl.js +7 -17
  288. package/dist/{commonjs/v4 → v4}/locales/pt.js +7 -17
  289. package/dist/{commonjs/v4 → v4}/locales/ru.js +7 -17
  290. package/dist/{commonjs/v4 → v4}/locales/sl.js +7 -17
  291. package/dist/{commonjs/v4 → v4}/locales/ta.js +7 -17
  292. package/dist/{commonjs/v4 → v4}/locales/th.js +7 -17
  293. package/dist/{commonjs/v4 → v4}/locales/tr.js +7 -17
  294. package/dist/{commonjs/v4 → v4}/locales/ua.js +7 -17
  295. package/dist/{commonjs/v4 → v4}/locales/ur.js +7 -17
  296. package/dist/{commonjs/v4 → v4}/locales/vi.js +7 -17
  297. package/dist/{commonjs/v4 → v4}/locales/zh-CN.js +7 -17
  298. package/dist/{commonjs/v4 → v4}/locales/zh-tw.js +7 -17
  299. package/dist/{commonjs/v4 → v4}/mini/coerce.js +7 -17
  300. package/dist/{commonjs/v4 → v4}/mini/external.js +7 -17
  301. package/dist/{commonjs/v4 → v4}/mini/index.js +7 -17
  302. package/dist/{commonjs/v4 → v4}/mini/iso.js +7 -17
  303. package/dist/{commonjs/v4 → v4}/mini/schemas.js +7 -17
  304. package/dist/v4/mini/tests/assignability.test.d.ts +1 -0
  305. package/dist/v4/mini/tests/assignability.test.js +104 -0
  306. package/dist/v4/mini/tests/brand.test.d.ts +1 -0
  307. package/dist/v4/mini/tests/brand.test.js +58 -0
  308. package/dist/v4/mini/tests/checks.test.d.ts +1 -0
  309. package/dist/v4/mini/tests/checks.test.js +147 -0
  310. package/dist/v4/mini/tests/computed.test.d.ts +1 -0
  311. package/dist/v4/mini/tests/computed.test.js +55 -0
  312. package/dist/v4/mini/tests/error.test.d.ts +1 -0
  313. package/dist/v4/mini/tests/error.test.js +45 -0
  314. package/dist/v4/mini/tests/functions.test.d.ts +1 -0
  315. package/dist/v4/mini/tests/functions.test.js +37 -0
  316. package/dist/v4/mini/tests/index.test.d.ts +1 -0
  317. package/dist/v4/mini/tests/index.test.js +763 -0
  318. package/dist/v4/mini/tests/number.test.d.ts +1 -0
  319. package/dist/v4/mini/tests/number.test.js +109 -0
  320. package/dist/v4/mini/tests/object.test.d.ts +1 -0
  321. package/dist/v4/mini/tests/object.test.js +122 -0
  322. package/dist/v4/mini/tests/prototypes.test.d.ts +1 -0
  323. package/dist/v4/mini/tests/prototypes.test.js +44 -0
  324. package/dist/v4/mini/tests/recursive-types.test.d.ts +1 -0
  325. package/dist/v4/mini/tests/recursive-types.test.js +106 -0
  326. package/dist/v4/mini/tests/string.test.d.ts +1 -0
  327. package/dist/v4/mini/tests/string.test.js +265 -0
  328. package/package.json +35 -73
  329. package/src/v4/classic/tests/file.test.ts +1 -0
  330. package/dist/commonjs/package.json +0 -3
  331. package/dist/esm/index.js +0 -3
  332. package/dist/esm/package.json +0 -3
  333. package/dist/esm/v3/ZodError.d.ts +0 -164
  334. package/dist/esm/v3/benchmarks/datetime.d.ts +0 -5
  335. package/dist/esm/v3/benchmarks/discriminatedUnion.d.ts +0 -5
  336. package/dist/esm/v3/benchmarks/ipv4.d.ts +0 -5
  337. package/dist/esm/v3/benchmarks/object.d.ts +0 -5
  338. package/dist/esm/v3/benchmarks/primitives.d.ts +0 -5
  339. package/dist/esm/v3/benchmarks/realworld.d.ts +0 -5
  340. package/dist/esm/v3/benchmarks/string.d.ts +0 -5
  341. package/dist/esm/v3/benchmarks/union.d.ts +0 -5
  342. package/dist/esm/v3/errors.d.ts +0 -5
  343. package/dist/esm/v3/external.js +0 -6
  344. package/dist/esm/v3/helpers/enumUtil.d.ts +0 -8
  345. package/dist/esm/v3/helpers/errorUtil.d.ts +0 -9
  346. package/dist/esm/v3/helpers/parseUtil.d.ts +0 -78
  347. package/dist/esm/v3/helpers/partialUtil.d.ts +0 -8
  348. package/dist/esm/v3/helpers/typeAliases.d.ts +0 -2
  349. package/dist/esm/v3/helpers/util.d.ts +0 -85
  350. package/dist/esm/v3/index.js +0 -4
  351. package/dist/esm/v3/locales/en.d.ts +0 -3
  352. package/dist/esm/v3/standard-schema.d.ts +0 -102
  353. package/dist/esm/v3/tests/Mocker.d.ts +0 -17
  354. package/dist/esm/v3/tests/language-server.source.d.ts +0 -70
  355. package/dist/esm/v3/tests/language-server.source.js +0 -45
  356. package/dist/esm/v3/types.d.ts +0 -1031
  357. package/dist/esm/v4/classic/checks.js +0 -1
  358. package/dist/esm/v4/classic/coerce.d.ts +0 -17
  359. package/dist/esm/v4/classic/compat.d.ts +0 -48
  360. package/dist/esm/v4/classic/errors.d.ts +0 -30
  361. package/dist/esm/v4/classic/external.d.ts +0 -8
  362. package/dist/esm/v4/classic/index.js +0 -4
  363. package/dist/esm/v4/classic/iso.d.ts +0 -22
  364. package/dist/esm/v4/classic/parse.d.ts +0 -23
  365. package/dist/esm/v4/classic/schemas.d.ts +0 -653
  366. package/dist/esm/v4/core/api.d.ts +0 -273
  367. package/dist/esm/v4/core/checks.d.ts +0 -277
  368. package/dist/esm/v4/core/config.d.ts +0 -9
  369. package/dist/esm/v4/core/core.d.ts +0 -43
  370. package/dist/esm/v4/core/doc.d.ts +0 -14
  371. package/dist/esm/v4/core/errors.d.ts +0 -204
  372. package/dist/esm/v4/core/function.d.ts +0 -35
  373. package/dist/esm/v4/core/index.js +0 -15
  374. package/dist/esm/v4/core/json-schema.d.ts +0 -100
  375. package/dist/esm/v4/core/parse.d.ts +0 -25
  376. package/dist/esm/v4/core/regexes.d.ts +0 -62
  377. package/dist/esm/v4/core/registries.d.ts +0 -32
  378. package/dist/esm/v4/core/schemas.d.ts +0 -975
  379. package/dist/esm/v4/core/standard-schema.d.ts +0 -55
  380. package/dist/esm/v4/core/to-json-schema.d.ts +0 -84
  381. package/dist/esm/v4/core/util.d.ts +0 -186
  382. package/dist/esm/v4/core/versions.d.ts +0 -5
  383. package/dist/esm/v4/core/zsf.d.ts +0 -91
  384. package/dist/esm/v4/index.js +0 -3
  385. package/dist/esm/v4/locales/ar.d.ts +0 -7
  386. package/dist/esm/v4/locales/az.d.ts +0 -7
  387. package/dist/esm/v4/locales/be.d.ts +0 -7
  388. package/dist/esm/v4/locales/ca.d.ts +0 -7
  389. package/dist/esm/v4/locales/cs.d.ts +0 -7
  390. package/dist/esm/v4/locales/de.d.ts +0 -7
  391. package/dist/esm/v4/locales/en.d.ts +0 -7
  392. package/dist/esm/v4/locales/es.d.ts +0 -7
  393. package/dist/esm/v4/locales/fa.d.ts +0 -7
  394. package/dist/esm/v4/locales/fi.d.ts +0 -7
  395. package/dist/esm/v4/locales/fr.d.ts +0 -7
  396. package/dist/esm/v4/locales/frCA.d.ts +0 -7
  397. package/dist/esm/v4/locales/he.d.ts +0 -7
  398. package/dist/esm/v4/locales/hu.d.ts +0 -7
  399. package/dist/esm/v4/locales/id.d.ts +0 -7
  400. package/dist/esm/v4/locales/index.js +0 -34
  401. package/dist/esm/v4/locales/it.d.ts +0 -7
  402. package/dist/esm/v4/locales/ja.d.ts +0 -7
  403. package/dist/esm/v4/locales/ko.d.ts +0 -7
  404. package/dist/esm/v4/locales/mk.d.ts +0 -7
  405. package/dist/esm/v4/locales/ms.d.ts +0 -7
  406. package/dist/esm/v4/locales/no.d.ts +0 -7
  407. package/dist/esm/v4/locales/ota.d.ts +0 -7
  408. package/dist/esm/v4/locales/pl.d.ts +0 -7
  409. package/dist/esm/v4/locales/pt.d.ts +0 -7
  410. package/dist/esm/v4/locales/ru.d.ts +0 -7
  411. package/dist/esm/v4/locales/sl.d.ts +0 -7
  412. package/dist/esm/v4/locales/ta.d.ts +0 -7
  413. package/dist/esm/v4/locales/th.d.ts +0 -7
  414. package/dist/esm/v4/locales/tr.d.ts +0 -7
  415. package/dist/esm/v4/locales/ua.d.ts +0 -7
  416. package/dist/esm/v4/locales/ur.d.ts +0 -7
  417. package/dist/esm/v4/locales/vi.d.ts +0 -7
  418. package/dist/esm/v4/locales/zh-CN.d.ts +0 -7
  419. package/dist/esm/v4/locales/zh-tw.d.ts +0 -7
  420. package/dist/esm/v4/mini/checks.js +0 -1
  421. package/dist/esm/v4/mini/coerce.d.ts +0 -7
  422. package/dist/esm/v4/mini/external.d.ts +0 -7
  423. package/dist/esm/v4/mini/index.js +0 -3
  424. package/dist/esm/v4/mini/iso.d.ts +0 -22
  425. package/dist/esm/v4/mini/parse.js +0 -1
  426. package/dist/esm/v4/mini/schemas.d.ts +0 -405
  427. /package/dist/{commonjs/index.d.ts → index.d.ts} +0 -0
  428. /package/dist/{commonjs/index.js → index.js} +0 -0
  429. /package/dist/{esm/index.d.ts → index.mjs} +0 -0
  430. /package/dist/{commonjs/v3 → v3}/ZodError.d.ts +0 -0
  431. /package/dist/{commonjs/v3 → v3}/ZodError.js +0 -0
  432. /package/dist/{esm/v3/ZodError.js → v3/ZodError.mjs} +0 -0
  433. /package/dist/{commonjs/v3 → v3}/benchmarks/datetime.d.ts +0 -0
  434. /package/dist/{commonjs/v3 → v3}/benchmarks/datetime.js +0 -0
  435. /package/dist/{esm/v3/benchmarks/datetime.js → v3/benchmarks/datetime.mjs} +0 -0
  436. /package/dist/{commonjs/v3 → v3}/benchmarks/discriminatedUnion.d.ts +0 -0
  437. /package/dist/{commonjs/v3 → v3}/benchmarks/discriminatedUnion.js +0 -0
  438. /package/dist/{esm/v3/benchmarks/discriminatedUnion.js → v3/benchmarks/discriminatedUnion.mjs} +0 -0
  439. /package/dist/{commonjs/v3 → v3}/benchmarks/index.d.ts +0 -0
  440. /package/dist/{commonjs/v3 → v3}/benchmarks/index.js +0 -0
  441. /package/dist/{esm/v3/benchmarks/index.js → v3/benchmarks/index.mjs} +0 -0
  442. /package/dist/{commonjs/v3 → v3}/benchmarks/ipv4.d.ts +0 -0
  443. /package/dist/{commonjs/v3 → v3}/benchmarks/ipv4.js +0 -0
  444. /package/dist/{esm/v3/benchmarks/ipv4.js → v3/benchmarks/ipv4.mjs} +0 -0
  445. /package/dist/{commonjs/v3 → v3}/benchmarks/object.d.ts +0 -0
  446. /package/dist/{commonjs/v3 → v3}/benchmarks/object.js +0 -0
  447. /package/dist/{esm/v3/benchmarks/object.js → v3/benchmarks/object.mjs} +0 -0
  448. /package/dist/{commonjs/v3 → v3}/benchmarks/primitives.d.ts +0 -0
  449. /package/dist/{commonjs/v3 → v3}/benchmarks/primitives.js +0 -0
  450. /package/dist/{esm/v3/benchmarks/primitives.js → v3/benchmarks/primitives.mjs} +0 -0
  451. /package/dist/{commonjs/v3 → v3}/benchmarks/realworld.d.ts +0 -0
  452. /package/dist/{commonjs/v3 → v3}/benchmarks/realworld.js +0 -0
  453. /package/dist/{esm/v3/benchmarks/realworld.js → v3/benchmarks/realworld.mjs} +0 -0
  454. /package/dist/{commonjs/v3 → v3}/benchmarks/string.d.ts +0 -0
  455. /package/dist/{commonjs/v3 → v3}/benchmarks/string.js +0 -0
  456. /package/dist/{esm/v3/benchmarks/string.js → v3/benchmarks/string.mjs} +0 -0
  457. /package/dist/{commonjs/v3 → v3}/benchmarks/union.d.ts +0 -0
  458. /package/dist/{commonjs/v3 → v3}/benchmarks/union.js +0 -0
  459. /package/dist/{esm/v3/benchmarks/union.js → v3/benchmarks/union.mjs} +0 -0
  460. /package/dist/{commonjs/v3 → v3}/errors.d.ts +0 -0
  461. /package/dist/{commonjs/v3 → v3}/errors.js +0 -0
  462. /package/dist/{esm/v3/errors.js → v3/errors.mjs} +0 -0
  463. /package/dist/{commonjs/v3 → v3}/external.d.ts +0 -0
  464. /package/dist/{commonjs/v3 → v3}/external.js +0 -0
  465. /package/dist/{esm/v3/external.d.ts → v3/external.mjs} +0 -0
  466. /package/dist/{commonjs/v3 → v3}/helpers/enumUtil.d.ts +0 -0
  467. /package/dist/{commonjs/v3 → v3}/helpers/enumUtil.js +0 -0
  468. /package/dist/{esm/v3/benchmarks/index.d.ts → v3/helpers/enumUtil.mjs} +0 -0
  469. /package/dist/{commonjs/v3 → v3}/helpers/errorUtil.d.ts +0 -0
  470. /package/dist/{commonjs/v3 → v3}/helpers/errorUtil.js +0 -0
  471. /package/dist/{esm/v3/helpers/errorUtil.js → v3/helpers/errorUtil.mjs} +0 -0
  472. /package/dist/{commonjs/v3 → v3}/helpers/parseUtil.d.ts +0 -0
  473. /package/dist/{commonjs/v3 → v3}/helpers/parseUtil.js +0 -0
  474. /package/dist/{esm/v3/helpers/parseUtil.js → v3/helpers/parseUtil.mjs} +0 -0
  475. /package/dist/{commonjs/v3 → v3}/helpers/partialUtil.d.ts +0 -0
  476. /package/dist/{commonjs/v3 → v3}/helpers/partialUtil.js +0 -0
  477. /package/dist/{esm/v3/helpers/enumUtil.js → v3/helpers/partialUtil.mjs} +0 -0
  478. /package/dist/{commonjs/v3 → v3}/helpers/typeAliases.d.ts +0 -0
  479. /package/dist/{commonjs/v3 → v3}/helpers/typeAliases.js +0 -0
  480. /package/dist/{esm/v3/helpers/partialUtil.js → v3/helpers/typeAliases.mjs} +0 -0
  481. /package/dist/{commonjs/v3 → v3}/helpers/util.d.ts +0 -0
  482. /package/dist/{commonjs/v3 → v3}/helpers/util.js +0 -0
  483. /package/dist/{esm/v3/helpers/util.js → v3/helpers/util.mjs} +0 -0
  484. /package/dist/{commonjs/v3 → v3}/index.d.ts +0 -0
  485. /package/dist/{esm/v3/index.d.ts → v3/index.mjs} +0 -0
  486. /package/dist/{commonjs/v3 → v3}/locales/en.d.ts +0 -0
  487. /package/dist/{commonjs/v3 → v3}/locales/en.js +0 -0
  488. /package/dist/{esm/v3/locales/en.js → v3/locales/en.mjs} +0 -0
  489. /package/dist/{commonjs/v3 → v3}/standard-schema.d.ts +0 -0
  490. /package/dist/{commonjs/v3 → v3}/standard-schema.js +0 -0
  491. /package/dist/{esm/v3/helpers/typeAliases.js → v3/standard-schema.mjs} +0 -0
  492. /package/dist/{commonjs/v3 → v3}/tests/Mocker.d.ts +0 -0
  493. /package/dist/{commonjs/v3 → v3}/tests/Mocker.js +0 -0
  494. /package/dist/{esm/v3/tests/Mocker.js → v3/tests/Mocker.mjs} +0 -0
  495. /package/dist/{esm/v3/standard-schema.js → v3/tests/all-errors.test.d.ts} +0 -0
  496. /package/dist/{esm/v4/core/json-schema.js → v3/tests/anyunknown.test.d.ts} +0 -0
  497. /package/dist/{esm/v4/core/standard-schema.js → v3/tests/array.test.d.ts} +0 -0
  498. /package/dist/{commonjs/v3 → v3}/tests/language-server.source.d.ts +0 -0
  499. /package/dist/{commonjs/v3 → v3}/types.d.ts +0 -0
  500. /package/dist/{commonjs/v3 → v3}/types.js +0 -0
  501. /package/dist/{esm/v3/types.js → v3/types.mjs} +0 -0
  502. /package/dist/{commonjs/v4 → v4}/classic/checks.d.ts +0 -0
  503. /package/dist/{commonjs/v4 → v4}/classic/checks.js +0 -0
  504. /package/dist/{esm/v4/classic/checks.d.ts → v4/classic/checks.mjs} +0 -0
  505. /package/dist/{commonjs/v4 → v4}/classic/coerce.d.ts +0 -0
  506. /package/dist/{esm/v4/classic/coerce.js → v4/classic/coerce.mjs} +0 -0
  507. /package/dist/{commonjs/v4 → v4}/classic/compat.d.ts +0 -0
  508. /package/dist/{esm/v4/classic/compat.js → v4/classic/compat.mjs} +0 -0
  509. /package/dist/{commonjs/v4 → v4}/classic/errors.d.ts +0 -0
  510. /package/dist/{esm/v4/classic/errors.js → v4/classic/errors.mjs} +0 -0
  511. /package/dist/{commonjs/v4 → v4}/classic/external.d.ts +0 -0
  512. /package/dist/{esm/v4/classic/external.js → v4/classic/external.mjs} +0 -0
  513. /package/dist/{commonjs/v4 → v4}/classic/index.d.ts +0 -0
  514. /package/dist/{esm/v4/classic/index.d.ts → v4/classic/index.mjs} +0 -0
  515. /package/dist/{commonjs/v4 → v4}/classic/iso.d.ts +0 -0
  516. /package/dist/{esm/v4/classic/iso.js → v4/classic/iso.mjs} +0 -0
  517. /package/dist/{commonjs/v4 → v4}/classic/parse.d.ts +0 -0
  518. /package/dist/{esm/v4/classic/parse.js → v4/classic/parse.mjs} +0 -0
  519. /package/dist/{commonjs/v4 → v4}/classic/schemas.d.ts +0 -0
  520. /package/dist/{esm/v4/classic/schemas.js → v4/classic/schemas.mjs} +0 -0
  521. /package/dist/{commonjs/v4 → v4}/core/api.d.ts +0 -0
  522. /package/dist/{esm/v4/core/api.js → v4/core/api.mjs} +0 -0
  523. /package/dist/{commonjs/v4 → v4}/core/checks.d.ts +0 -0
  524. /package/dist/{esm/v4/core/checks.js → v4/core/checks.mjs} +0 -0
  525. /package/dist/{commonjs/v4 → v4}/core/config.d.ts +0 -0
  526. /package/dist/{commonjs/v4 → v4}/core/config.js +0 -0
  527. /package/dist/{esm/v4/core/config.js → v4/core/config.mjs} +0 -0
  528. /package/dist/{commonjs/v4 → v4}/core/core.d.ts +0 -0
  529. /package/dist/{commonjs/v4 → v4}/core/core.js +0 -0
  530. /package/dist/{esm/v4/core/core.js → v4/core/core.mjs} +0 -0
  531. /package/dist/{commonjs/v4 → v4}/core/doc.d.ts +0 -0
  532. /package/dist/{commonjs/v4 → v4}/core/doc.js +0 -0
  533. /package/dist/{esm/v4/core/doc.js → v4/core/doc.mjs} +0 -0
  534. /package/dist/{commonjs/v4 → v4}/core/errors.d.ts +0 -0
  535. /package/dist/{esm/v4/core/errors.js → v4/core/errors.mjs} +0 -0
  536. /package/dist/{commonjs/v4 → v4}/core/function.d.ts +0 -0
  537. /package/dist/{esm/v4/core/function.js → v4/core/function.mjs} +0 -0
  538. /package/dist/{commonjs/v4 → v4}/core/index.d.ts +0 -0
  539. /package/dist/{esm/v4/core/index.d.ts → v4/core/index.mjs} +0 -0
  540. /package/dist/{commonjs/v4 → v4}/core/json-schema.d.ts +0 -0
  541. /package/dist/{commonjs/v4 → v4}/core/json-schema.js +0 -0
  542. /package/dist/{commonjs/v4 → v4}/core/parse.d.ts +0 -0
  543. /package/dist/{esm/v4/core/parse.js → v4/core/parse.mjs} +0 -0
  544. /package/dist/{commonjs/v4 → v4}/core/regexes.d.ts +0 -0
  545. /package/dist/{commonjs/v4 → v4}/core/regexes.js +0 -0
  546. /package/dist/{esm/v4/core/regexes.js → v4/core/regexes.mjs} +0 -0
  547. /package/dist/{commonjs/v4 → v4}/core/registries.d.ts +0 -0
  548. /package/dist/{commonjs/v4 → v4}/core/registries.js +0 -0
  549. /package/dist/{esm/v4/core/registries.js → v4/core/registries.mjs} +0 -0
  550. /package/dist/{commonjs/v4 → v4}/core/schemas.d.ts +0 -0
  551. /package/dist/{esm/v4/core/schemas.js → v4/core/schemas.mjs} +0 -0
  552. /package/dist/{commonjs/v4 → v4}/core/standard-schema.d.ts +0 -0
  553. /package/dist/{commonjs/v4 → v4}/core/standard-schema.js +0 -0
  554. /package/dist/{commonjs/v4 → v4}/core/to-json-schema.d.ts +0 -0
  555. /package/dist/{commonjs/v4 → v4}/core/to-json-schema.js +0 -0
  556. /package/dist/{esm/v4/core/to-json-schema.js → v4/core/to-json-schema.mjs} +0 -0
  557. /package/dist/{commonjs/v4 → v4}/core/util.d.ts +0 -0
  558. /package/dist/{commonjs/v4 → v4}/core/util.js +0 -0
  559. /package/dist/{esm/v4/core/util.js → v4/core/util.mjs} +0 -0
  560. /package/dist/{commonjs/v4 → v4}/core/versions.d.ts +0 -0
  561. /package/dist/{commonjs/v4 → v4}/core/versions.js +0 -0
  562. /package/dist/{esm/v4/core/versions.js → v4/core/versions.mjs} +0 -0
  563. /package/dist/{commonjs/v4 → v4}/core/zsf.d.ts +0 -0
  564. /package/dist/{commonjs/v4 → v4}/core/zsf.js +0 -0
  565. /package/dist/{esm/v4/core/zsf.js → v4/core/zsf.mjs} +0 -0
  566. /package/dist/{commonjs/v4 → v4}/index.d.ts +0 -0
  567. /package/dist/{commonjs/v4 → v4}/index.js +0 -0
  568. /package/dist/{esm/v4/index.d.ts → v4/index.mjs} +0 -0
  569. /package/dist/{commonjs/v4 → v4}/locales/ar.d.ts +0 -0
  570. /package/dist/{esm/v4/locales/ar.js → v4/locales/ar.mjs} +0 -0
  571. /package/dist/{commonjs/v4 → v4}/locales/az.d.ts +0 -0
  572. /package/dist/{esm/v4/locales/az.js → v4/locales/az.mjs} +0 -0
  573. /package/dist/{commonjs/v4 → v4}/locales/be.d.ts +0 -0
  574. /package/dist/{esm/v4/locales/be.js → v4/locales/be.mjs} +0 -0
  575. /package/dist/{commonjs/v4 → v4}/locales/ca.d.ts +0 -0
  576. /package/dist/{esm/v4/locales/ca.js → v4/locales/ca.mjs} +0 -0
  577. /package/dist/{commonjs/v4 → v4}/locales/cs.d.ts +0 -0
  578. /package/dist/{esm/v4/locales/cs.js → v4/locales/cs.mjs} +0 -0
  579. /package/dist/{commonjs/v4 → v4}/locales/de.d.ts +0 -0
  580. /package/dist/{esm/v4/locales/de.js → v4/locales/de.mjs} +0 -0
  581. /package/dist/{commonjs/v4 → v4}/locales/en.d.ts +0 -0
  582. /package/dist/{esm/v4/locales/en.js → v4/locales/en.mjs} +0 -0
  583. /package/dist/{commonjs/v4 → v4}/locales/es.d.ts +0 -0
  584. /package/dist/{esm/v4/locales/es.js → v4/locales/es.mjs} +0 -0
  585. /package/dist/{commonjs/v4 → v4}/locales/fa.d.ts +0 -0
  586. /package/dist/{esm/v4/locales/fa.js → v4/locales/fa.mjs} +0 -0
  587. /package/dist/{commonjs/v4 → v4}/locales/fi.d.ts +0 -0
  588. /package/dist/{esm/v4/locales/fi.js → v4/locales/fi.mjs} +0 -0
  589. /package/dist/{commonjs/v4 → v4}/locales/fr.d.ts +0 -0
  590. /package/dist/{esm/v4/locales/fr.js → v4/locales/fr.mjs} +0 -0
  591. /package/dist/{commonjs/v4 → v4}/locales/frCA.d.ts +0 -0
  592. /package/dist/{esm/v4/locales/frCA.js → v4/locales/frCA.mjs} +0 -0
  593. /package/dist/{commonjs/v4 → v4}/locales/he.d.ts +0 -0
  594. /package/dist/{esm/v4/locales/he.js → v4/locales/he.mjs} +0 -0
  595. /package/dist/{commonjs/v4 → v4}/locales/hu.d.ts +0 -0
  596. /package/dist/{esm/v4/locales/hu.js → v4/locales/hu.mjs} +0 -0
  597. /package/dist/{commonjs/v4 → v4}/locales/id.d.ts +0 -0
  598. /package/dist/{esm/v4/locales/id.js → v4/locales/id.mjs} +0 -0
  599. /package/dist/{commonjs/v4 → v4}/locales/index.d.ts +0 -0
  600. /package/dist/{commonjs/v4 → v4}/locales/index.js +0 -0
  601. /package/dist/{esm/v4/locales/index.d.ts → v4/locales/index.mjs} +0 -0
  602. /package/dist/{commonjs/v4 → v4}/locales/it.d.ts +0 -0
  603. /package/dist/{esm/v4/locales/it.js → v4/locales/it.mjs} +0 -0
  604. /package/dist/{commonjs/v4 → v4}/locales/ja.d.ts +0 -0
  605. /package/dist/{esm/v4/locales/ja.js → v4/locales/ja.mjs} +0 -0
  606. /package/dist/{commonjs/v4 → v4}/locales/ko.d.ts +0 -0
  607. /package/dist/{esm/v4/locales/ko.js → v4/locales/ko.mjs} +0 -0
  608. /package/dist/{commonjs/v4 → v4}/locales/mk.d.ts +0 -0
  609. /package/dist/{esm/v4/locales/mk.js → v4/locales/mk.mjs} +0 -0
  610. /package/dist/{commonjs/v4 → v4}/locales/ms.d.ts +0 -0
  611. /package/dist/{esm/v4/locales/ms.js → v4/locales/ms.mjs} +0 -0
  612. /package/dist/{commonjs/v4 → v4}/locales/no.d.ts +0 -0
  613. /package/dist/{esm/v4/locales/no.js → v4/locales/no.mjs} +0 -0
  614. /package/dist/{commonjs/v4 → v4}/locales/ota.d.ts +0 -0
  615. /package/dist/{esm/v4/locales/ota.js → v4/locales/ota.mjs} +0 -0
  616. /package/dist/{commonjs/v4 → v4}/locales/pl.d.ts +0 -0
  617. /package/dist/{esm/v4/locales/pl.js → v4/locales/pl.mjs} +0 -0
  618. /package/dist/{commonjs/v4 → v4}/locales/pt.d.ts +0 -0
  619. /package/dist/{esm/v4/locales/pt.js → v4/locales/pt.mjs} +0 -0
  620. /package/dist/{commonjs/v4 → v4}/locales/ru.d.ts +0 -0
  621. /package/dist/{esm/v4/locales/ru.js → v4/locales/ru.mjs} +0 -0
  622. /package/dist/{commonjs/v4 → v4}/locales/sl.d.ts +0 -0
  623. /package/dist/{esm/v4/locales/sl.js → v4/locales/sl.mjs} +0 -0
  624. /package/dist/{commonjs/v4 → v4}/locales/ta.d.ts +0 -0
  625. /package/dist/{esm/v4/locales/ta.js → v4/locales/ta.mjs} +0 -0
  626. /package/dist/{commonjs/v4 → v4}/locales/th.d.ts +0 -0
  627. /package/dist/{esm/v4/locales/th.js → v4/locales/th.mjs} +0 -0
  628. /package/dist/{commonjs/v4 → v4}/locales/tr.d.ts +0 -0
  629. /package/dist/{esm/v4/locales/tr.js → v4/locales/tr.mjs} +0 -0
  630. /package/dist/{commonjs/v4 → v4}/locales/ua.d.ts +0 -0
  631. /package/dist/{esm/v4/locales/ua.js → v4/locales/ua.mjs} +0 -0
  632. /package/dist/{commonjs/v4 → v4}/locales/ur.d.ts +0 -0
  633. /package/dist/{esm/v4/locales/ur.js → v4/locales/ur.mjs} +0 -0
  634. /package/dist/{commonjs/v4 → v4}/locales/vi.d.ts +0 -0
  635. /package/dist/{esm/v4/locales/vi.js → v4/locales/vi.mjs} +0 -0
  636. /package/dist/{commonjs/v4 → v4}/locales/zh-CN.d.ts +0 -0
  637. /package/dist/{esm/v4/locales/zh-CN.js → v4/locales/zh-CN.mjs} +0 -0
  638. /package/dist/{commonjs/v4 → v4}/locales/zh-tw.d.ts +0 -0
  639. /package/dist/{esm/v4/locales/zh-tw.js → v4/locales/zh-tw.mjs} +0 -0
  640. /package/dist/{commonjs/v4 → v4}/mini/checks.d.ts +0 -0
  641. /package/dist/{commonjs/v4 → v4}/mini/checks.js +0 -0
  642. /package/dist/{esm/v4/mini/checks.d.ts → v4/mini/checks.mjs} +0 -0
  643. /package/dist/{commonjs/v4 → v4}/mini/coerce.d.ts +0 -0
  644. /package/dist/{esm/v4/mini/coerce.js → v4/mini/coerce.mjs} +0 -0
  645. /package/dist/{commonjs/v4 → v4}/mini/external.d.ts +0 -0
  646. /package/dist/{esm/v4/mini/external.js → v4/mini/external.mjs} +0 -0
  647. /package/dist/{commonjs/v4 → v4}/mini/index.d.ts +0 -0
  648. /package/dist/{esm/v4/mini/index.d.ts → v4/mini/index.mjs} +0 -0
  649. /package/dist/{commonjs/v4 → v4}/mini/iso.d.ts +0 -0
  650. /package/dist/{esm/v4/mini/iso.js → v4/mini/iso.mjs} +0 -0
  651. /package/dist/{commonjs/v4 → v4}/mini/parse.d.ts +0 -0
  652. /package/dist/{commonjs/v4 → v4}/mini/parse.js +0 -0
  653. /package/dist/{esm/v4/mini/parse.d.ts → v4/mini/parse.mjs} +0 -0
  654. /package/dist/{commonjs/v4 → v4}/mini/schemas.d.ts +0 -0
  655. /package/dist/{esm/v4/mini/schemas.js → v4/mini/schemas.mjs} +0 -0
@@ -0,0 +1,705 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ const vitest_1 = require("vitest");
27
+ const z = __importStar(require("zod/v4"));
28
+ const empty = z.templateLiteral([]);
29
+ const hello = z.templateLiteral(["hello"]);
30
+ const world = z.templateLiteral(["", z.literal("world")]);
31
+ const one = z.templateLiteral([1]);
32
+ const two = z.templateLiteral(["", z.literal(2)]);
33
+ const truee = z.templateLiteral([true]);
34
+ const anotherTrue = z.templateLiteral(["", z.literal(true)]);
35
+ const falsee = z.templateLiteral([false]);
36
+ const anotherFalse = z.templateLiteral(["", z.literal(false)]);
37
+ const nulll = z.templateLiteral([null]);
38
+ const anotherNull = z.templateLiteral(["", z.null()]);
39
+ const undefinedd = z.templateLiteral([undefined]);
40
+ const anotherUndefined = z.templateLiteral(["", z.undefined()]);
41
+ const anyString = z.templateLiteral(["", z.string()]);
42
+ const lazyString = z.templateLiteral(["", z.lazy(() => z.string())]);
43
+ const anyNumber = z.templateLiteral(["", z.number()]);
44
+ const anyInt = z.templateLiteral(["", z.number().int()]);
45
+ // const anyFiniteNumber = z.templateLiteral(["", z.number().finite()]);
46
+ // const anyNegativeNumber = z.templateLiteral(["", z.number().negative()]);
47
+ // const anyPositiveNumber = z.templateLiteral(["", z.number().positive()]);
48
+ // const zeroButInADumbWay = z.templateLiteral(["", z.number().nonnegative().nonpositive()]);
49
+ // const finiteButInADumbWay = z.templateLiteral(["", z.number().min(5).max(10)]);
50
+ const bool = z.templateLiteral(["", z.boolean()]);
51
+ const bigone = z.templateLiteral(["", z.literal(BigInt(1))]);
52
+ const anyBigint = z.templateLiteral(["", z.bigint()]);
53
+ const nullableYo = z.templateLiteral(["", z.nullable(z.literal("yo"))]);
54
+ const nullableString = z.templateLiteral(["", z.nullable(z.string())]);
55
+ const optionalYeah = z.templateLiteral(["", z.literal("yeah").optional()]);
56
+ const optionalString = z.templateLiteral(["", z.string().optional()]);
57
+ const optionalNumber = z.templateLiteral(["", z.number().optional()]);
58
+ const nullishBruh = z.templateLiteral(["", z.literal("bruh").nullish()]);
59
+ const nullishString = z.templateLiteral(["", z.string().nullish()]);
60
+ const cuid = z.templateLiteral(["", z.string().cuid()]);
61
+ const cuidZZZ = z.templateLiteral(["", z.string().cuid(), "ZZZ"]);
62
+ const cuid2 = z.templateLiteral(["", z.string().cuid2()]);
63
+ const datetime = z.templateLiteral(["", z.string().datetime()]);
64
+ const email = z.templateLiteral(["", z.string().email()]);
65
+ // const ip = z.templateLiteral(["", z.string().ip()]);
66
+ const ipv4 = z.templateLiteral(["", z.string().ipv4()]);
67
+ const ipv6 = z.templateLiteral(["", z.string().ipv6()]);
68
+ const ulid = z.templateLiteral(["", z.string().ulid()]);
69
+ const uuid = z.templateLiteral(["", z.string().uuid()]);
70
+ const stringAToZ = z.templateLiteral(["", z.string().regex(/^[a-z]+$/)]);
71
+ const stringStartsWith = z.templateLiteral(["", z.string().startsWith("hello")]);
72
+ const stringEndsWith = z.templateLiteral(["", z.string().endsWith("world")]);
73
+ const stringMax5 = z.templateLiteral(["", z.string().max(5)]);
74
+ const stringMin5 = z.templateLiteral(["", z.string().min(5)]);
75
+ const stringLen5 = z.templateLiteral(["", z.string().length(5)]);
76
+ const stringMin5Max10 = z.templateLiteral(["", z.string().min(5).max(10)]);
77
+ const stringStartsWithMax5 = z.templateLiteral(["", z.string().startsWith("hello").max(5)]);
78
+ const brandedString = z.templateLiteral(["", z.string().min(1).brand("myBrand")]);
79
+ // const anything = z.templateLiteral(["", z.any()]);
80
+ const url = z.templateLiteral(["https://", z.string().regex(/\w+/), ".", z.enum(["com", "net"])]);
81
+ const measurement = z.templateLiteral([
82
+ "",
83
+ z.number().finite(),
84
+ z.enum(["px", "em", "rem", "vh", "vw", "vmin", "vmax"]).optional(),
85
+ ]);
86
+ const connectionString = z.templateLiteral([
87
+ "mongodb://",
88
+ z
89
+ .templateLiteral([
90
+ "",
91
+ z.string().regex(/\w+/).describe("username"),
92
+ ":",
93
+ z.string().regex(/\w+/).describe("password"),
94
+ "@",
95
+ ])
96
+ .optional(),
97
+ z.string().regex(/\w+/).describe("host"),
98
+ ":",
99
+ z.number().finite().int().positive().describe("port"),
100
+ z
101
+ .templateLiteral([
102
+ "/",
103
+ z.string().regex(/\w+/).optional().describe("defaultauthdb"),
104
+ z
105
+ .templateLiteral([
106
+ "?",
107
+ z
108
+ .string()
109
+ .regex(/^\w+=\w+(&\w+=\w+)*$/)
110
+ .optional()
111
+ .describe("options"),
112
+ ])
113
+ .optional(),
114
+ ])
115
+ .optional(),
116
+ ]);
117
+ (0, vitest_1.test)("template literal type inference", () => {
118
+ (0, vitest_1.expectTypeOf)().toEqualTypeOf();
119
+ (0, vitest_1.expectTypeOf)().toEqualTypeOf();
120
+ (0, vitest_1.expectTypeOf)().toEqualTypeOf();
121
+ (0, vitest_1.expectTypeOf)().toEqualTypeOf();
122
+ (0, vitest_1.expectTypeOf)().toEqualTypeOf();
123
+ (0, vitest_1.expectTypeOf)().toEqualTypeOf();
124
+ (0, vitest_1.expectTypeOf)().toEqualTypeOf();
125
+ (0, vitest_1.expectTypeOf)().toEqualTypeOf();
126
+ (0, vitest_1.expectTypeOf)().toEqualTypeOf();
127
+ (0, vitest_1.expectTypeOf)().toEqualTypeOf();
128
+ (0, vitest_1.expectTypeOf)().toEqualTypeOf();
129
+ (0, vitest_1.expectTypeOf)().toEqualTypeOf();
130
+ (0, vitest_1.expectTypeOf)().toEqualTypeOf();
131
+ (0, vitest_1.expectTypeOf)().toEqualTypeOf();
132
+ (0, vitest_1.expectTypeOf)().toEqualTypeOf();
133
+ (0, vitest_1.expectTypeOf)().toEqualTypeOf();
134
+ (0, vitest_1.expectTypeOf)().toEqualTypeOf();
135
+ // expectTypeOf<z.infer<typeof anyFiniteNumber>>().toEqualTypeOf<`${number}`>();
136
+ // expectTypeOf<z.infer<typeof anyNegativeNumber>>().toEqualTypeOf<`${number}`>();
137
+ // expectTypeOf<z.infer<typeof anyPositiveNumber>>().toEqualTypeOf<`${number}`>();
138
+ // expectTypeOf<z.infer<typeof zeroButInADumbWay>>().toEqualTypeOf<`${number}`>();
139
+ // expectTypeOf<z.infer<typeof finiteButInADumbWay>>().toEqualTypeOf<`${number}`>();
140
+ (0, vitest_1.expectTypeOf)().toEqualTypeOf();
141
+ (0, vitest_1.expectTypeOf)().toEqualTypeOf();
142
+ (0, vitest_1.expectTypeOf)().toEqualTypeOf();
143
+ (0, vitest_1.expectTypeOf)().toEqualTypeOf();
144
+ (0, vitest_1.expectTypeOf)().toEqualTypeOf();
145
+ (0, vitest_1.expectTypeOf)().toEqualTypeOf();
146
+ (0, vitest_1.expectTypeOf)().toEqualTypeOf();
147
+ (0, vitest_1.expectTypeOf)().toEqualTypeOf();
148
+ (0, vitest_1.expectTypeOf)().toEqualTypeOf();
149
+ (0, vitest_1.expectTypeOf)().toEqualTypeOf();
150
+ (0, vitest_1.expectTypeOf)().toEqualTypeOf();
151
+ (0, vitest_1.expectTypeOf)().toEqualTypeOf();
152
+ (0, vitest_1.expectTypeOf)().toEqualTypeOf();
153
+ (0, vitest_1.expectTypeOf)().toEqualTypeOf();
154
+ (0, vitest_1.expectTypeOf)().toEqualTypeOf();
155
+ // expectTypeOf<z.infer<typeof ip>>().toEqualTypeOf<string>();
156
+ (0, vitest_1.expectTypeOf)().toEqualTypeOf();
157
+ (0, vitest_1.expectTypeOf)().toEqualTypeOf();
158
+ (0, vitest_1.expectTypeOf)().toEqualTypeOf();
159
+ (0, vitest_1.expectTypeOf)().toEqualTypeOf();
160
+ (0, vitest_1.expectTypeOf)().toEqualTypeOf();
161
+ (0, vitest_1.expectTypeOf)().toEqualTypeOf();
162
+ (0, vitest_1.expectTypeOf)().toEqualTypeOf();
163
+ (0, vitest_1.expectTypeOf)().toEqualTypeOf();
164
+ (0, vitest_1.expectTypeOf)().toEqualTypeOf();
165
+ (0, vitest_1.expectTypeOf)().toEqualTypeOf();
166
+ (0, vitest_1.expectTypeOf)().toEqualTypeOf();
167
+ (0, vitest_1.expectTypeOf)().toEqualTypeOf();
168
+ (0, vitest_1.expectTypeOf)().toEqualTypeOf();
169
+ // expectTypeOf<z.infer<typeof anything>>().toEqualTypeOf<`${any}`>();
170
+ (0, vitest_1.expectTypeOf)().toEqualTypeOf();
171
+ (0, vitest_1.expectTypeOf)().toEqualTypeOf();
172
+ (0, vitest_1.expectTypeOf)().toEqualTypeOf();
173
+ });
174
+ (0, vitest_1.test)("template literal unsupported args", () => {
175
+ (0, vitest_1.expect)(() =>
176
+ // @ts-expect-error
177
+ z.templateLiteral([z.object({})])).toThrow();
178
+ (0, vitest_1.expect)(() =>
179
+ // @ts-expect-error
180
+ z.templateLiteral([z.array(z.object({}))])).toThrow();
181
+ (0, vitest_1.expect)(() =>
182
+ // @ts-expect-error
183
+ z.templateLiteral([z.union([z.object({}), z.string()])])).toThrow();
184
+ // @ts-expect-error
185
+ (0, vitest_1.expect)(() => z.templateLiteral([z.date()])).toThrow();
186
+ (0, vitest_1.expect)(() =>
187
+ // @ts-expect-error
188
+ z.templateLiteral([z.custom((_) => true)])).toThrow();
189
+ (0, vitest_1.expect)(() => z.templateLiteral([
190
+ // @ts-expect-error
191
+ z.discriminatedUnion("discriminator", [z.object({}), z.object({})]),
192
+ ])).toThrow();
193
+ (0, vitest_1.expect)(() =>
194
+ // @ts-expect-error
195
+ z.templateLiteral([z.function()])).toThrow();
196
+ (0, vitest_1.expect)(() =>
197
+ // @ts-expect-error
198
+ z.templateLiteral([z.instanceof(class MyClass {
199
+ })])).toThrow();
200
+ (0, vitest_1.expect)(() =>
201
+ // @ts-expect-error
202
+ z.templateLiteral([z.intersection(z.object({}), z.object({}))])).toThrow();
203
+ (0, vitest_1.expect)(() =>
204
+ // @ts-expect-error
205
+ z.templateLiteral([z.map(z.string(), z.string())])).toThrow();
206
+ (0, vitest_1.expect)(() =>
207
+ // @ts-expect-error
208
+ z.templateLiteral([z.nullable(z.object({}))])).toThrow();
209
+ (0, vitest_1.expect)(() =>
210
+ // @ts-expect-error
211
+ z.templateLiteral([z.optional(z.object({}))])).toThrow();
212
+ (0, vitest_1.expect)(() =>
213
+ // @ts-expect-error
214
+ z.templateLiteral([z.promise()])).toThrow();
215
+ (0, vitest_1.expect)(() =>
216
+ // @ts-expect-error
217
+ z.templateLiteral([z.record(z.unknown())])).toThrow();
218
+ (0, vitest_1.expect)(() =>
219
+ // @ts-expect-error
220
+ z.templateLiteral([z.set(z.string())])).toThrow();
221
+ (0, vitest_1.expect)(() =>
222
+ // @ts-expect-error
223
+ z.templateLiteral([z.symbol()])).toThrow();
224
+ (0, vitest_1.expect)(() =>
225
+ // @ts-expect-error
226
+ z.templateLiteral([z.tuple([z.string()])])).toThrow();
227
+ (0, vitest_1.expect)(() =>
228
+ // @ts-expect-error
229
+ z.templateLiteral([z.unknown()])).toThrow();
230
+ (0, vitest_1.expect)(() =>
231
+ // @ts-expect-error
232
+ z.templateLiteral([z.void()])).toThrow();
233
+ (0, vitest_1.expect)(() =>
234
+ // @ts-expect-error
235
+ z.templateLiteral([z.never()])).toThrow();
236
+ // @ts-expect-error
237
+ (0, vitest_1.expect)(() => z.templateLiteral([z.nan()])).toThrow();
238
+ (0, vitest_1.expect)(() =>
239
+ // @ts-expect-error
240
+ z.templateLiteral([z.pipe(z.string(), z.string())])).toThrow();
241
+ (0, vitest_1.expect)(() =>
242
+ // @ts-expect-error
243
+ z.templateLiteral([z.preprocess(() => true, z.boolean())])).toThrow();
244
+ (0, vitest_1.expect)(() =>
245
+ // @ts-expect-error
246
+ z.templateLiteral([z.object({}).brand("brand")])).toThrow();
247
+ // these constraints aren't enforced but they shouldn't throw
248
+ z.templateLiteral([z.number().multipleOf(2)]);
249
+ z.templateLiteral([z.string().emoji()]);
250
+ z.templateLiteral([z.string().url()]);
251
+ z.templateLiteral([z.string().url()]);
252
+ z.templateLiteral([z.string().trim()]);
253
+ z.templateLiteral([z.string().includes("train")]);
254
+ z.templateLiteral([z.string().toLowerCase()]);
255
+ z.templateLiteral([z.string().toUpperCase()]);
256
+ });
257
+ (0, vitest_1.test)("template literal parsing - success - basic cases", () => {
258
+ (0, vitest_1.expect)(() => z.templateLiteral([]).parse(7)).toThrow();
259
+ empty.parse("");
260
+ hello.parse("hello");
261
+ world.parse("world");
262
+ one.parse("1");
263
+ two.parse("2");
264
+ truee.parse("true");
265
+ anotherTrue.parse("true");
266
+ falsee.parse("false");
267
+ anotherFalse.parse("false");
268
+ nulll.parse("null");
269
+ anotherNull.parse("null");
270
+ undefinedd.parse("undefined");
271
+ anotherUndefined.parse("undefined");
272
+ anyString.parse("blahblahblah");
273
+ anyString.parse("");
274
+ lazyString.parse("blahblahblah");
275
+ lazyString.parse("");
276
+ anyNumber.parse("123");
277
+ anyNumber.parse("1.23");
278
+ anyNumber.parse("0");
279
+ anyNumber.parse("-1.23");
280
+ anyNumber.parse("-123");
281
+ // anyNumber.parse("Infinity");
282
+ // anyNumber.parse("-Infinity");
283
+ anyInt.parse("123");
284
+ // anyInt.parse("-123");
285
+ // anyFiniteNumber.parse("123");
286
+ // anyFiniteNumber.parse("1.23");
287
+ // anyFiniteNumber.parse("0");
288
+ // anyFiniteNumber.parse("-1.23");
289
+ // anyFiniteNumber.parse("-123");
290
+ // anyNegativeNumber.parse("-123");
291
+ // anyNegativeNumber.parse("-1.23");
292
+ // anyNegativeNumber.parse("-Infinity");
293
+ // anyPositiveNumber.parse("123");
294
+ // anyPositiveNumber.parse("1.23");
295
+ // anyPositiveNumber.parse("Infinity");
296
+ // zeroButInADumbWay.parse("0");
297
+ // zeroButInADumbWay.parse("00000");
298
+ // finiteButInADumbWay.parse("5");
299
+ // finiteButInADumbWay.parse("10");
300
+ // finiteButInADumbWay.parse("6.66");
301
+ bool.parse("true");
302
+ bool.parse("false");
303
+ bigone.parse("1");
304
+ anyBigint.parse("123456");
305
+ anyBigint.parse("0");
306
+ // anyBigint.parse("-123456");
307
+ nullableYo.parse("yo");
308
+ nullableYo.parse("null");
309
+ nullableString.parse("abc");
310
+ nullableString.parse("null");
311
+ optionalYeah.parse("yeah");
312
+ optionalYeah.parse("");
313
+ optionalString.parse("abc");
314
+ optionalString.parse("");
315
+ optionalNumber.parse("123");
316
+ optionalNumber.parse("1.23");
317
+ optionalNumber.parse("0");
318
+ optionalNumber.parse("-1.23");
319
+ optionalNumber.parse("-123");
320
+ // optionalNumber.parse("Infinity");
321
+ // optionalNumber.parse("-Infinity");
322
+ nullishBruh.parse("bruh");
323
+ nullishBruh.parse("null");
324
+ nullishBruh.parse("");
325
+ cuid.parse("cjld2cyuq0000t3rmniod1foy");
326
+ cuidZZZ.parse("cjld2cyuq0000t3rmniod1foyZZZ");
327
+ cuid2.parse("tz4a98xxat96iws9zmbrgj3a");
328
+ datetime.parse(new Date().toISOString());
329
+ email.parse("info@example.com");
330
+ // ip.parse("213.174.246.205");
331
+ // ip.parse("c359:f57c:21e5:39eb:1187:e501:f936:b452");
332
+ ipv4.parse("213.174.246.205");
333
+ ipv6.parse("c359:f57c:21e5:39eb:1187:e501:f936:b452");
334
+ ulid.parse("01GW3D2QZJBYB6P1Z1AE997VPW");
335
+ uuid.parse("808989fd-3a6e-4af2-b607-737323a176f6");
336
+ stringAToZ.parse("asudgaskhdgashd");
337
+ stringStartsWith.parse("hello world");
338
+ stringEndsWith.parse("hello world");
339
+ stringMax5.parse("hello");
340
+ stringMin5.parse("hello");
341
+ stringLen5.parse("hello");
342
+ stringMin5Max10.parse("hello worl");
343
+ stringStartsWithMax5.parse("hello");
344
+ brandedString.parse("branded string");
345
+ });
346
+ (0, vitest_1.test)("template literal parsing - failure - basic cases", () => {
347
+ (0, vitest_1.expect)(() => empty.parse("a")).toThrow();
348
+ (0, vitest_1.expect)(() => hello.parse("hello!")).toThrow();
349
+ (0, vitest_1.expect)(() => hello.parse("!hello")).toThrow();
350
+ (0, vitest_1.expect)(() => world.parse("world!")).toThrow();
351
+ (0, vitest_1.expect)(() => world.parse("!world")).toThrow();
352
+ (0, vitest_1.expect)(() => one.parse("2")).toThrow();
353
+ (0, vitest_1.expect)(() => one.parse("12")).toThrow();
354
+ (0, vitest_1.expect)(() => one.parse("21")).toThrow();
355
+ (0, vitest_1.expect)(() => two.parse("1")).toThrow();
356
+ (0, vitest_1.expect)(() => two.parse("21")).toThrow();
357
+ (0, vitest_1.expect)(() => two.parse("12")).toThrow();
358
+ (0, vitest_1.expect)(() => truee.parse("false")).toThrow();
359
+ (0, vitest_1.expect)(() => truee.parse("1true")).toThrow();
360
+ (0, vitest_1.expect)(() => truee.parse("true1")).toThrow();
361
+ (0, vitest_1.expect)(() => anotherTrue.parse("false")).toThrow();
362
+ (0, vitest_1.expect)(() => anotherTrue.parse("1true")).toThrow();
363
+ (0, vitest_1.expect)(() => anotherTrue.parse("true1")).toThrow();
364
+ (0, vitest_1.expect)(() => falsee.parse("true")).toThrow();
365
+ (0, vitest_1.expect)(() => falsee.parse("1false")).toThrow();
366
+ (0, vitest_1.expect)(() => falsee.parse("false1")).toThrow();
367
+ (0, vitest_1.expect)(() => anotherFalse.parse("true")).toThrow();
368
+ (0, vitest_1.expect)(() => anotherFalse.parse("1false")).toThrow();
369
+ (0, vitest_1.expect)(() => anotherFalse.parse("false1")).toThrow();
370
+ (0, vitest_1.expect)(() => nulll.parse("123")).toThrow();
371
+ (0, vitest_1.expect)(() => nulll.parse("null1")).toThrow();
372
+ (0, vitest_1.expect)(() => nulll.parse("1null")).toThrow();
373
+ (0, vitest_1.expect)(() => anotherNull.parse("123")).toThrow();
374
+ (0, vitest_1.expect)(() => anotherNull.parse("null1")).toThrow();
375
+ (0, vitest_1.expect)(() => anotherNull.parse("1null")).toThrow();
376
+ (0, vitest_1.expect)(() => undefinedd.parse("123")).toThrow();
377
+ (0, vitest_1.expect)(() => undefinedd.parse("undefined1")).toThrow();
378
+ (0, vitest_1.expect)(() => undefinedd.parse("1undefined")).toThrow();
379
+ (0, vitest_1.expect)(() => anotherUndefined.parse("123")).toThrow();
380
+ (0, vitest_1.expect)(() => anotherUndefined.parse("undefined1")).toThrow();
381
+ (0, vitest_1.expect)(() => anotherUndefined.parse("1undefined")).toThrow();
382
+ (0, vitest_1.expect)(() => anyNumber.parse("2a")).toThrow();
383
+ (0, vitest_1.expect)(() => anyNumber.parse("a2")).toThrow();
384
+ (0, vitest_1.expect)(() => anyNumber.parse("-2a")).toThrow();
385
+ (0, vitest_1.expect)(() => anyNumber.parse("a-2")).toThrow();
386
+ (0, vitest_1.expect)(() => anyNumber.parse("2.5a")).toThrow();
387
+ (0, vitest_1.expect)(() => anyNumber.parse("a2.5")).toThrow();
388
+ (0, vitest_1.expect)(() => anyNumber.parse("Infinitya")).toThrow();
389
+ (0, vitest_1.expect)(() => anyNumber.parse("aInfinity")).toThrow();
390
+ (0, vitest_1.expect)(() => anyNumber.parse("-Infinitya")).toThrow();
391
+ (0, vitest_1.expect)(() => anyNumber.parse("a-Infinity")).toThrow();
392
+ (0, vitest_1.expect)(() => anyNumber.parse("2e5")).toThrow();
393
+ (0, vitest_1.expect)(() => anyNumber.parse("2e-5")).toThrow();
394
+ (0, vitest_1.expect)(() => anyNumber.parse("2e+5")).toThrow();
395
+ (0, vitest_1.expect)(() => anyNumber.parse("-2e5")).toThrow();
396
+ (0, vitest_1.expect)(() => anyNumber.parse("-2e-5")).toThrow();
397
+ (0, vitest_1.expect)(() => anyNumber.parse("-2e+5")).toThrow();
398
+ (0, vitest_1.expect)(() => anyNumber.parse("2.1e5")).toThrow();
399
+ (0, vitest_1.expect)(() => anyNumber.parse("2.1e-5")).toThrow();
400
+ (0, vitest_1.expect)(() => anyNumber.parse("2.1e+5")).toThrow();
401
+ (0, vitest_1.expect)(() => anyNumber.parse("-2.1e5")).toThrow();
402
+ (0, vitest_1.expect)(() => anyNumber.parse("-2.1e-5")).toThrow();
403
+ (0, vitest_1.expect)(() => anyNumber.parse("-2.1e+5")).toThrow();
404
+ (0, vitest_1.expect)(() => anyNumber.parse("-Infinity")).toThrow();
405
+ (0, vitest_1.expect)(() => anyNumber.parse("Infinity")).toThrow();
406
+ (0, vitest_1.expect)(() => anyInt.parse("1.23")).toThrow();
407
+ (0, vitest_1.expect)(() => anyInt.parse("-1.23")).toThrow();
408
+ (0, vitest_1.expect)(() => anyInt.parse("d1")).toThrow();
409
+ (0, vitest_1.expect)(() => anyInt.parse("1d")).toThrow();
410
+ // expect(() => anyFiniteNumber.parse("Infinity")).toThrow();
411
+ // expect(() => anyFiniteNumber.parse("-Infinity")).toThrow();
412
+ // expect(() => anyFiniteNumber.parse("123a")).toThrow();
413
+ // expect(() => anyFiniteNumber.parse("a123")).toThrow();
414
+ // expect(() => anyNegativeNumber.parse("0")).toThrow();
415
+ // expect(() => anyNegativeNumber.parse("1")).toThrow();
416
+ // expect(() => anyNegativeNumber.parse("Infinity")).toThrow();
417
+ // expect(() => anyPositiveNumber.parse("0")).toThrow();
418
+ // expect(() => anyPositiveNumber.parse("-1")).toThrow();
419
+ // expect(() => anyPositiveNumber.parse("-Infinity")).toThrow();
420
+ // expect(() => zeroButInADumbWay.parse("1")).toThrow();
421
+ // expect(() => zeroButInADumbWay.parse("-1")).toThrow();
422
+ // expect(() => finiteButInADumbWay.parse("Infinity")).toThrow();
423
+ // expect(() => finiteButInADumbWay.parse("-Infinity")).toThrow();
424
+ // expect(() => finiteButInADumbWay.parse("-5")).toThrow();
425
+ // expect(() => finiteButInADumbWay.parse("10a")).toThrow();
426
+ // expect(() => finiteButInADumbWay.parse("a10")).toThrow();
427
+ (0, vitest_1.expect)(() => bool.parse("123")).toThrow();
428
+ (0, vitest_1.expect)(() => bigone.parse("2")).toThrow();
429
+ (0, vitest_1.expect)(() => bigone.parse("c1")).toThrow();
430
+ (0, vitest_1.expect)(() => anyBigint.parse("1.23")).toThrow();
431
+ (0, vitest_1.expect)(() => anyBigint.parse("-1.23")).toThrow();
432
+ (0, vitest_1.expect)(() => anyBigint.parse("c123")).toThrow();
433
+ (0, vitest_1.expect)(() => nullableYo.parse("yo1")).toThrow();
434
+ (0, vitest_1.expect)(() => nullableYo.parse("1yo")).toThrow();
435
+ (0, vitest_1.expect)(() => nullableYo.parse("null1")).toThrow();
436
+ (0, vitest_1.expect)(() => nullableYo.parse("1null")).toThrow();
437
+ (0, vitest_1.expect)(() => optionalYeah.parse("yeah1")).toThrow();
438
+ (0, vitest_1.expect)(() => optionalYeah.parse("1yeah")).toThrow();
439
+ (0, vitest_1.expect)(() => optionalYeah.parse("undefined")).toThrow();
440
+ (0, vitest_1.expect)(() => optionalNumber.parse("123a")).toThrow();
441
+ (0, vitest_1.expect)(() => optionalNumber.parse("a123")).toThrow();
442
+ // expect(() => optionalNumber.parse("Infinitya")).toThrow();
443
+ // expect(() => optionalNumber.parse("aInfinity")).toThrow();
444
+ (0, vitest_1.expect)(() => nullishBruh.parse("bruh1")).toThrow();
445
+ (0, vitest_1.expect)(() => nullishBruh.parse("1bruh")).toThrow();
446
+ (0, vitest_1.expect)(() => nullishBruh.parse("null1")).toThrow();
447
+ (0, vitest_1.expect)(() => nullishBruh.parse("1null")).toThrow();
448
+ (0, vitest_1.expect)(() => nullishBruh.parse("undefined")).toThrow();
449
+ (0, vitest_1.expect)(() => cuid.parse("bjld2cyuq0000t3rmniod1foy")).toThrow();
450
+ (0, vitest_1.expect)(() => cuid.parse("cjld2cyu")).toThrow();
451
+ (0, vitest_1.expect)(() => cuid.parse("cjld2 cyu")).toThrow();
452
+ (0, vitest_1.expect)(() => cuid.parse("cjld2cyuq0000t3rmniod1foy ")).toThrow();
453
+ (0, vitest_1.expect)(() => cuid.parse("1cjld2cyuq0000t3rmniod1foy")).toThrow();
454
+ (0, vitest_1.expect)(() => cuidZZZ.parse("cjld2cyuq0000t3rmniod1foy")).toThrow();
455
+ (0, vitest_1.expect)(() => cuidZZZ.parse("cjld2cyuq0000t3rmniod1foyZZY")).toThrow();
456
+ (0, vitest_1.expect)(() => cuidZZZ.parse("cjld2cyuq0000t3rmniod1foyZZZ1")).toThrow();
457
+ (0, vitest_1.expect)(() => cuidZZZ.parse("1cjld2cyuq0000t3rmniod1foyZZZ")).toThrow();
458
+ (0, vitest_1.expect)(() => cuid2.parse("A9z4a98xxat96iws9zmbrgj3a")).toThrow();
459
+ (0, vitest_1.expect)(() => cuid2.parse("tz4a98xxat96iws9zmbrgj3!")).toThrow();
460
+ (0, vitest_1.expect)(() => datetime.parse("2022-01-01 00:00:00")).toThrow();
461
+ (0, vitest_1.expect)(() => email.parse("info@example.com@")).toThrow();
462
+ // expect(() => ip.parse("213.174.246:205")).toThrow();
463
+ // expect(() => ip.parse("c359.f57c:21e5:39eb:1187:e501:f936:b452")).toThrow();
464
+ (0, vitest_1.expect)(() => ipv4.parse("1213.174.246.205")).toThrow();
465
+ (0, vitest_1.expect)(() => ipv4.parse("c359:f57c:21e5:39eb:1187:e501:f936:b452")).toThrow();
466
+ (0, vitest_1.expect)(() => ipv6.parse("c359:f57c:21e5:39eb:1187:e501:f936:b4521")).toThrow();
467
+ (0, vitest_1.expect)(() => ipv6.parse("213.174.246.205")).toThrow();
468
+ (0, vitest_1.expect)(() => ulid.parse("01GW3D2QZJBYB6P1Z1AE997VPW!")).toThrow();
469
+ (0, vitest_1.expect)(() => uuid.parse("808989fd-3a6e-4af2-b607-737323a176f6Z")).toThrow();
470
+ (0, vitest_1.expect)(() => uuid.parse("Z808989fd-3a6e-4af2-b607-737323a176f6")).toThrow();
471
+ (0, vitest_1.expect)(() => stringAToZ.parse("asdasdasd1")).toThrow();
472
+ (0, vitest_1.expect)(() => stringAToZ.parse("1asdasdasd")).toThrow();
473
+ (0, vitest_1.expect)(() => stringStartsWith.parse("ahello")).toThrow();
474
+ (0, vitest_1.expect)(() => stringEndsWith.parse("worlda")).toThrow();
475
+ (0, vitest_1.expect)(() => stringMax5.parse("123456")).toThrow();
476
+ (0, vitest_1.expect)(() => stringMin5.parse("1234")).toThrow();
477
+ (0, vitest_1.expect)(() => stringLen5.parse("123456")).toThrow();
478
+ (0, vitest_1.expect)(() => stringLen5.parse("1234")).toThrow();
479
+ (0, vitest_1.expect)(() => stringMin5Max10.parse("1234")).toThrow();
480
+ (0, vitest_1.expect)(() => stringMin5Max10.parse("12345678901")).toThrow();
481
+ // the "startswith" overrides the max length
482
+ // expect(() => stringStartsWithMax5.parse("hello1")).toThrow();
483
+ (0, vitest_1.expect)(() => stringStartsWithMax5.parse("1hell")).toThrow();
484
+ (0, vitest_1.expect)(() => brandedString.parse("")).toThrow();
485
+ });
486
+ (0, vitest_1.test)("regexes", () => {
487
+ (0, vitest_1.expect)(empty._zod.pattern.source).toMatchInlineSnapshot(`"^$"`);
488
+ (0, vitest_1.expect)(hello._zod.pattern.source).toMatchInlineSnapshot(`"^hello$"`);
489
+ (0, vitest_1.expect)(world._zod.pattern.source).toMatchInlineSnapshot(`"^(world)$"`);
490
+ (0, vitest_1.expect)(one._zod.pattern.source).toMatchInlineSnapshot(`"^1$"`);
491
+ (0, vitest_1.expect)(two._zod.pattern.source).toMatchInlineSnapshot(`"^(2)$"`);
492
+ (0, vitest_1.expect)(truee._zod.pattern.source).toMatchInlineSnapshot(`"^true$"`);
493
+ (0, vitest_1.expect)(anotherTrue._zod.pattern.source).toMatchInlineSnapshot(`"^(true)$"`);
494
+ (0, vitest_1.expect)(falsee._zod.pattern.source).toMatchInlineSnapshot(`"^false$"`);
495
+ (0, vitest_1.expect)(anotherFalse._zod.pattern.source).toMatchInlineSnapshot(`"^(false)$"`);
496
+ (0, vitest_1.expect)(nulll._zod.pattern.source).toMatchInlineSnapshot(`"^null$"`);
497
+ (0, vitest_1.expect)(anotherNull._zod.pattern.source).toMatchInlineSnapshot(`"^null$"`);
498
+ (0, vitest_1.expect)(undefinedd._zod.pattern.source).toMatchInlineSnapshot(`"^undefined$"`);
499
+ (0, vitest_1.expect)(anotherUndefined._zod.pattern.source).toMatchInlineSnapshot(`"^undefined$"`);
500
+ (0, vitest_1.expect)(anyString._zod.pattern.source).toMatchInlineSnapshot(`"^[\\s\\S]{0,}$"`);
501
+ (0, vitest_1.expect)(lazyString._zod.pattern.source).toMatchInlineSnapshot(`"^[\\s\\S]{0,}$"`);
502
+ (0, vitest_1.expect)(anyNumber._zod.pattern.source).toMatchInlineSnapshot(`"^-?\\d+(?:\\.\\d+)?$"`);
503
+ (0, vitest_1.expect)(anyInt._zod.pattern.source).toMatchInlineSnapshot(`"^\\d+$"`);
504
+ // expect(anyFiniteNumber._zod.pattern.source).toMatchInlineSnapshot(`"^-?\\d+(?:\\.\\d+)?$"`);
505
+ // expect(anyNegativeNumber._zod.pattern.source).toMatchInlineSnapshot(`"^-?\\d+(?:\\.\\d+)?$"`);
506
+ // expect(anyPositiveNumber._zod.pattern.source).toMatchInlineSnapshot(`"^-?\\d+(?:\\.\\d+)?$"`);
507
+ // expect(zeroButInADumbWay._zod.pattern.source).toMatchInlineSnapshot(`"^-?\\d+(?:\\.\\d+)?$"`);
508
+ // expect(finiteButInADumbWay._zod.pattern.source).toMatchInlineSnapshot(`"^-?\\d+(?:\\.\\d+)?$"`);
509
+ (0, vitest_1.expect)(bool._zod.pattern.source).toMatchInlineSnapshot(`"^true|false$"`);
510
+ (0, vitest_1.expect)(bigone._zod.pattern.source).toMatchInlineSnapshot(`"^(1)$"`);
511
+ (0, vitest_1.expect)(anyBigint._zod.pattern.source).toMatchInlineSnapshot(`"^\\d+n?$"`);
512
+ (0, vitest_1.expect)(nullableYo._zod.pattern.source).toMatchInlineSnapshot(`"^((yo)|null)$"`);
513
+ (0, vitest_1.expect)(nullableString._zod.pattern.source).toMatchInlineSnapshot(`"^([\\s\\S]{0,}|null)$"`);
514
+ (0, vitest_1.expect)(optionalYeah._zod.pattern.source).toMatchInlineSnapshot(`"^((yeah))?$"`);
515
+ (0, vitest_1.expect)(optionalString._zod.pattern.source).toMatchInlineSnapshot(`"^([\\s\\S]{0,})?$"`);
516
+ (0, vitest_1.expect)(optionalNumber._zod.pattern.source).toMatchInlineSnapshot(`"^(-?\\d+(?:\\.\\d+)?)?$"`);
517
+ (0, vitest_1.expect)(nullishBruh._zod.pattern.source).toMatchInlineSnapshot(`"^(((bruh)|null))?$"`);
518
+ (0, vitest_1.expect)(nullishString._zod.pattern.source).toMatchInlineSnapshot(`"^(([\\s\\S]{0,}|null))?$"`);
519
+ (0, vitest_1.expect)(cuid._zod.pattern.source).toMatchInlineSnapshot(`"^[cC][^\\s-]{8,}$"`);
520
+ (0, vitest_1.expect)(cuidZZZ._zod.pattern.source).toMatchInlineSnapshot(`"^[cC][^\\s-]{8,}ZZZ$"`);
521
+ (0, vitest_1.expect)(cuid2._zod.pattern.source).toMatchInlineSnapshot(`"^[0-9a-z]+$"`);
522
+ (0, vitest_1.expect)(datetime._zod.pattern.source).toMatchInlineSnapshot(`"^((\\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])))T([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(\\.\\d+)?(Z)$"`);
523
+ (0, vitest_1.expect)(email._zod.pattern.source).toMatchInlineSnapshot(`"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"`);
524
+ // expect(ip._zod.pattern.source).toMatchInlineSnapshot(
525
+ // `"^(^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$)|(^(([a-fA-F0-9]{1,4}:){7}|::([a-fA-F0-9]{1,4}:){0,6}|([a-fA-F0-9]{1,4}:){1}:([a-fA-F0-9]{1,4}:){0,5}|([a-fA-F0-9]{1,4}:){2}:([a-fA-F0-9]{1,4}:){0,4}|([a-fA-F0-9]{1,4}:){3}:([a-fA-F0-9]{1,4}:){0,3}|([a-fA-F0-9]{1,4}:){4}:([a-fA-F0-9]{1,4}:){0,2}|([a-fA-F0-9]{1,4}:){5}:([a-fA-F0-9]{1,4}:){0,1})([a-fA-F0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$)$"`
526
+ // );
527
+ (0, vitest_1.expect)(ipv4._zod.pattern.source).toMatchInlineSnapshot(`"^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$"`);
528
+ (0, vitest_1.expect)(ipv6._zod.pattern.source).toMatchInlineSnapshot(`"^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$"`);
529
+ (0, vitest_1.expect)(ulid._zod.pattern.source).toMatchInlineSnapshot(`"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"`);
530
+ (0, vitest_1.expect)(uuid._zod.pattern.source).toMatchInlineSnapshot(`"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$"`);
531
+ (0, vitest_1.expect)(stringAToZ._zod.pattern.source).toMatchInlineSnapshot(`"^[a-z]+$"`);
532
+ (0, vitest_1.expect)(stringStartsWith._zod.pattern.source).toMatchInlineSnapshot(`"^hello.*$"`);
533
+ (0, vitest_1.expect)(stringEndsWith._zod.pattern.source).toMatchInlineSnapshot(`"^.*world$"`);
534
+ (0, vitest_1.expect)(stringMax5._zod.pattern.source).toMatchInlineSnapshot(`"^[\\s\\S]{0,5}$"`);
535
+ (0, vitest_1.expect)(stringMin5._zod.pattern.source).toMatchInlineSnapshot(`"^[\\s\\S]{5,}$"`);
536
+ (0, vitest_1.expect)(stringLen5._zod.pattern.source).toMatchInlineSnapshot(`"^[\\s\\S]{5,5}$"`);
537
+ (0, vitest_1.expect)(stringMin5Max10._zod.pattern.source).toMatchInlineSnapshot(`"^[\\s\\S]{5,10}$"`);
538
+ (0, vitest_1.expect)(brandedString._zod.pattern.source).toMatchInlineSnapshot(`"^[\\s\\S]{1,}$"`);
539
+ (0, vitest_1.expect)(url._zod.pattern.source).toMatchInlineSnapshot(`"^https:\\/\\/\\w+\\.(com|net)$"`);
540
+ (0, vitest_1.expect)(measurement._zod.pattern.source).toMatchInlineSnapshot(`"^-?\\d+(?:\\.\\d+)?((px|em|rem|vh|vw|vmin|vmax))?$"`);
541
+ (0, vitest_1.expect)(connectionString._zod.pattern.source).toMatchInlineSnapshot(`"^mongodb:\\/\\/(\\w+:\\w+@)?\\w+:\\d+(\\/(\\w+)?(\\?(\\w+=\\w+(&\\w+=\\w+)*)?)?)?$"`);
542
+ });
543
+ (0, vitest_1.test)("template literal parsing - success - complex cases", () => {
544
+ url.parse("https://example.com");
545
+ url.parse("https://speedtest.net");
546
+ // measurement.parse(1);
547
+ // measurement.parse(1.1);
548
+ // measurement.parse(0);
549
+ // measurement.parse(-1.1);
550
+ // measurement.parse(-1);
551
+ measurement.parse("1");
552
+ measurement.parse("1.1");
553
+ measurement.parse("0");
554
+ measurement.parse("-1");
555
+ measurement.parse("-1.1");
556
+ measurement.parse("1px");
557
+ measurement.parse("1.1px");
558
+ measurement.parse("0px");
559
+ measurement.parse("-1px");
560
+ measurement.parse("-1.1px");
561
+ measurement.parse("1em");
562
+ measurement.parse("1.1em");
563
+ measurement.parse("0em");
564
+ measurement.parse("-1em");
565
+ measurement.parse("-1.1em");
566
+ measurement.parse("1rem");
567
+ measurement.parse("1.1rem");
568
+ measurement.parse("0rem");
569
+ measurement.parse("-1rem");
570
+ measurement.parse("-1.1rem");
571
+ measurement.parse("1vh");
572
+ measurement.parse("1.1vh");
573
+ measurement.parse("0vh");
574
+ measurement.parse("-1vh");
575
+ measurement.parse("-1.1vh");
576
+ measurement.parse("1vw");
577
+ measurement.parse("1.1vw");
578
+ measurement.parse("0vw");
579
+ measurement.parse("-1vw");
580
+ measurement.parse("-1.1vw");
581
+ measurement.parse("1vmin");
582
+ measurement.parse("1.1vmin");
583
+ measurement.parse("0vmin");
584
+ measurement.parse("-1vmin");
585
+ measurement.parse("-1.1vmin");
586
+ measurement.parse("1vmax");
587
+ measurement.parse("1.1vmax");
588
+ measurement.parse("0vmax");
589
+ measurement.parse("-1vmax");
590
+ measurement.parse("-1.1vmax");
591
+ connectionString.parse("mongodb://host:1234");
592
+ connectionString.parse("mongodb://host:1234/");
593
+ connectionString.parse("mongodb://host:1234/defaultauthdb");
594
+ connectionString.parse("mongodb://host:1234/defaultauthdb?authSource=admin");
595
+ connectionString.parse("mongodb://host:1234/defaultauthdb?authSource=admin&connectTimeoutMS=300000");
596
+ connectionString.parse("mongodb://host:1234/?authSource=admin");
597
+ connectionString.parse("mongodb://host:1234/?authSource=admin&connectTimeoutMS=300000");
598
+ connectionString.parse("mongodb://username:password@host:1234");
599
+ connectionString.parse("mongodb://username:password@host:1234/");
600
+ connectionString.parse("mongodb://username:password@host:1234/defaultauthdb");
601
+ connectionString.parse("mongodb://username:password@host:1234/defaultauthdb?authSource=admin");
602
+ connectionString.parse("mongodb://username:password@host:1234/defaultauthdb?authSource=admin&connectTimeoutMS=300000");
603
+ connectionString.parse("mongodb://username:password@host:1234/?authSource=admin");
604
+ connectionString.parse("mongodb://username:password@host:1234/?authSource=admin&connectTimeoutMS=300000");
605
+ });
606
+ (0, vitest_1.test)("template literal parsing - failure - complex cases", () => {
607
+ (0, vitest_1.expect)(() => url.parse("http://example.com")).toThrow();
608
+ (0, vitest_1.expect)(() => url.parse("https://.com")).toThrow();
609
+ (0, vitest_1.expect)(() => url.parse("https://examplecom")).toThrow();
610
+ (0, vitest_1.expect)(() => url.parse("https://example.org")).toThrow();
611
+ (0, vitest_1.expect)(() => url.parse("https://example.net.il")).toThrow();
612
+ (0, vitest_1.expect)(() => measurement.parse("1.1.1")).toThrow();
613
+ (0, vitest_1.expect)(() => measurement.parse("Infinity")).toThrow();
614
+ (0, vitest_1.expect)(() => measurement.parse("-Infinity")).toThrow();
615
+ (0, vitest_1.expect)(() => measurement.parse("NaN")).toThrow();
616
+ (0, vitest_1.expect)(() => measurement.parse("1%")).toThrow();
617
+ (0, vitest_1.expect)(() => connectionString.parse("mongod://host:1234")).toThrow();
618
+ (0, vitest_1.expect)(() => connectionString.parse("mongodb://:1234")).toThrow();
619
+ (0, vitest_1.expect)(() => connectionString.parse("mongodb://host1234")).toThrow();
620
+ (0, vitest_1.expect)(() => connectionString.parse("mongodb://host:d234")).toThrow();
621
+ (0, vitest_1.expect)(() => connectionString.parse("mongodb://host:12.34")).toThrow();
622
+ (0, vitest_1.expect)(() => connectionString.parse("mongodb://host:-1234")).toThrow();
623
+ (0, vitest_1.expect)(() => connectionString.parse("mongodb://host:-12.34")).toThrow();
624
+ (0, vitest_1.expect)(() => connectionString.parse("mongodb://host:")).toThrow();
625
+ (0, vitest_1.expect)(() => connectionString.parse("mongodb://:password@host:1234")).toThrow();
626
+ (0, vitest_1.expect)(() => connectionString.parse("mongodb://usernamepassword@host:1234")).toThrow();
627
+ (0, vitest_1.expect)(() => connectionString.parse("mongodb://username:@host:1234")).toThrow();
628
+ (0, vitest_1.expect)(() => connectionString.parse("mongodb://@host:1234")).toThrow();
629
+ (0, vitest_1.expect)(() => connectionString.parse("mongodb://host:1234/defaultauthdb?authSourceadmin")).toThrow();
630
+ (0, vitest_1.expect)(() => connectionString.parse("mongodb://host:1234/?authSourceadmin")).toThrow();
631
+ (0, vitest_1.expect)(() => connectionString.parse("mongodb://host:1234/defaultauthdb?&authSource=admin")).toThrow();
632
+ (0, vitest_1.expect)(() => connectionString.parse("mongodb://host:1234/?&authSource=admin")).toThrow();
633
+ });
634
+ (0, vitest_1.test)("template literal parsing - failure - issue format", () => {
635
+ (0, vitest_1.expect)(anotherNull.safeParse("1null")).toMatchInlineSnapshot(`
636
+ {
637
+ "error": [ZodError: [
638
+ {
639
+ "code": "invalid_format",
640
+ "format": "template_literal",
641
+ "pattern": "^null$",
642
+ "path": [],
643
+ "message": "Invalid input"
644
+ }
645
+ ]],
646
+ "success": false,
647
+ }
648
+ `);
649
+ (0, vitest_1.expect)(cuidZZZ.safeParse("1cjld2cyuq0000t3rmniod1foyZZZ")).toMatchInlineSnapshot(`
650
+ {
651
+ "error": [ZodError: [
652
+ {
653
+ "code": "invalid_format",
654
+ "format": "template_literal",
655
+ "pattern": "^[cC][^\\\\s-]{8,}ZZZ$",
656
+ "path": [],
657
+ "message": "Invalid input"
658
+ }
659
+ ]],
660
+ "success": false,
661
+ }
662
+ `);
663
+ (0, vitest_1.expect)(stringMin5Max10.safeParse("1234")).toMatchInlineSnapshot(`
664
+ {
665
+ "error": [ZodError: [
666
+ {
667
+ "code": "invalid_format",
668
+ "format": "template_literal",
669
+ "pattern": "^[\\\\s\\\\S]{5,10}$",
670
+ "path": [],
671
+ "message": "Invalid input"
672
+ }
673
+ ]],
674
+ "success": false,
675
+ }
676
+ `);
677
+ (0, vitest_1.expect)(connectionString.safeParse("mongodb://host:1234/defaultauthdb?authSourceadmin")).toMatchInlineSnapshot(`
678
+ {
679
+ "error": [ZodError: [
680
+ {
681
+ "code": "invalid_format",
682
+ "format": "template_literal",
683
+ "pattern": "^mongodb:\\\\/\\\\/(\\\\w+:\\\\w+@)?\\\\w+:\\\\d+(\\\\/(\\\\w+)?(\\\\?(\\\\w+=\\\\w+(&\\\\w+=\\\\w+)*)?)?)?$",
684
+ "path": [],
685
+ "message": "Invalid input"
686
+ }
687
+ ]],
688
+ "success": false,
689
+ }
690
+ `);
691
+ (0, vitest_1.expect)(stringStartsWithMax5.safeParse("1hell")).toMatchInlineSnapshot(`
692
+ {
693
+ "error": [ZodError: [
694
+ {
695
+ "code": "invalid_format",
696
+ "format": "template_literal",
697
+ "pattern": "^hello.*$",
698
+ "path": [],
699
+ "message": "Invalid input"
700
+ }
701
+ ]],
702
+ "success": false,
703
+ }
704
+ `);
705
+ });