zod 3.25.21 → 3.25.22

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 (506) hide show
  1. package/package.json +2 -2
  2. package/dist/cjs/v3/tests/all-errors.test.js +0 -147
  3. package/dist/cjs/v3/tests/anyunknown.test.js +0 -47
  4. package/dist/cjs/v3/tests/array.test.js +0 -80
  5. package/dist/cjs/v3/tests/async-parsing.test.js +0 -381
  6. package/dist/cjs/v3/tests/async-refinements.test.js +0 -60
  7. package/dist/cjs/v3/tests/base.test.js +0 -47
  8. package/dist/cjs/v3/tests/bigint.test.js +0 -74
  9. package/dist/cjs/v3/tests/branded.test.js +0 -58
  10. package/dist/cjs/v3/tests/catch.test.js +0 -181
  11. package/dist/cjs/v3/tests/coerce.test.js +0 -152
  12. package/dist/cjs/v3/tests/complex.test.js +0 -78
  13. package/dist/cjs/v3/tests/custom.test.js +0 -51
  14. package/dist/cjs/v3/tests/date.test.js +0 -49
  15. package/dist/cjs/v3/tests/deepmasking.test.js +0 -187
  16. package/dist/cjs/v3/tests/default.test.js +0 -86
  17. package/dist/cjs/v3/tests/description.test.js +0 -51
  18. package/dist/cjs/v3/tests/discriminated-unions.test.js +0 -321
  19. package/dist/cjs/v3/tests/enum.test.js +0 -91
  20. package/dist/cjs/v3/tests/error.test.js +0 -526
  21. package/dist/cjs/v3/tests/firstparty.test.js +0 -109
  22. package/dist/cjs/v3/tests/firstpartyschematypes.test.js +0 -8
  23. package/dist/cjs/v3/tests/function.test.js +0 -236
  24. package/dist/cjs/v3/tests/generics.test.js +0 -67
  25. package/dist/cjs/v3/tests/instanceof.test.js +0 -60
  26. package/dist/cjs/v3/tests/intersection.test.js +0 -111
  27. package/dist/cjs/v3/tests/language-server.source.js +0 -71
  28. package/dist/cjs/v3/tests/language-server.test.js +0 -177
  29. package/dist/cjs/v3/tests/literal.test.js +0 -55
  30. package/dist/cjs/v3/tests/map.test.js +0 -112
  31. package/dist/cjs/v3/tests/masking.test.js +0 -5
  32. package/dist/cjs/v3/tests/mocker.test.js +0 -19
  33. package/dist/cjs/v3/tests/nan.test.js +0 -42
  34. package/dist/cjs/v3/tests/nativeEnum.test.js +0 -100
  35. package/dist/cjs/v3/tests/nullable.test.js +0 -65
  36. package/dist/cjs/v3/tests/number.test.js +0 -189
  37. package/dist/cjs/v3/tests/object-augmentation.test.js +0 -50
  38. package/dist/cjs/v3/tests/object-in-es5-env.test.js +0 -49
  39. package/dist/cjs/v3/tests/object.test.js +0 -352
  40. package/dist/cjs/v3/tests/optional.test.js +0 -65
  41. package/dist/cjs/v3/tests/parseUtil.test.js +0 -20
  42. package/dist/cjs/v3/tests/parser.test.js +0 -55
  43. package/dist/cjs/v3/tests/partials.test.js +0 -201
  44. package/dist/cjs/v3/tests/pickomit.test.js +0 -113
  45. package/dist/cjs/v3/tests/pipeline.test.js +0 -50
  46. package/dist/cjs/v3/tests/preprocess.test.js +0 -181
  47. package/dist/cjs/v3/tests/primitive.test.js +0 -385
  48. package/dist/cjs/v3/tests/promise.test.js +0 -98
  49. package/dist/cjs/v3/tests/readonly.test.js +0 -190
  50. package/dist/cjs/v3/tests/record.test.js +0 -153
  51. package/dist/cjs/v3/tests/recursive.test.js +0 -161
  52. package/dist/cjs/v3/tests/refine.test.js +0 -279
  53. package/dist/cjs/v3/tests/safeparse.test.js +0 -46
  54. package/dist/cjs/v3/tests/set.test.js +0 -144
  55. package/dist/cjs/v3/tests/standard-schema.test.js +0 -102
  56. package/dist/cjs/v3/tests/string.test.js +0 -842
  57. package/dist/cjs/v3/tests/transformer.test.js +0 -218
  58. package/dist/cjs/v3/tests/tuple.test.js +0 -97
  59. package/dist/cjs/v3/tests/unions.test.js +0 -75
  60. package/dist/cjs/v3/tests/validations.test.js +0 -155
  61. package/dist/cjs/v3/tests/void.test.js +0 -36
  62. package/dist/cjs/v4/classic/tests/anyunknown.test.js +0 -45
  63. package/dist/cjs/v4/classic/tests/array.test.js +0 -249
  64. package/dist/cjs/v4/classic/tests/assignability.test.js +0 -110
  65. package/dist/cjs/v4/classic/tests/async-parsing.test.js +0 -364
  66. package/dist/cjs/v4/classic/tests/async-refinements.test.js +0 -82
  67. package/dist/cjs/v4/classic/tests/base.test.js +0 -31
  68. package/dist/cjs/v4/classic/tests/bigint.test.js +0 -73
  69. package/dist/cjs/v4/classic/tests/brand.test.js +0 -60
  70. package/dist/cjs/v4/classic/tests/catch.test.js +0 -214
  71. package/dist/cjs/v4/classic/tests/coalesce.test.js +0 -18
  72. package/dist/cjs/v4/classic/tests/coerce.test.js +0 -175
  73. package/dist/cjs/v4/classic/tests/custom.test.js +0 -38
  74. package/dist/cjs/v4/classic/tests/date.test.js +0 -48
  75. package/dist/cjs/v4/classic/tests/default.test.js +0 -88
  76. package/dist/cjs/v4/classic/tests/description.test.js +0 -51
  77. package/dist/cjs/v4/classic/tests/discriminated-unions.test.js +0 -540
  78. package/dist/cjs/v4/classic/tests/enum.test.js +0 -260
  79. package/dist/cjs/v4/classic/tests/error-utils.test.js +0 -411
  80. package/dist/cjs/v4/classic/tests/error.test.js +0 -651
  81. package/dist/cjs/v4/classic/tests/file.test.js +0 -68
  82. package/dist/cjs/v4/classic/tests/firstparty.test.js +0 -198
  83. package/dist/cjs/v4/classic/tests/function.test.js +0 -219
  84. package/dist/cjs/v4/classic/tests/generics.test.js +0 -72
  85. package/dist/cjs/v4/classic/tests/index.test.js +0 -765
  86. package/dist/cjs/v4/classic/tests/instanceof.test.js +0 -58
  87. package/dist/cjs/v4/classic/tests/intersection.test.js +0 -134
  88. package/dist/cjs/v4/classic/tests/json-schema.test.js +0 -1707
  89. package/dist/cjs/v4/classic/tests/json.test.js +0 -105
  90. package/dist/cjs/v4/classic/tests/lazy.test.js +0 -185
  91. package/dist/cjs/v4/classic/tests/literal.test.js +0 -94
  92. package/dist/cjs/v4/classic/tests/map.test.js +0 -193
  93. package/dist/cjs/v4/classic/tests/nan.test.js +0 -42
  94. package/dist/cjs/v4/classic/tests/nested-refine.test.js +0 -180
  95. package/dist/cjs/v4/classic/tests/nonoptional.test.js +0 -80
  96. package/dist/cjs/v4/classic/tests/nullable.test.js +0 -43
  97. package/dist/cjs/v4/classic/tests/number.test.js +0 -241
  98. package/dist/cjs/v4/classic/tests/object.test.js +0 -405
  99. package/dist/cjs/v4/classic/tests/optional.test.js +0 -98
  100. package/dist/cjs/v4/classic/tests/partial.test.js +0 -137
  101. package/dist/cjs/v4/classic/tests/pickomit.test.js +0 -125
  102. package/dist/cjs/v4/classic/tests/pipe.test.js +0 -92
  103. package/dist/cjs/v4/classic/tests/prefault.test.js +0 -22
  104. package/dist/cjs/v4/classic/tests/preprocess.test.js +0 -273
  105. package/dist/cjs/v4/classic/tests/primitive.test.js +0 -184
  106. package/dist/cjs/v4/classic/tests/promise.test.js +0 -91
  107. package/dist/cjs/v4/classic/tests/readonly.test.js +0 -241
  108. package/dist/cjs/v4/classic/tests/record.test.js +0 -307
  109. package/dist/cjs/v4/classic/tests/recursive-types.test.js +0 -108
  110. package/dist/cjs/v4/classic/tests/refine.test.js +0 -402
  111. package/dist/cjs/v4/classic/tests/registries.test.js +0 -155
  112. package/dist/cjs/v4/classic/tests/set.test.js +0 -182
  113. package/dist/cjs/v4/classic/tests/standard-schema.test.js +0 -77
  114. package/dist/cjs/v4/classic/tests/string-formats.test.js +0 -49
  115. package/dist/cjs/v4/classic/tests/string.test.js +0 -980
  116. package/dist/cjs/v4/classic/tests/template-literal.test.js +0 -705
  117. package/dist/cjs/v4/classic/tests/transform.test.js +0 -239
  118. package/dist/cjs/v4/classic/tests/tuple.test.js +0 -166
  119. package/dist/cjs/v4/classic/tests/union.test.js +0 -107
  120. package/dist/cjs/v4/classic/tests/validations.test.js +0 -301
  121. package/dist/cjs/v4/classic/tests/void.test.js +0 -34
  122. package/dist/cjs/v4/core/tests/index.test.js +0 -66
  123. package/dist/cjs/v4/core/tests/locales/be.test.js +0 -123
  124. package/dist/cjs/v4/core/tests/locales/en.test.js +0 -21
  125. package/dist/cjs/v4/core/tests/locales/ru.test.js +0 -123
  126. package/dist/cjs/v4/core/tests/locales/tr.test.js +0 -79
  127. package/dist/cjs/v4/mini/tests/assignability.test.js +0 -104
  128. package/dist/cjs/v4/mini/tests/brand.test.js +0 -58
  129. package/dist/cjs/v4/mini/tests/checks.test.js +0 -147
  130. package/dist/cjs/v4/mini/tests/computed.test.js +0 -55
  131. package/dist/cjs/v4/mini/tests/error.test.js +0 -45
  132. package/dist/cjs/v4/mini/tests/functions.test.js +0 -37
  133. package/dist/cjs/v4/mini/tests/index.test.js +0 -763
  134. package/dist/cjs/v4/mini/tests/number.test.js +0 -109
  135. package/dist/cjs/v4/mini/tests/object.test.js +0 -122
  136. package/dist/cjs/v4/mini/tests/prototypes.test.js +0 -44
  137. package/dist/cjs/v4/mini/tests/recursive-types.test.js +0 -106
  138. package/dist/cjs/v4/mini/tests/string.test.js +0 -265
  139. package/dist/types/v3/tests/all-errors.test.d.ts +0 -1
  140. package/dist/types/v3/tests/anyunknown.test.d.ts +0 -1
  141. package/dist/types/v3/tests/array.test.d.ts +0 -1
  142. package/dist/types/v3/tests/async-parsing.test.d.ts +0 -1
  143. package/dist/types/v3/tests/async-refinements.test.d.ts +0 -1
  144. package/dist/types/v3/tests/base.test.d.ts +0 -1
  145. package/dist/types/v3/tests/bigint.test.d.ts +0 -1
  146. package/dist/types/v3/tests/branded.test.d.ts +0 -1
  147. package/dist/types/v3/tests/catch.test.d.ts +0 -1
  148. package/dist/types/v3/tests/coerce.test.d.ts +0 -1
  149. package/dist/types/v3/tests/complex.test.d.ts +0 -1
  150. package/dist/types/v3/tests/custom.test.d.ts +0 -1
  151. package/dist/types/v3/tests/date.test.d.ts +0 -1
  152. package/dist/types/v3/tests/deepmasking.test.d.ts +0 -1
  153. package/dist/types/v3/tests/default.test.d.ts +0 -1
  154. package/dist/types/v3/tests/description.test.d.ts +0 -1
  155. package/dist/types/v3/tests/discriminated-unions.test.d.ts +0 -1
  156. package/dist/types/v3/tests/enum.test.d.ts +0 -1
  157. package/dist/types/v3/tests/error.test.d.ts +0 -1
  158. package/dist/types/v3/tests/firstparty.test.d.ts +0 -1
  159. package/dist/types/v3/tests/firstpartyschematypes.test.d.ts +0 -1
  160. package/dist/types/v3/tests/function.test.d.ts +0 -1
  161. package/dist/types/v3/tests/generics.test.d.ts +0 -1
  162. package/dist/types/v3/tests/instanceof.test.d.ts +0 -1
  163. package/dist/types/v3/tests/intersection.test.d.ts +0 -1
  164. package/dist/types/v3/tests/language-server.source.d.ts +0 -70
  165. package/dist/types/v3/tests/language-server.test.d.ts +0 -1
  166. package/dist/types/v3/tests/literal.test.d.ts +0 -1
  167. package/dist/types/v3/tests/map.test.d.ts +0 -1
  168. package/dist/types/v3/tests/masking.test.d.ts +0 -1
  169. package/dist/types/v3/tests/mocker.test.d.ts +0 -1
  170. package/dist/types/v3/tests/nan.test.d.ts +0 -1
  171. package/dist/types/v3/tests/nativeEnum.test.d.ts +0 -1
  172. package/dist/types/v3/tests/nullable.test.d.ts +0 -1
  173. package/dist/types/v3/tests/number.test.d.ts +0 -1
  174. package/dist/types/v3/tests/object-augmentation.test.d.ts +0 -1
  175. package/dist/types/v3/tests/object-in-es5-env.test.d.ts +0 -1
  176. package/dist/types/v3/tests/object.test.d.ts +0 -1
  177. package/dist/types/v3/tests/optional.test.d.ts +0 -1
  178. package/dist/types/v3/tests/parseUtil.test.d.ts +0 -1
  179. package/dist/types/v3/tests/parser.test.d.ts +0 -1
  180. package/dist/types/v3/tests/partials.test.d.ts +0 -1
  181. package/dist/types/v3/tests/pickomit.test.d.ts +0 -1
  182. package/dist/types/v3/tests/pipeline.test.d.ts +0 -1
  183. package/dist/types/v3/tests/preprocess.test.d.ts +0 -1
  184. package/dist/types/v3/tests/primitive.test.d.ts +0 -1
  185. package/dist/types/v3/tests/promise.test.d.ts +0 -1
  186. package/dist/types/v3/tests/readonly.test.d.ts +0 -1
  187. package/dist/types/v3/tests/record.test.d.ts +0 -1
  188. package/dist/types/v3/tests/recursive.test.d.ts +0 -1
  189. package/dist/types/v3/tests/refine.test.d.ts +0 -1
  190. package/dist/types/v3/tests/safeparse.test.d.ts +0 -1
  191. package/dist/types/v3/tests/set.test.d.ts +0 -1
  192. package/dist/types/v3/tests/standard-schema.test.d.ts +0 -1
  193. package/dist/types/v3/tests/string.test.d.ts +0 -1
  194. package/dist/types/v3/tests/transformer.test.d.ts +0 -1
  195. package/dist/types/v3/tests/tuple.test.d.ts +0 -1
  196. package/dist/types/v3/tests/unions.test.d.ts +0 -1
  197. package/dist/types/v3/tests/validations.test.d.ts +0 -1
  198. package/dist/types/v3/tests/void.test.d.ts +0 -1
  199. package/dist/types/v4/classic/tests/anyunknown.test.d.ts +0 -1
  200. package/dist/types/v4/classic/tests/array.test.d.ts +0 -1
  201. package/dist/types/v4/classic/tests/assignability.test.d.ts +0 -1
  202. package/dist/types/v4/classic/tests/async-parsing.test.d.ts +0 -1
  203. package/dist/types/v4/classic/tests/async-refinements.test.d.ts +0 -1
  204. package/dist/types/v4/classic/tests/base.test.d.ts +0 -1
  205. package/dist/types/v4/classic/tests/bigint.test.d.ts +0 -1
  206. package/dist/types/v4/classic/tests/brand.test.d.ts +0 -1
  207. package/dist/types/v4/classic/tests/catch.test.d.ts +0 -1
  208. package/dist/types/v4/classic/tests/coalesce.test.d.ts +0 -1
  209. package/dist/types/v4/classic/tests/coerce.test.d.ts +0 -1
  210. package/dist/types/v4/classic/tests/custom.test.d.ts +0 -1
  211. package/dist/types/v4/classic/tests/date.test.d.ts +0 -1
  212. package/dist/types/v4/classic/tests/default.test.d.ts +0 -1
  213. package/dist/types/v4/classic/tests/description.test.d.ts +0 -1
  214. package/dist/types/v4/classic/tests/discriminated-unions.test.d.ts +0 -1
  215. package/dist/types/v4/classic/tests/enum.test.d.ts +0 -1
  216. package/dist/types/v4/classic/tests/error-utils.test.d.ts +0 -1
  217. package/dist/types/v4/classic/tests/error.test.d.ts +0 -1
  218. package/dist/types/v4/classic/tests/file.test.d.ts +0 -1
  219. package/dist/types/v4/classic/tests/firstparty.test.d.ts +0 -1
  220. package/dist/types/v4/classic/tests/function.test.d.ts +0 -1
  221. package/dist/types/v4/classic/tests/generics.test.d.ts +0 -1
  222. package/dist/types/v4/classic/tests/index.test.d.ts +0 -1
  223. package/dist/types/v4/classic/tests/instanceof.test.d.ts +0 -1
  224. package/dist/types/v4/classic/tests/intersection.test.d.ts +0 -1
  225. package/dist/types/v4/classic/tests/json-schema.test.d.ts +0 -1
  226. package/dist/types/v4/classic/tests/json.test.d.ts +0 -1
  227. package/dist/types/v4/classic/tests/lazy.test.d.ts +0 -1
  228. package/dist/types/v4/classic/tests/literal.test.d.ts +0 -1
  229. package/dist/types/v4/classic/tests/map.test.d.ts +0 -1
  230. package/dist/types/v4/classic/tests/nan.test.d.ts +0 -1
  231. package/dist/types/v4/classic/tests/nested-refine.test.d.ts +0 -1
  232. package/dist/types/v4/classic/tests/nonoptional.test.d.ts +0 -1
  233. package/dist/types/v4/classic/tests/nullable.test.d.ts +0 -1
  234. package/dist/types/v4/classic/tests/number.test.d.ts +0 -1
  235. package/dist/types/v4/classic/tests/object.test.d.ts +0 -1
  236. package/dist/types/v4/classic/tests/optional.test.d.ts +0 -1
  237. package/dist/types/v4/classic/tests/partial.test.d.ts +0 -1
  238. package/dist/types/v4/classic/tests/pickomit.test.d.ts +0 -1
  239. package/dist/types/v4/classic/tests/pipe.test.d.ts +0 -1
  240. package/dist/types/v4/classic/tests/prefault.test.d.ts +0 -1
  241. package/dist/types/v4/classic/tests/preprocess.test.d.ts +0 -1
  242. package/dist/types/v4/classic/tests/primitive.test.d.ts +0 -1
  243. package/dist/types/v4/classic/tests/promise.test.d.ts +0 -1
  244. package/dist/types/v4/classic/tests/readonly.test.d.ts +0 -1
  245. package/dist/types/v4/classic/tests/record.test.d.ts +0 -1
  246. package/dist/types/v4/classic/tests/recursive-types.test.d.ts +0 -1
  247. package/dist/types/v4/classic/tests/refine.test.d.ts +0 -1
  248. package/dist/types/v4/classic/tests/registries.test.d.ts +0 -1
  249. package/dist/types/v4/classic/tests/set.test.d.ts +0 -1
  250. package/dist/types/v4/classic/tests/standard-schema.test.d.ts +0 -1
  251. package/dist/types/v4/classic/tests/string-formats.test.d.ts +0 -1
  252. package/dist/types/v4/classic/tests/string.test.d.ts +0 -1
  253. package/dist/types/v4/classic/tests/template-literal.test.d.ts +0 -1
  254. package/dist/types/v4/classic/tests/transform.test.d.ts +0 -1
  255. package/dist/types/v4/classic/tests/tuple.test.d.ts +0 -1
  256. package/dist/types/v4/classic/tests/union.test.d.ts +0 -1
  257. package/dist/types/v4/classic/tests/validations.test.d.ts +0 -1
  258. package/dist/types/v4/classic/tests/void.test.d.ts +0 -1
  259. package/dist/types/v4/core/tests/index.test.d.ts +0 -1
  260. package/dist/types/v4/core/tests/locales/be.test.d.ts +0 -1
  261. package/dist/types/v4/core/tests/locales/en.test.d.ts +0 -1
  262. package/dist/types/v4/core/tests/locales/ru.test.d.ts +0 -1
  263. package/dist/types/v4/core/tests/locales/tr.test.d.ts +0 -1
  264. package/dist/types/v4/mini/tests/assignability.test.d.ts +0 -1
  265. package/dist/types/v4/mini/tests/brand.test.d.ts +0 -1
  266. package/dist/types/v4/mini/tests/checks.test.d.ts +0 -1
  267. package/dist/types/v4/mini/tests/computed.test.d.ts +0 -1
  268. package/dist/types/v4/mini/tests/error.test.d.ts +0 -1
  269. package/dist/types/v4/mini/tests/functions.test.d.ts +0 -1
  270. package/dist/types/v4/mini/tests/index.test.d.ts +0 -1
  271. package/dist/types/v4/mini/tests/number.test.d.ts +0 -1
  272. package/dist/types/v4/mini/tests/object.test.d.ts +0 -1
  273. package/dist/types/v4/mini/tests/prototypes.test.d.ts +0 -1
  274. package/dist/types/v4/mini/tests/recursive-types.test.d.ts +0 -1
  275. package/dist/types/v4/mini/tests/string.test.d.ts +0 -1
  276. package/src/index.ts +0 -4
  277. package/src/v3/ZodError.ts +0 -329
  278. package/src/v3/benchmarks/datetime.ts +0 -58
  279. package/src/v3/benchmarks/discriminatedUnion.ts +0 -80
  280. package/src/v3/benchmarks/index.ts +0 -59
  281. package/src/v3/benchmarks/ipv4.ts +0 -57
  282. package/src/v3/benchmarks/object.ts +0 -69
  283. package/src/v3/benchmarks/primitives.ts +0 -162
  284. package/src/v3/benchmarks/realworld.ts +0 -63
  285. package/src/v3/benchmarks/string.ts +0 -55
  286. package/src/v3/benchmarks/union.ts +0 -80
  287. package/src/v3/errors.ts +0 -13
  288. package/src/v3/external.ts +0 -6
  289. package/src/v3/helpers/enumUtil.ts +0 -17
  290. package/src/v3/helpers/errorUtil.ts +0 -8
  291. package/src/v3/helpers/parseUtil.ts +0 -176
  292. package/src/v3/helpers/partialUtil.ts +0 -34
  293. package/src/v3/helpers/typeAliases.ts +0 -2
  294. package/src/v3/helpers/util.ts +0 -224
  295. package/src/v3/index.ts +0 -4
  296. package/src/v3/locales/en.ts +0 -120
  297. package/src/v3/standard-schema.ts +0 -113
  298. package/src/v3/tests/Mocker.ts +0 -54
  299. package/src/v3/tests/all-errors.test.ts +0 -157
  300. package/src/v3/tests/anyunknown.test.ts +0 -28
  301. package/src/v3/tests/array.test.ts +0 -71
  302. package/src/v3/tests/async-parsing.test.ts +0 -388
  303. package/src/v3/tests/async-refinements.test.ts +0 -46
  304. package/src/v3/tests/base.test.ts +0 -29
  305. package/src/v3/tests/bigint.test.ts +0 -55
  306. package/src/v3/tests/branded.test.ts +0 -53
  307. package/src/v3/tests/catch.test.ts +0 -220
  308. package/src/v3/tests/coerce.test.ts +0 -133
  309. package/src/v3/tests/complex.test.ts +0 -56
  310. package/src/v3/tests/custom.test.ts +0 -31
  311. package/src/v3/tests/date.test.ts +0 -32
  312. package/src/v3/tests/deepmasking.test.ts +0 -186
  313. package/src/v3/tests/default.test.ts +0 -112
  314. package/src/v3/tests/description.test.ts +0 -33
  315. package/src/v3/tests/discriminated-unions.test.ts +0 -315
  316. package/src/v3/tests/enum.test.ts +0 -80
  317. package/src/v3/tests/error.test.ts +0 -551
  318. package/src/v3/tests/firstparty.test.ts +0 -87
  319. package/src/v3/tests/firstpartyschematypes.test.ts +0 -21
  320. package/src/v3/tests/function.test.ts +0 -257
  321. package/src/v3/tests/generics.test.ts +0 -48
  322. package/src/v3/tests/instanceof.test.ts +0 -37
  323. package/src/v3/tests/intersection.test.ts +0 -110
  324. package/src/v3/tests/language-server.source.ts +0 -76
  325. package/src/v3/tests/language-server.test.ts +0 -207
  326. package/src/v3/tests/literal.test.ts +0 -36
  327. package/src/v3/tests/map.test.ts +0 -110
  328. package/src/v3/tests/masking.test.ts +0 -4
  329. package/src/v3/tests/mocker.test.ts +0 -19
  330. package/src/v3/tests/nan.test.ts +0 -21
  331. package/src/v3/tests/nativeEnum.test.ts +0 -87
  332. package/src/v3/tests/nullable.test.ts +0 -42
  333. package/src/v3/tests/number.test.ts +0 -176
  334. package/src/v3/tests/object-augmentation.test.ts +0 -29
  335. package/src/v3/tests/object-in-es5-env.test.ts +0 -29
  336. package/src/v3/tests/object.test.ts +0 -434
  337. package/src/v3/tests/optional.test.ts +0 -42
  338. package/src/v3/tests/parseUtil.test.ts +0 -23
  339. package/src/v3/tests/parser.test.ts +0 -41
  340. package/src/v3/tests/partials.test.ts +0 -243
  341. package/src/v3/tests/pickomit.test.ts +0 -111
  342. package/src/v3/tests/pipeline.test.ts +0 -29
  343. package/src/v3/tests/preprocess.test.ts +0 -188
  344. package/src/v3/tests/primitive.test.ts +0 -440
  345. package/src/v3/tests/promise.test.ts +0 -90
  346. package/src/v3/tests/readonly.test.ts +0 -194
  347. package/src/v3/tests/record.test.ts +0 -171
  348. package/src/v3/tests/recursive.test.ts +0 -197
  349. package/src/v3/tests/refine.test.ts +0 -297
  350. package/src/v3/tests/safeparse.test.ts +0 -27
  351. package/src/v3/tests/set.test.ts +0 -142
  352. package/src/v3/tests/standard-schema.test.ts +0 -83
  353. package/src/v3/tests/string.test.ts +0 -916
  354. package/src/v3/tests/transformer.test.ts +0 -233
  355. package/src/v3/tests/tuple.test.ts +0 -90
  356. package/src/v3/tests/unions.test.ts +0 -57
  357. package/src/v3/tests/validations.test.ts +0 -133
  358. package/src/v3/tests/void.test.ts +0 -15
  359. package/src/v3/types.ts +0 -5135
  360. package/src/v4/classic/checks.ts +0 -30
  361. package/src/v4/classic/coerce.ts +0 -27
  362. package/src/v4/classic/compat.ts +0 -76
  363. package/src/v4/classic/errors.ts +0 -75
  364. package/src/v4/classic/external.ts +0 -31
  365. package/src/v4/classic/index.ts +0 -5
  366. package/src/v4/classic/iso.ts +0 -90
  367. package/src/v4/classic/parse.ts +0 -33
  368. package/src/v4/classic/schemas.ts +0 -2062
  369. package/src/v4/classic/tests/anyunknown.test.ts +0 -26
  370. package/src/v4/classic/tests/array.test.ts +0 -257
  371. package/src/v4/classic/tests/assignability.test.ts +0 -124
  372. package/src/v4/classic/tests/async-parsing.test.ts +0 -381
  373. package/src/v4/classic/tests/async-refinements.test.ts +0 -68
  374. package/src/v4/classic/tests/base.test.ts +0 -7
  375. package/src/v4/classic/tests/bigint.test.ts +0 -54
  376. package/src/v4/classic/tests/brand.test.ts +0 -57
  377. package/src/v4/classic/tests/catch.test.ts +0 -252
  378. package/src/v4/classic/tests/coalesce.test.ts +0 -20
  379. package/src/v4/classic/tests/coerce.test.ts +0 -160
  380. package/src/v4/classic/tests/custom.test.ts +0 -16
  381. package/src/v4/classic/tests/date.test.ts +0 -31
  382. package/src/v4/classic/tests/default.test.ts +0 -114
  383. package/src/v4/classic/tests/description.test.ts +0 -32
  384. package/src/v4/classic/tests/discriminated-unions.test.ts +0 -566
  385. package/src/v4/classic/tests/enum.test.ts +0 -285
  386. package/src/v4/classic/tests/error-utils.test.ts +0 -480
  387. package/src/v4/classic/tests/error.test.ts +0 -698
  388. package/src/v4/classic/tests/file.test.ts +0 -52
  389. package/src/v4/classic/tests/firstparty.test.ts +0 -177
  390. package/src/v4/classic/tests/function.test.ts +0 -230
  391. package/src/v4/classic/tests/generics.test.ts +0 -58
  392. package/src/v4/classic/tests/index.test.ts +0 -909
  393. package/src/v4/classic/tests/instanceof.test.ts +0 -34
  394. package/src/v4/classic/tests/intersection.test.ts +0 -171
  395. package/src/v4/classic/tests/json-schema.test.ts +0 -1810
  396. package/src/v4/classic/tests/json.test.ts +0 -108
  397. package/src/v4/classic/tests/lazy.test.ts +0 -227
  398. package/src/v4/classic/tests/literal.test.ts +0 -82
  399. package/src/v4/classic/tests/map.test.ts +0 -196
  400. package/src/v4/classic/tests/nan.test.ts +0 -21
  401. package/src/v4/classic/tests/nested-refine.test.ts +0 -165
  402. package/src/v4/classic/tests/nonoptional.test.ts +0 -86
  403. package/src/v4/classic/tests/nullable.test.ts +0 -22
  404. package/src/v4/classic/tests/number.test.ts +0 -242
  405. package/src/v4/classic/tests/object.test.ts +0 -493
  406. package/src/v4/classic/tests/optional.test.ts +0 -103
  407. package/src/v4/classic/tests/partial.test.ts +0 -147
  408. package/src/v4/classic/tests/pickomit.test.ts +0 -125
  409. package/src/v4/classic/tests/pipe.test.ts +0 -81
  410. package/src/v4/classic/tests/prefault.test.ts +0 -37
  411. package/src/v4/classic/tests/preprocess.test.ts +0 -272
  412. package/src/v4/classic/tests/primitive.test.ts +0 -175
  413. package/src/v4/classic/tests/promise.test.ts +0 -81
  414. package/src/v4/classic/tests/readonly.test.ts +0 -252
  415. package/src/v4/classic/tests/record.test.ts +0 -332
  416. package/src/v4/classic/tests/recursive-types.test.ts +0 -126
  417. package/src/v4/classic/tests/refine.test.ts +0 -423
  418. package/src/v4/classic/tests/registries.test.ts +0 -159
  419. package/src/v4/classic/tests/set.test.ts +0 -179
  420. package/src/v4/classic/tests/standard-schema.test.ts +0 -57
  421. package/src/v4/classic/tests/string-formats.test.ts +0 -31
  422. package/src/v4/classic/tests/string.test.ts +0 -1081
  423. package/src/v4/classic/tests/template-literal.test.ts +0 -758
  424. package/src/v4/classic/tests/transform.test.ts +0 -250
  425. package/src/v4/classic/tests/tuple.test.ts +0 -163
  426. package/src/v4/classic/tests/union.test.ts +0 -94
  427. package/src/v4/classic/tests/validations.test.ts +0 -277
  428. package/src/v4/classic/tests/void.test.ts +0 -12
  429. package/src/v4/core/api.ts +0 -1533
  430. package/src/v4/core/checks.ts +0 -1282
  431. package/src/v4/core/config.ts +0 -15
  432. package/src/v4/core/core.ts +0 -98
  433. package/src/v4/core/doc.ts +0 -45
  434. package/src/v4/core/errors.ts +0 -433
  435. package/src/v4/core/function.ts +0 -143
  436. package/src/v4/core/index.ts +0 -15
  437. package/src/v4/core/json-schema.ts +0 -106
  438. package/src/v4/core/parse.ts +0 -94
  439. package/src/v4/core/regexes.ts +0 -133
  440. package/src/v4/core/registries.ts +0 -89
  441. package/src/v4/core/schemas.ts +0 -3802
  442. package/src/v4/core/standard-schema.ts +0 -64
  443. package/src/v4/core/tests/index.test.ts +0 -46
  444. package/src/v4/core/tests/locales/be.test.ts +0 -124
  445. package/src/v4/core/tests/locales/en.test.ts +0 -22
  446. package/src/v4/core/tests/locales/ru.test.ts +0 -128
  447. package/src/v4/core/tests/locales/tr.test.ts +0 -69
  448. package/src/v4/core/to-json-schema.ts +0 -790
  449. package/src/v4/core/util.ts +0 -750
  450. package/src/v4/core/versions.ts +0 -5
  451. package/src/v4/core/zsf.ts +0 -323
  452. package/src/v4/index.ts +0 -4
  453. package/src/v4/locales/ar.ts +0 -125
  454. package/src/v4/locales/az.ts +0 -121
  455. package/src/v4/locales/be.ts +0 -185
  456. package/src/v4/locales/ca.ts +0 -127
  457. package/src/v4/locales/cs.ts +0 -142
  458. package/src/v4/locales/de.ts +0 -124
  459. package/src/v4/locales/en.ts +0 -127
  460. package/src/v4/locales/es.ts +0 -124
  461. package/src/v4/locales/fa.ts +0 -134
  462. package/src/v4/locales/fi.ts +0 -131
  463. package/src/v4/locales/fr.ts +0 -124
  464. package/src/v4/locales/frCA.ts +0 -126
  465. package/src/v4/locales/he.ts +0 -125
  466. package/src/v4/locales/hu.ts +0 -126
  467. package/src/v4/locales/id.ts +0 -124
  468. package/src/v4/locales/index.ts +0 -34
  469. package/src/v4/locales/it.ts +0 -125
  470. package/src/v4/locales/ja.ts +0 -122
  471. package/src/v4/locales/ko.ts +0 -131
  472. package/src/v4/locales/mk.ts +0 -127
  473. package/src/v4/locales/ms.ts +0 -124
  474. package/src/v4/locales/no.ts +0 -124
  475. package/src/v4/locales/ota.ts +0 -125
  476. package/src/v4/locales/pl.ts +0 -125
  477. package/src/v4/locales/pt.ts +0 -123
  478. package/src/v4/locales/ru.ts +0 -185
  479. package/src/v4/locales/sl.ts +0 -125
  480. package/src/v4/locales/ta.ts +0 -125
  481. package/src/v4/locales/th.ts +0 -126
  482. package/src/v4/locales/tr.ts +0 -121
  483. package/src/v4/locales/ua.ts +0 -126
  484. package/src/v4/locales/ur.ts +0 -126
  485. package/src/v4/locales/vi.ts +0 -125
  486. package/src/v4/locales/zh-CN.ts +0 -123
  487. package/src/v4/locales/zh-tw.ts +0 -125
  488. package/src/v4/mini/checks.ts +0 -32
  489. package/src/v4/mini/coerce.ts +0 -22
  490. package/src/v4/mini/external.ts +0 -26
  491. package/src/v4/mini/index.ts +0 -3
  492. package/src/v4/mini/iso.ts +0 -62
  493. package/src/v4/mini/parse.ts +0 -1
  494. package/src/v4/mini/schemas.ts +0 -1556
  495. package/src/v4/mini/tests/assignability.test.ts +0 -117
  496. package/src/v4/mini/tests/brand.test.ts +0 -51
  497. package/src/v4/mini/tests/checks.test.ts +0 -144
  498. package/src/v4/mini/tests/computed.test.ts +0 -36
  499. package/src/v4/mini/tests/error.test.ts +0 -22
  500. package/src/v4/mini/tests/functions.test.ts +0 -43
  501. package/src/v4/mini/tests/index.test.ts +0 -914
  502. package/src/v4/mini/tests/number.test.ts +0 -95
  503. package/src/v4/mini/tests/object.test.ts +0 -139
  504. package/src/v4/mini/tests/prototypes.test.ts +0 -23
  505. package/src/v4/mini/tests/recursive-types.test.ts +0 -124
  506. package/src/v4/mini/tests/string.test.ts +0 -284
@@ -1,705 +0,0 @@
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
- });