fullstacked 0.12.1-1359 → 0.12.1-1364

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 (335) hide show
  1. package/fullstacked_modules/@fullstacked/ai-agent/ai-agent.js +55352 -53576
  2. package/fullstacked_modules/@fullstacked/ai-agent/index.ts +0 -1
  3. package/fullstacked_modules/@fullstacked/ai-agent/lock.json +157 -152
  4. package/fullstacked_modules/@fullstacked/ai-agent/package.json +13 -13
  5. package/fullstacked_modules/@fullstacked/ai-agent/src/providers/ollama.ts +2 -2
  6. package/fullstacked_modules/@fullstacked/ui/index.js +6 -1
  7. package/fullstacked_modules/zod/README.md +4 -4
  8. package/fullstacked_modules/zod/index.cjs +2 -2
  9. package/fullstacked_modules/zod/index.d.cts +2 -2
  10. package/fullstacked_modules/zod/index.d.ts +2 -2
  11. package/fullstacked_modules/zod/index.js +2 -2
  12. package/fullstacked_modules/zod/locales/index.cjs +17 -0
  13. package/fullstacked_modules/zod/locales/index.d.cts +1 -0
  14. package/fullstacked_modules/zod/locales/index.d.ts +1 -0
  15. package/fullstacked_modules/zod/locales/index.js +1 -0
  16. package/fullstacked_modules/zod/locales/package.json +6 -0
  17. package/fullstacked_modules/zod/mini/index.cjs +17 -0
  18. package/fullstacked_modules/zod/mini/index.d.cts +1 -0
  19. package/fullstacked_modules/zod/mini/index.d.ts +1 -0
  20. package/fullstacked_modules/zod/mini/index.js +1 -0
  21. package/fullstacked_modules/zod/mini/package.json +6 -0
  22. package/fullstacked_modules/zod/package.json +29 -12
  23. package/fullstacked_modules/zod/src/index.ts +2 -2
  24. package/fullstacked_modules/zod/src/locales/index.ts +1 -0
  25. package/fullstacked_modules/zod/src/mini/index.ts +1 -0
  26. package/fullstacked_modules/zod/src/v3/ZodError.ts +1 -1
  27. package/fullstacked_modules/zod/src/v3/tests/object.test.ts +2 -2
  28. package/fullstacked_modules/zod/src/v3/tests/string.test.ts +2 -2
  29. package/fullstacked_modules/zod/src/v3/types.ts +3 -1
  30. package/fullstacked_modules/zod/src/v4/classic/checks.ts +1 -0
  31. package/fullstacked_modules/zod/src/v4/classic/compat.ts +4 -0
  32. package/fullstacked_modules/zod/src/v4/classic/errors.ts +9 -2
  33. package/fullstacked_modules/zod/src/v4/classic/external.ts +1 -1
  34. package/fullstacked_modules/zod/src/v4/classic/parse.ts +49 -0
  35. package/fullstacked_modules/zod/src/v4/classic/schemas.ts +224 -81
  36. package/fullstacked_modules/zod/src/v4/classic/tests/array.test.ts +6 -6
  37. package/fullstacked_modules/zod/src/v4/classic/tests/catch.test.ts +29 -5
  38. package/fullstacked_modules/zod/src/v4/classic/tests/codec-examples.test.ts +573 -0
  39. package/fullstacked_modules/zod/src/v4/classic/tests/codec.test.ts +562 -0
  40. package/fullstacked_modules/zod/src/v4/classic/tests/continuability.test.ts +1 -1
  41. package/fullstacked_modules/zod/src/v4/classic/tests/datetime.test.ts +6 -0
  42. package/fullstacked_modules/zod/src/v4/classic/tests/default.test.ts +52 -0
  43. package/fullstacked_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +42 -0
  44. package/fullstacked_modules/zod/src/v4/classic/tests/error-utils.test.ts +70 -2
  45. package/fullstacked_modules/zod/src/v4/classic/tests/file.test.ts +9 -4
  46. package/fullstacked_modules/zod/src/v4/classic/tests/firstparty.test.ts +4 -0
  47. package/fullstacked_modules/zod/src/v4/classic/tests/function.test.ts +71 -31
  48. package/fullstacked_modules/zod/src/v4/classic/tests/hash.test.ts +68 -0
  49. package/fullstacked_modules/zod/src/v4/classic/tests/index.test.ts +15 -0
  50. package/fullstacked_modules/zod/src/v4/classic/tests/literal.test.ts +25 -0
  51. package/fullstacked_modules/zod/src/v4/classic/tests/nonoptional.test.ts +15 -0
  52. package/fullstacked_modules/zod/src/v4/classic/tests/number.test.ts +23 -0
  53. package/fullstacked_modules/zod/src/v4/classic/tests/object.test.ts +48 -2
  54. package/fullstacked_modules/zod/src/v4/classic/tests/optional.test.ts +13 -0
  55. package/fullstacked_modules/zod/src/v4/classic/tests/partial.test.ts +193 -0
  56. package/fullstacked_modules/zod/src/v4/classic/tests/pickomit.test.ts +5 -5
  57. package/fullstacked_modules/zod/src/v4/classic/tests/pipe.test.ts +25 -5
  58. package/fullstacked_modules/zod/src/v4/classic/tests/prefault.test.ts +37 -0
  59. package/fullstacked_modules/zod/src/v4/classic/tests/preprocess.test.ts +5 -21
  60. package/fullstacked_modules/zod/src/v4/classic/tests/record.test.ts +15 -1
  61. package/fullstacked_modules/zod/src/v4/classic/tests/recursive-types.test.ts +226 -0
  62. package/fullstacked_modules/zod/src/v4/classic/tests/refine.test.ts +78 -5
  63. package/fullstacked_modules/zod/src/v4/classic/tests/set.test.ts +5 -3
  64. package/fullstacked_modules/zod/src/v4/classic/tests/string-formats.test.ts +16 -0
  65. package/fullstacked_modules/zod/src/v4/classic/tests/string.test.ts +204 -5
  66. package/fullstacked_modules/zod/src/v4/classic/tests/stringbool.test.ts +40 -0
  67. package/fullstacked_modules/zod/src/v4/classic/tests/template-literal.test.ts +14 -9
  68. package/fullstacked_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +315 -7
  69. package/fullstacked_modules/zod/src/v4/classic/tests/transform.test.ts +111 -0
  70. package/fullstacked_modules/zod/src/v4/classic/tests/tuple.test.ts +2 -2
  71. package/fullstacked_modules/zod/src/v4/classic/tests/union.test.ts +90 -3
  72. package/fullstacked_modules/zod/src/v4/core/api.ts +160 -133
  73. package/fullstacked_modules/zod/src/v4/core/checks.ts +6 -2
  74. package/fullstacked_modules/zod/src/v4/core/core.ts +9 -28
  75. package/fullstacked_modules/zod/src/v4/core/doc.ts +2 -2
  76. package/fullstacked_modules/zod/src/v4/core/errors.ts +49 -60
  77. package/fullstacked_modules/zod/src/v4/core/index.ts +0 -1
  78. package/fullstacked_modules/zod/src/v4/core/json-schema.ts +7 -3
  79. package/fullstacked_modules/zod/src/v4/core/parse.ts +101 -0
  80. package/fullstacked_modules/zod/src/v4/core/regexes.ts +56 -14
  81. package/fullstacked_modules/zod/src/v4/core/registries.ts +5 -4
  82. package/fullstacked_modules/zod/src/v4/core/schemas.ts +705 -230
  83. package/fullstacked_modules/zod/src/v4/core/tests/extend.test.ts +18 -0
  84. package/fullstacked_modules/zod/src/v4/core/tests/locales/es.test.ts +181 -0
  85. package/fullstacked_modules/zod/src/v4/core/to-json-schema.ts +100 -33
  86. package/fullstacked_modules/zod/src/v4/core/util.ts +237 -102
  87. package/fullstacked_modules/zod/src/v4/core/versions.ts +2 -2
  88. package/fullstacked_modules/zod/src/v4/locales/bg.ts +136 -0
  89. package/fullstacked_modules/zod/src/v4/locales/da.ts +141 -0
  90. package/fullstacked_modules/zod/src/v4/locales/es.ts +44 -10
  91. package/fullstacked_modules/zod/src/v4/locales/index.ts +8 -0
  92. package/fullstacked_modules/zod/src/v4/locales/is.ts +127 -0
  93. package/fullstacked_modules/zod/src/v4/locales/ka.ts +138 -0
  94. package/fullstacked_modules/zod/src/v4/locales/kh.ts +3 -122
  95. package/fullstacked_modules/zod/src/v4/locales/km.ts +126 -0
  96. package/fullstacked_modules/zod/src/v4/locales/lt.ts +265 -0
  97. package/fullstacked_modules/zod/src/v4/locales/ua.ts +3 -122
  98. package/fullstacked_modules/zod/src/v4/locales/uk.ts +126 -0
  99. package/fullstacked_modules/zod/src/v4/locales/yo.ts +131 -0
  100. package/fullstacked_modules/zod/src/v4/mini/external.ts +1 -1
  101. package/fullstacked_modules/zod/src/v4/mini/parse.ts +14 -1
  102. package/fullstacked_modules/zod/src/v4/mini/schemas.ts +186 -40
  103. package/fullstacked_modules/zod/src/v4/mini/tests/assignability.test.ts +1 -1
  104. package/fullstacked_modules/zod/src/v4/mini/tests/codec.test.ts +529 -0
  105. package/fullstacked_modules/zod/src/v4/mini/tests/computed.test.ts +1 -1
  106. package/fullstacked_modules/zod/src/v4/mini/tests/error.test.ts +1 -1
  107. package/fullstacked_modules/zod/src/v4/mini/tests/index.test.ts +29 -1
  108. package/fullstacked_modules/zod/src/v4/mini/tests/number.test.ts +1 -1
  109. package/fullstacked_modules/zod/src/v4/mini/tests/object.test.ts +16 -1
  110. package/fullstacked_modules/zod/src/v4/mini/tests/prototypes.test.ts +1 -1
  111. package/fullstacked_modules/zod/src/v4/mini/tests/recursive-types.test.ts +1 -1
  112. package/fullstacked_modules/zod/src/v4/mini/tests/string.test.ts +17 -1
  113. package/fullstacked_modules/zod/v3/ZodError.cjs +1 -1
  114. package/fullstacked_modules/zod/v3/ZodError.d.cts +6 -6
  115. package/fullstacked_modules/zod/v3/ZodError.d.ts +6 -6
  116. package/fullstacked_modules/zod/v3/ZodError.js +1 -1
  117. package/fullstacked_modules/zod/v3/locales/en.cjs +1 -0
  118. package/fullstacked_modules/zod/v3/locales/en.d.cts +1 -1
  119. package/fullstacked_modules/zod/v3/package.json +6 -0
  120. package/fullstacked_modules/zod/v3/types.cjs +2 -0
  121. package/fullstacked_modules/zod/v3/types.d.cts +4 -1
  122. package/fullstacked_modules/zod/v3/types.d.ts +4 -1
  123. package/fullstacked_modules/zod/v3/types.js +2 -0
  124. package/fullstacked_modules/zod/v4/classic/checks.d.cts +1 -1
  125. package/fullstacked_modules/zod/v4/classic/checks.d.ts +1 -1
  126. package/fullstacked_modules/zod/v4/classic/compat.cjs +5 -1
  127. package/fullstacked_modules/zod/v4/classic/compat.d.cts +4 -0
  128. package/fullstacked_modules/zod/v4/classic/compat.d.ts +4 -0
  129. package/fullstacked_modules/zod/v4/classic/compat.js +4 -0
  130. package/fullstacked_modules/zod/v4/classic/errors.cjs +9 -2
  131. package/fullstacked_modules/zod/v4/classic/errors.js +9 -2
  132. package/fullstacked_modules/zod/v4/classic/external.cjs +2 -2
  133. package/fullstacked_modules/zod/v4/classic/external.d.cts +1 -1
  134. package/fullstacked_modules/zod/v4/classic/external.d.ts +1 -1
  135. package/fullstacked_modules/zod/v4/classic/external.js +1 -1
  136. package/fullstacked_modules/zod/v4/classic/package.json +6 -0
  137. package/fullstacked_modules/zod/v4/classic/parse.cjs +10 -1
  138. package/fullstacked_modules/zod/v4/classic/parse.d.cts +8 -0
  139. package/fullstacked_modules/zod/v4/classic/parse.d.ts +8 -0
  140. package/fullstacked_modules/zod/v4/classic/parse.js +9 -0
  141. package/fullstacked_modules/zod/v4/classic/schemas.cjs +90 -48
  142. package/fullstacked_modules/zod/v4/classic/schemas.d.cts +70 -27
  143. package/fullstacked_modules/zod/v4/classic/schemas.d.ts +70 -27
  144. package/fullstacked_modules/zod/v4/classic/schemas.js +81 -47
  145. package/fullstacked_modules/zod/v4/core/api.cjs +52 -31
  146. package/fullstacked_modules/zod/v4/core/api.d.cts +87 -76
  147. package/fullstacked_modules/zod/v4/core/api.d.ts +87 -76
  148. package/fullstacked_modules/zod/v4/core/api.js +50 -31
  149. package/fullstacked_modules/zod/v4/core/checks.cjs +4 -0
  150. package/fullstacked_modules/zod/v4/core/checks.d.cts +2 -2
  151. package/fullstacked_modules/zod/v4/core/checks.d.ts +2 -2
  152. package/fullstacked_modules/zod/v4/core/checks.js +4 -0
  153. package/fullstacked_modules/zod/v4/core/core.cjs +8 -1
  154. package/fullstacked_modules/zod/v4/core/core.d.cts +5 -2
  155. package/fullstacked_modules/zod/v4/core/core.d.ts +5 -2
  156. package/fullstacked_modules/zod/v4/core/core.js +6 -0
  157. package/fullstacked_modules/zod/v4/core/doc.d.cts +1 -1
  158. package/fullstacked_modules/zod/v4/core/doc.d.ts +1 -1
  159. package/fullstacked_modules/zod/v4/core/errors.cjs +6 -19
  160. package/fullstacked_modules/zod/v4/core/errors.d.cts +24 -22
  161. package/fullstacked_modules/zod/v4/core/errors.d.ts +24 -22
  162. package/fullstacked_modules/zod/v4/core/errors.js +6 -19
  163. package/fullstacked_modules/zod/v4/core/index.cjs +0 -1
  164. package/fullstacked_modules/zod/v4/core/index.d.cts +0 -1
  165. package/fullstacked_modules/zod/v4/core/index.d.ts +0 -1
  166. package/fullstacked_modules/zod/v4/core/index.js +0 -1
  167. package/fullstacked_modules/zod/v4/core/json-schema.d.cts +4 -3
  168. package/fullstacked_modules/zod/v4/core/json-schema.d.ts +4 -3
  169. package/fullstacked_modules/zod/v4/core/package.json +6 -0
  170. package/fullstacked_modules/zod/v4/core/parse.cjs +45 -1
  171. package/fullstacked_modules/zod/v4/core/parse.d.cts +24 -0
  172. package/fullstacked_modules/zod/v4/core/parse.d.ts +24 -0
  173. package/fullstacked_modules/zod/v4/core/parse.js +36 -0
  174. package/fullstacked_modules/zod/v4/core/regexes.cjs +49 -16
  175. package/fullstacked_modules/zod/v4/core/regexes.d.cts +18 -2
  176. package/fullstacked_modules/zod/v4/core/regexes.d.ts +18 -2
  177. package/fullstacked_modules/zod/v4/core/regexes.js +46 -14
  178. package/fullstacked_modules/zod/v4/core/registries.cjs +4 -3
  179. package/fullstacked_modules/zod/v4/core/registries.d.cts +2 -2
  180. package/fullstacked_modules/zod/v4/core/registries.d.ts +2 -2
  181. package/fullstacked_modules/zod/v4/core/registries.js +4 -3
  182. package/fullstacked_modules/zod/v4/core/schemas.cjs +409 -171
  183. package/fullstacked_modules/zod/v4/core/schemas.d.cts +88 -16
  184. package/fullstacked_modules/zod/v4/core/schemas.d.ts +88 -16
  185. package/fullstacked_modules/zod/v4/core/schemas.js +408 -170
  186. package/fullstacked_modules/zod/v4/core/to-json-schema.cjs +97 -31
  187. package/fullstacked_modules/zod/v4/core/to-json-schema.d.cts +5 -3
  188. package/fullstacked_modules/zod/v4/core/to-json-schema.d.ts +5 -3
  189. package/fullstacked_modules/zod/v4/core/to-json-schema.js +97 -31
  190. package/fullstacked_modules/zod/v4/core/util.cjs +220 -101
  191. package/fullstacked_modules/zod/v4/core/util.d.cts +14 -0
  192. package/fullstacked_modules/zod/v4/core/util.d.ts +14 -0
  193. package/fullstacked_modules/zod/v4/core/util.js +209 -101
  194. package/fullstacked_modules/zod/v4/core/versions.cjs +2 -2
  195. package/fullstacked_modules/zod/v4/core/versions.d.cts +1 -1
  196. package/fullstacked_modules/zod/v4/core/versions.d.ts +1 -1
  197. package/fullstacked_modules/zod/v4/core/versions.js +2 -2
  198. package/fullstacked_modules/zod/v4/locales/ar.cjs +1 -0
  199. package/fullstacked_modules/zod/v4/locales/ar.d.cts +2 -1
  200. package/fullstacked_modules/zod/v4/locales/az.cjs +1 -0
  201. package/fullstacked_modules/zod/v4/locales/az.d.cts +2 -1
  202. package/fullstacked_modules/zod/v4/locales/be.cjs +1 -0
  203. package/fullstacked_modules/zod/v4/locales/be.d.cts +2 -1
  204. package/fullstacked_modules/zod/v4/locales/bg.cjs +156 -0
  205. package/fullstacked_modules/zod/v4/locales/bg.d.cts +5 -0
  206. package/fullstacked_modules/zod/v4/locales/bg.d.ts +5 -0
  207. package/fullstacked_modules/zod/v4/locales/bg.js +128 -0
  208. package/fullstacked_modules/zod/v4/locales/ca.cjs +1 -0
  209. package/fullstacked_modules/zod/v4/locales/ca.d.cts +2 -1
  210. package/fullstacked_modules/zod/v4/locales/cs.cjs +1 -0
  211. package/fullstacked_modules/zod/v4/locales/cs.d.cts +2 -1
  212. package/fullstacked_modules/zod/v4/locales/da.cjs +158 -0
  213. package/fullstacked_modules/zod/v4/locales/da.d.cts +5 -0
  214. package/fullstacked_modules/zod/v4/locales/da.d.ts +4 -0
  215. package/fullstacked_modules/zod/v4/locales/da.js +131 -0
  216. package/fullstacked_modules/zod/v4/locales/de.cjs +1 -0
  217. package/fullstacked_modules/zod/v4/locales/de.d.cts +2 -1
  218. package/fullstacked_modules/zod/v4/locales/es.cjs +43 -10
  219. package/fullstacked_modules/zod/v4/locales/es.d.cts +2 -1
  220. package/fullstacked_modules/zod/v4/locales/es.js +42 -10
  221. package/fullstacked_modules/zod/v4/locales/fa.cjs +1 -0
  222. package/fullstacked_modules/zod/v4/locales/fa.d.cts +2 -1
  223. package/fullstacked_modules/zod/v4/locales/fi.cjs +1 -0
  224. package/fullstacked_modules/zod/v4/locales/fi.d.cts +2 -1
  225. package/fullstacked_modules/zod/v4/locales/fr-CA.cjs +1 -0
  226. package/fullstacked_modules/zod/v4/locales/fr-CA.d.cts +2 -1
  227. package/fullstacked_modules/zod/v4/locales/fr.cjs +1 -0
  228. package/fullstacked_modules/zod/v4/locales/fr.d.cts +2 -1
  229. package/fullstacked_modules/zod/v4/locales/he.cjs +1 -0
  230. package/fullstacked_modules/zod/v4/locales/he.d.cts +2 -1
  231. package/fullstacked_modules/zod/v4/locales/hu.cjs +1 -0
  232. package/fullstacked_modules/zod/v4/locales/hu.d.cts +2 -1
  233. package/fullstacked_modules/zod/v4/locales/id.cjs +1 -0
  234. package/fullstacked_modules/zod/v4/locales/id.d.cts +2 -1
  235. package/fullstacked_modules/zod/v4/locales/index.cjs +17 -1
  236. package/fullstacked_modules/zod/v4/locales/index.d.cts +8 -0
  237. package/fullstacked_modules/zod/v4/locales/index.d.ts +8 -0
  238. package/fullstacked_modules/zod/v4/locales/index.js +8 -0
  239. package/fullstacked_modules/zod/v4/locales/is.cjs +145 -0
  240. package/fullstacked_modules/zod/v4/locales/is.d.cts +5 -0
  241. package/fullstacked_modules/zod/v4/locales/is.d.ts +5 -0
  242. package/fullstacked_modules/zod/v4/locales/is.js +117 -0
  243. package/fullstacked_modules/zod/v4/locales/it.cjs +1 -0
  244. package/fullstacked_modules/zod/v4/locales/it.d.cts +2 -1
  245. package/fullstacked_modules/zod/v4/locales/ja.cjs +1 -0
  246. package/fullstacked_modules/zod/v4/locales/ja.d.cts +2 -1
  247. package/fullstacked_modules/zod/v4/locales/ka.cjs +153 -0
  248. package/fullstacked_modules/zod/v4/locales/ka.d.cts +5 -0
  249. package/fullstacked_modules/zod/v4/locales/ka.d.ts +5 -0
  250. package/fullstacked_modules/zod/v4/locales/ka.js +125 -0
  251. package/fullstacked_modules/zod/v4/locales/kh.cjs +6 -137
  252. package/fullstacked_modules/zod/v4/locales/kh.d.cts +2 -1
  253. package/fullstacked_modules/zod/v4/locales/kh.d.ts +1 -0
  254. package/fullstacked_modules/zod/v4/locales/kh.js +3 -115
  255. package/fullstacked_modules/zod/v4/locales/km.cjs +144 -0
  256. package/fullstacked_modules/zod/v4/locales/km.d.cts +5 -0
  257. package/fullstacked_modules/zod/v4/locales/km.d.ts +4 -0
  258. package/fullstacked_modules/zod/v4/locales/km.js +117 -0
  259. package/fullstacked_modules/zod/v4/locales/ko.cjs +1 -0
  260. package/fullstacked_modules/zod/v4/locales/ko.d.cts +2 -1
  261. package/fullstacked_modules/zod/v4/locales/lt.cjs +258 -0
  262. package/fullstacked_modules/zod/v4/locales/lt.d.cts +5 -0
  263. package/fullstacked_modules/zod/v4/locales/lt.d.ts +5 -0
  264. package/fullstacked_modules/zod/v4/locales/lt.js +230 -0
  265. package/fullstacked_modules/zod/v4/locales/mk.cjs +1 -0
  266. package/fullstacked_modules/zod/v4/locales/mk.d.cts +2 -1
  267. package/fullstacked_modules/zod/v4/locales/ms.cjs +1 -0
  268. package/fullstacked_modules/zod/v4/locales/ms.d.cts +2 -1
  269. package/fullstacked_modules/zod/v4/locales/nl.cjs +1 -0
  270. package/fullstacked_modules/zod/v4/locales/nl.d.cts +2 -1
  271. package/fullstacked_modules/zod/v4/locales/no.cjs +1 -0
  272. package/fullstacked_modules/zod/v4/locales/no.d.cts +2 -1
  273. package/fullstacked_modules/zod/v4/locales/ota.cjs +1 -0
  274. package/fullstacked_modules/zod/v4/locales/ota.d.cts +2 -1
  275. package/fullstacked_modules/zod/v4/locales/package.json +6 -0
  276. package/fullstacked_modules/zod/v4/locales/pl.cjs +1 -0
  277. package/fullstacked_modules/zod/v4/locales/pl.d.cts +2 -1
  278. package/fullstacked_modules/zod/v4/locales/ps.cjs +1 -0
  279. package/fullstacked_modules/zod/v4/locales/ps.d.cts +2 -1
  280. package/fullstacked_modules/zod/v4/locales/pt.cjs +1 -0
  281. package/fullstacked_modules/zod/v4/locales/pt.d.cts +2 -1
  282. package/fullstacked_modules/zod/v4/locales/ru.cjs +1 -0
  283. package/fullstacked_modules/zod/v4/locales/ru.d.cts +2 -1
  284. package/fullstacked_modules/zod/v4/locales/sl.cjs +1 -0
  285. package/fullstacked_modules/zod/v4/locales/sl.d.cts +2 -1
  286. package/fullstacked_modules/zod/v4/locales/sv.cjs +1 -0
  287. package/fullstacked_modules/zod/v4/locales/sv.d.cts +2 -1
  288. package/fullstacked_modules/zod/v4/locales/ta.cjs +1 -0
  289. package/fullstacked_modules/zod/v4/locales/ta.d.cts +2 -1
  290. package/fullstacked_modules/zod/v4/locales/th.cjs +1 -0
  291. package/fullstacked_modules/zod/v4/locales/th.d.cts +2 -1
  292. package/fullstacked_modules/zod/v4/locales/ua.cjs +6 -137
  293. package/fullstacked_modules/zod/v4/locales/ua.d.cts +2 -1
  294. package/fullstacked_modules/zod/v4/locales/ua.d.ts +1 -0
  295. package/fullstacked_modules/zod/v4/locales/ua.js +3 -115
  296. package/fullstacked_modules/zod/v4/locales/uk.cjs +144 -0
  297. package/fullstacked_modules/zod/v4/locales/uk.d.cts +5 -0
  298. package/fullstacked_modules/zod/v4/locales/uk.d.ts +4 -0
  299. package/fullstacked_modules/zod/v4/locales/uk.js +117 -0
  300. package/fullstacked_modules/zod/v4/locales/ur.cjs +1 -0
  301. package/fullstacked_modules/zod/v4/locales/ur.d.cts +2 -1
  302. package/fullstacked_modules/zod/v4/locales/vi.cjs +1 -0
  303. package/fullstacked_modules/zod/v4/locales/vi.d.cts +2 -1
  304. package/fullstacked_modules/zod/v4/locales/yo.cjs +142 -0
  305. package/fullstacked_modules/zod/v4/locales/yo.d.cts +5 -0
  306. package/fullstacked_modules/zod/v4/locales/yo.d.ts +4 -0
  307. package/fullstacked_modules/zod/v4/locales/yo.js +115 -0
  308. package/fullstacked_modules/zod/v4/locales/zh-CN.cjs +1 -0
  309. package/fullstacked_modules/zod/v4/locales/zh-CN.d.cts +2 -1
  310. package/fullstacked_modules/zod/v4/locales/zh-TW.cjs +1 -0
  311. package/fullstacked_modules/zod/v4/locales/zh-TW.d.cts +2 -1
  312. package/fullstacked_modules/zod/v4/mini/external.cjs +2 -2
  313. package/fullstacked_modules/zod/v4/mini/external.d.cts +1 -1
  314. package/fullstacked_modules/zod/v4/mini/external.d.ts +1 -1
  315. package/fullstacked_modules/zod/v4/mini/external.js +1 -1
  316. package/fullstacked_modules/zod/v4/mini/package.json +6 -0
  317. package/fullstacked_modules/zod/v4/mini/parse.cjs +9 -1
  318. package/fullstacked_modules/zod/v4/mini/parse.d.cts +1 -1
  319. package/fullstacked_modules/zod/v4/mini/parse.d.ts +1 -1
  320. package/fullstacked_modules/zod/v4/mini/parse.js +1 -1
  321. package/fullstacked_modules/zod/v4/mini/schemas.cjs +77 -24
  322. package/fullstacked_modules/zod/v4/mini/schemas.d.cts +56 -5
  323. package/fullstacked_modules/zod/v4/mini/schemas.d.ts +56 -5
  324. package/fullstacked_modules/zod/v4/mini/schemas.js +66 -23
  325. package/fullstacked_modules/zod/v4/package.json +6 -0
  326. package/fullstacked_modules/zod/v4-mini/package.json +6 -0
  327. package/index.js +1 -1
  328. package/package.json +1 -1
  329. package/fullstacked_modules/@fullstacked/ai-agent/story.txt +0 -7
  330. package/fullstacked_modules/@fullstacked/ai-agent/summary.txt +0 -7
  331. package/fullstacked_modules/zod/src/v4/core/function.ts +0 -176
  332. package/fullstacked_modules/zod/v4/core/function.cjs +0 -102
  333. package/fullstacked_modules/zod/v4/core/function.d.cts +0 -52
  334. package/fullstacked_modules/zod/v4/core/function.d.ts +0 -52
  335. package/fullstacked_modules/zod/v4/core/function.js +0 -75
@@ -167,8 +167,8 @@ describe("early termination options", () => {
167
167
  });
168
168
 
169
169
  describe("custom error paths", () => {
170
- test("should use custom path in error message", async () => {
171
- const result = await z
170
+ test("should use custom path in error message", () => {
171
+ const result = z
172
172
  .object({ password: z.string(), confirm: z.string() })
173
173
  .refine((data) => data.confirm === data.password, { path: ["confirm"] })
174
174
  .safeParse({ password: "asdf", confirm: "qewr" });
@@ -252,6 +252,79 @@ describe("superRefine functionality", () => {
252
252
  await expect(Strings.parseAsync(validArray)).resolves.toEqual(validArray);
253
253
  });
254
254
 
255
+ test("should test continuability of custom issues", () => {
256
+ // Default continue behavior - allows subsequent refinements
257
+ const defaultContinue = z
258
+ .string()
259
+ .superRefine((_, ctx) => {
260
+ ctx.addIssue({ code: "custom", message: "First issue" });
261
+ })
262
+ .refine(() => false, "Second issue");
263
+
264
+ expect(defaultContinue.safeParse("test")).toMatchInlineSnapshot(`
265
+ {
266
+ "error": [ZodError: [
267
+ {
268
+ "code": "custom",
269
+ "message": "First issue",
270
+ "path": []
271
+ },
272
+ {
273
+ "code": "custom",
274
+ "path": [],
275
+ "message": "Second issue"
276
+ }
277
+ ]],
278
+ "success": false,
279
+ }
280
+ `);
281
+
282
+ // Explicit continue: false - prevents subsequent refinements
283
+ const explicitContinueFalse = z
284
+ .string()
285
+ .superRefine((_, ctx) => {
286
+ ctx.addIssue({ code: "custom", message: "First issue", continue: false });
287
+ })
288
+ .refine(() => false, "Second issue");
289
+
290
+ expect(explicitContinueFalse.safeParse("test")).toMatchInlineSnapshot(`
291
+ {
292
+ "error": [ZodError: [
293
+ {
294
+ "code": "custom",
295
+ "message": "First issue",
296
+ "path": []
297
+ }
298
+ ]],
299
+ "success": false,
300
+ }
301
+ `);
302
+
303
+ // Multiple issues in same refinement - both always added regardless of continue
304
+ const multipleInSame = z.string().superRefine((_, ctx) => {
305
+ ctx.addIssue({ code: "custom", message: "First", continue: false });
306
+ ctx.addIssue({ code: "custom", message: "Second" });
307
+ });
308
+
309
+ expect(multipleInSame.safeParse("test")).toMatchInlineSnapshot(`
310
+ {
311
+ "error": [ZodError: [
312
+ {
313
+ "code": "custom",
314
+ "message": "First",
315
+ "path": []
316
+ },
317
+ {
318
+ "code": "custom",
319
+ "message": "Second",
320
+ "path": []
321
+ }
322
+ ]],
323
+ "success": false,
324
+ }
325
+ `);
326
+ });
327
+
255
328
  test("should accept string as shorthand for custom error message", () => {
256
329
  const schema = z.string().superRefine((_, ctx) => {
257
330
  ctx.addIssue("bad stuff");
@@ -431,9 +504,9 @@ test("when", () => {
431
504
  })
432
505
  .refine(
433
506
  (data) => {
434
- console.log("running check...");
435
- console.log(data);
436
- console.log(data.password);
507
+ // console.log("running check...");
508
+ // console.log(data);
509
+ // console.log(data.password);
437
510
  return data.password === data.confirmPassword;
438
511
  },
439
512
  {
@@ -39,7 +39,7 @@ test("valid parse async", async () => {
39
39
  expect(result.data!.has("second")).toEqual(true);
40
40
  expect(result.data!.has("third")).toEqual(false);
41
41
 
42
- const asyncResult = await stringSet.safeParse(new Set(["first", "second"]));
42
+ const asyncResult = stringSet.safeParse(new Set(["first", "second"]));
43
43
  expect(asyncResult.success).toEqual(true);
44
44
  expect(asyncResult.data!.has("first")).toEqual(true);
45
45
  expect(asyncResult.data!.has("second")).toEqual(true);
@@ -155,7 +155,8 @@ test("min/max", async () => {
155
155
  [
156
156
  {
157
157
  "code": "too_small",
158
- "message": "Too small: expected set to have >4 items",
158
+ "inclusive": true,
159
+ "message": "Too small: expected set to have >=4 items",
159
160
  "minimum": 4,
160
161
  "origin": "set",
161
162
  "path": [],
@@ -169,8 +170,9 @@ test("min/max", async () => {
169
170
  [
170
171
  {
171
172
  "code": "too_big",
173
+ "inclusive": true,
172
174
  "maximum": 5,
173
- "message": "Too big: expected set to have <5 items",
175
+ "message": "Too big: expected set to have <=5 items",
174
176
  "origin": "set",
175
177
  "path": [],
176
178
  },
@@ -107,3 +107,19 @@ test("z.stringFormat", () => {
107
107
  `/\\^\\(\\?:\\\\d\\{14,19\\}\\|\\\\d\\{4\\}\\(\\?: \\\\d\\{3,6\\}\\)\\{2,4\\}\\|\\\\d\\{4\\}\\(\\?:-\\\\d\\{3,6\\}\\)\\{2,4\\}\\)\\$/u`
108
108
  );
109
109
  });
110
+
111
+ test("z.hex", () => {
112
+ const hexSchema = z.hex();
113
+
114
+ // Valid hex strings
115
+ expect(hexSchema.safeParse("").success).toBe(true); // Empty string is valid hex
116
+ expect(hexSchema.safeParse("123abc").success).toBe(true);
117
+ expect(hexSchema.safeParse("DEADBEEF").success).toBe(true);
118
+ expect(hexSchema.safeParse("0123456789abcdefABCDEF").success).toBe(true);
119
+
120
+ // Invalid hex strings
121
+ expect(hexSchema.safeParse("xyz").success).toBe(false);
122
+ expect(hexSchema.safeParse("123g").success).toBe(false);
123
+ expect(hexSchema.safeParse("hello world").success).toBe(false);
124
+ expect(hexSchema.safeParse("123-abc").success).toBe(false);
125
+ });
@@ -318,6 +318,83 @@ test("url validations", () => {
318
318
  expect(() => url.parse("https://")).toThrow();
319
319
  });
320
320
 
321
+ test("url preserves original input", () => {
322
+ const url = z.string().url();
323
+
324
+ // Test the specific case from the user report
325
+ const input = "https://example.com?key=NUXOmHqWNVTapJkJJHw8BfD155AuqhH_qju_5fNmQ4ZHV7u8";
326
+ const output = url.parse(input);
327
+ expect(output).toBe(input); // Should preserve the original input exactly
328
+
329
+ // Test other cases where URL constructor would normalize
330
+ expect(url.parse("https://example.com?foo=bar")).toBe("https://example.com?foo=bar");
331
+ expect(url.parse("http://example.com?test=123")).toBe("http://example.com?test=123");
332
+ expect(url.parse("https://sub.example.com?param=value&other=data")).toBe(
333
+ "https://sub.example.com?param=value&other=data"
334
+ );
335
+
336
+ // Test cases with trailing slashes are preserved
337
+ expect(url.parse("https://example.com/")).toBe("https://example.com/");
338
+ expect(url.parse("https://example.com/path/")).toBe("https://example.com/path/");
339
+
340
+ // Test cases with paths and query parameters
341
+ expect(url.parse("https://example.com/path?query=param")).toBe("https://example.com/path?query=param");
342
+ });
343
+
344
+ test("url trims whitespace", () => {
345
+ const url = z.string().url();
346
+
347
+ // Test trimming whitespace from URLs
348
+ expect(url.parse(" https://example.com ")).toBe("https://example.com");
349
+ expect(url.parse(" https://example.com/path?query=param ")).toBe("https://example.com/path?query=param");
350
+ expect(url.parse("\t\nhttps://example.com\t\n")).toBe("https://example.com");
351
+ expect(url.parse(" https://example.com?key=value ")).toBe("https://example.com?key=value");
352
+
353
+ // Test that URLs without extra whitespace are unchanged
354
+ expect(url.parse("https://example.com")).toBe("https://example.com");
355
+ expect(url.parse("https://example.com/path")).toBe("https://example.com/path");
356
+ });
357
+
358
+ test("url normalize flag", () => {
359
+ const normalizeUrl = z.url({ normalize: true });
360
+ const preserveUrl = z.url(); // normalize: false/undefined by default
361
+
362
+ // Test that normalize flag causes URL normalization
363
+ expect(normalizeUrl.parse("https://example.com?key=value")).toBe("https://example.com/?key=value");
364
+ expect(normalizeUrl.parse("http://example.com?test=123")).toBe("http://example.com/?test=123");
365
+
366
+ // Test with already normalized URLs
367
+ expect(normalizeUrl.parse("https://example.com/")).toBe("https://example.com/");
368
+ expect(normalizeUrl.parse("https://example.com/path?query=param")).toBe("https://example.com/path?query=param");
369
+
370
+ // Test complex URLs with normalization
371
+ expect(normalizeUrl.parse("https://example.com/../?key=value")).toBe("https://example.com/?key=value");
372
+ expect(normalizeUrl.parse("https://example.com/./path?key=value")).toBe("https://example.com/path?key=value");
373
+
374
+ // Compare with non-normalize behavior
375
+ expect(preserveUrl.parse("https://example.com?key=value")).toBe("https://example.com?key=value");
376
+ expect(preserveUrl.parse("http://example.com?test=123")).toBe("http://example.com?test=123");
377
+
378
+ // Test trimming with normalize
379
+ expect(normalizeUrl.parse(" https://example.com?key=value ")).toBe("https://example.com/?key=value");
380
+ expect(preserveUrl.parse(" https://example.com?key=value ")).toBe("https://example.com?key=value");
381
+ });
382
+
383
+ test("url normalize with hostname and protocol constraints", () => {
384
+ const constrainedNormalizeUrl = z.url({
385
+ normalize: true,
386
+ protocol: /^https$/,
387
+ hostname: /^example\.com$/,
388
+ });
389
+
390
+ // Test that normalization works with constraints
391
+ expect(constrainedNormalizeUrl.parse("https://example.com?key=value")).toBe("https://example.com/?key=value");
392
+
393
+ // Test that constraints are still enforced
394
+ expect(() => constrainedNormalizeUrl.parse("http://example.com?key=value")).toThrow();
395
+ expect(() => constrainedNormalizeUrl.parse("https://other.com?key=value")).toThrow();
396
+ });
397
+
321
398
  test("httpurl", () => {
322
399
  const httpUrl = z.url({
323
400
  protocol: /^https?$/,
@@ -450,6 +527,7 @@ test("good uuid", () => {
450
527
  "9491d710-3185-5e06-8ea0-6a2f275345e0",
451
528
  "9491d710-3185-5e06-9ea0-6a2f275345e0",
452
529
  "00000000-0000-0000-0000-000000000000",
530
+ "ffffffff-ffff-ffff-ffff-ffffffffffff",
453
531
  ];
454
532
 
455
533
  for (const goodUuid of goodUuids) {
@@ -464,11 +542,10 @@ test(`bad uuid`, () => {
464
542
  "9491d710-3185-0e06-bea0-6a2f275345e0",
465
543
  "9491d710-3185-5e06-0ea0-6a2f275345e0",
466
544
  "d89e7b01-7598-ed11-9d7a-0022489382fd", // new sequential id
467
- "b3ce60f8-e8b9-40f5-1150-172ede56ff74", // Variant 0 - RFC 4122: Reserved, NCS backward compatibility
468
- "92e76bf9-28b3-4730-cd7f-cb6bc51f8c09", // Variant 2 - RFC 4122: Reserved, Microsoft Corporation backward compatibility
545
+ "b3ce60f8-e8b9-40f5-1150-172ede56ff74", // Variant 0 - RFC 9562/4122: Reserved, NCS backward compatibility
546
+ "92e76bf9-28b3-4730-cd7f-cb6bc51f8c09", // Variant 2 - RFC 9562/4122: Reserved, Microsoft Corporation backward compatibility
469
547
  "invalid uuid",
470
548
  "9491d710-3185-4e06-bea0-6a2f275345e0X",
471
- "ffffffff-ffff-ffff-ffff-ffffffffffff",
472
549
  ]) {
473
550
  const result = uuid.safeParse(badUuid);
474
551
  expect(result).toMatchObject({ success: false });
@@ -481,8 +558,8 @@ test("good guid", () => {
481
558
  for (const goodGuid of [
482
559
  "9491d710-3185-4e06-bea0-6a2f275345e0",
483
560
  "d89e7b01-7598-ed11-9d7a-0022489382fd", // new sequential id
484
- "b3ce60f8-e8b9-40f5-1150-172ede56ff74", // Variant 0 - RFC 4122: Reserved, NCS backward compatibility
485
- "92e76bf9-28b3-4730-cd7f-cb6bc51f8c09", // Variant 2 - RFC 4122: Reserved, Microsoft Corporation backward compatibility
561
+ "b3ce60f8-e8b9-40f5-1150-172ede56ff74", // Variant 0 - RFC 9562/4122: Reserved, NCS backward compatibility
562
+ "92e76bf9-28b3-4730-cd7f-cb6bc51f8c09", // Variant 2 - RFC 9562/4122: Reserved, Microsoft Corporation backward compatibility
486
563
  "00000000-0000-0000-0000-000000000000",
487
564
  "ffffffff-ffff-ffff-ffff-ffffffffffff",
488
565
  ]) {
@@ -842,6 +919,9 @@ test("CIDR v6 validation", () => {
842
919
  expect(cidrV6.safeParse("2001:db8::/abc").success).toBe(false); // Invalid prefix format
843
920
  expect(cidrV6.safeParse("not a cidr").success).toBe(false); // Invalid format
844
921
  expect(cidrV6.safeParse("192.168.0.0/24").success).toBe(false); // IPv4 CIDR in v6 validation
922
+ expect(cidrV6.safeParse("2001:0db8:85a3::/64/whatever-after").success).toBe(false);
923
+ expect(cidrV6.safeParse("22d9:f4a8:6a90:f3bf:dcaa:2beb:5fba:0000/112").success).toBe(true);
924
+ expect(cidrV6.safeParse("22d9:f4a8:6a90:f3bf:dcaa:2beb:5fba:0000/112/268").success).toBe(false);
845
925
  });
846
926
 
847
927
  test("E.164 validation", () => {
@@ -879,3 +959,122 @@ test("E.164 validation", () => {
879
959
  expect(validE164Numbers.every((number) => e164Number.safeParse(number).success)).toBe(true);
880
960
  expect(invalidE164Numbers.every((number) => e164Number.safeParse(number).success === false)).toBe(true);
881
961
  });
962
+
963
+ test("hostname", () => {
964
+ const hostname = z.hostname();
965
+
966
+ // Valid hostnames
967
+ hostname.parse("localhost");
968
+ hostname.parse("example.com");
969
+ hostname.parse("sub.example.com");
970
+ hostname.parse("a-b-c.example.com");
971
+ hostname.parse("123.example.com");
972
+ hostname.parse("example-123.com");
973
+ hostname.parse("example-123.1234");
974
+ hostname.parse("developer.mozilla.org");
975
+ hostname.parse("hello.world.example.com");
976
+ hostname.parse("www.google.com");
977
+ hostname.parse("192.168.1.1");
978
+ hostname.parse("xn--d1acj3b.com");
979
+ hostname.parse("xn--d1acj3b.org");
980
+ hostname.parse("xn--d1acj3b");
981
+
982
+ // Invalid hostnames
983
+ expect(() => hostname.parse("")).toThrow();
984
+ expect(() => hostname.parse("example..com")).toThrow();
985
+ expect(() => hostname.parse("example-.com")).toThrow();
986
+ expect(() => hostname.parse("-example.com")).toThrow();
987
+ expect(() => hostname.parse("example.com-")).toThrow();
988
+ expect(() => hostname.parse("example_com")).toThrow();
989
+ expect(() => hostname.parse("example.com:8080")).toThrow();
990
+ expect(() => hostname.parse("http://example.com")).toThrow();
991
+ expect(() => hostname.parse("ht!tp://invalid.com")).toThrow();
992
+
993
+ expect(() => hostname.parse("xn--d1acj3b..com")).toThrow();
994
+ expect(() => hostname.parse("ex@mple.com")).toThrow();
995
+ expect(() => hostname.parse("[2001:db8::zzzz]")).toThrow();
996
+ expect(() => hostname.parse("exa mple.com")).toThrow();
997
+ expect(() => hostname.parse("-example.com")).toThrow();
998
+ expect(() => hostname.parse("example..com")).toThrow();
999
+ });
1000
+
1001
+ test("hash validation", () => {
1002
+ // MD5 tests
1003
+ const md5hex = z.hash("md5");
1004
+ const md5base64 = z.hash("md5", { enc: "base64" });
1005
+ const md5base64url = z.hash("md5", { enc: "base64url" });
1006
+
1007
+ // Valid MD5 hashes
1008
+ expect(md5hex.parse("5d41402abc4b2a76b9719d911017c592")).toBe("5d41402abc4b2a76b9719d911017c592");
1009
+ expect(md5hex.parse("5D41402ABC4B2A76B9719D911017C592")).toBe("5D41402ABC4B2A76B9719D911017C592"); // uppercase
1010
+ expect(md5base64.parse("XUFAKrxLKna5cZ2REBfFkg==")).toBe("XUFAKrxLKna5cZ2REBfFkg==");
1011
+ expect(md5base64url.parse("XUFAKrxLKna5cZ2REBfFkg")).toBe("XUFAKrxLKna5cZ2REBfFkg");
1012
+
1013
+ // Invalid MD5 hashes
1014
+ expect(() => md5hex.parse("5d41402abc4b2a76b9719d911017c59")).toThrow(); // too short
1015
+ expect(() => md5hex.parse("5d41402abc4b2a76b9719d911017c592x")).toThrow(); // too long
1016
+ expect(() => md5base64.parse("XUFAKrxLKna5cZ2REBfFkg=")).toThrow(); // wrong padding
1017
+ expect(() => md5base64url.parse("XUFAKrxLKna5cZ2REBfFkg=")).toThrow(); // has padding
1018
+
1019
+ // SHA1 tests
1020
+ const sha1hex = z.hash("sha1");
1021
+ const sha1base64 = z.hash("sha1", { enc: "base64" });
1022
+ const sha1base64url = z.hash("sha1", { enc: "base64url" });
1023
+
1024
+ // Valid SHA1 hashes
1025
+ expect(sha1hex.parse("aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d")).toBe("aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d");
1026
+ expect(sha1base64.parse("qvTGHdzF6KLavt4PO0gs2a6pQ00=")).toBe("qvTGHdzF6KLavt4PO0gs2a6pQ00=");
1027
+ expect(sha1base64url.parse("qvTGHdzF6KLavt4PO0gs2a6pQ00")).toBe("qvTGHdzF6KLavt4PO0gs2a6pQ00");
1028
+
1029
+ // SHA256 tests
1030
+ const sha256hex = z.hash("sha256");
1031
+ const sha256base64 = z.hash("sha256", { enc: "base64" });
1032
+ const sha256base64url = z.hash("sha256", { enc: "base64url" });
1033
+
1034
+ // Valid SHA256 hashes
1035
+ expect(sha256hex.parse("2cf24dba4f21d4288094c4a2e2c2d6c6b0c3e0c8f0e0c8f0e0c8f0e0c8f0e0c8")).toBe(
1036
+ "2cf24dba4f21d4288094c4a2e2c2d6c6b0c3e0c8f0e0c8f0e0c8f0e0c8f0e0c8"
1037
+ );
1038
+ expect(sha256base64.parse("LPJNul+wow4m6DsqxbninhsWHlwfp0JecwQzYpOLmCQ=")).toBe(
1039
+ "LPJNul+wow4m6DsqxbninhsWHlwfp0JecwQzYpOLmCQ="
1040
+ );
1041
+ expect(sha256base64url.parse("LPJNul-wow4m6DsqxbninhsWHlwfp0JecwQzYpOLmCQ")).toBe(
1042
+ "LPJNul-wow4m6DsqxbninhsWHlwfp0JecwQzYpOLmCQ"
1043
+ );
1044
+
1045
+ // SHA384 tests (no padding in base64)
1046
+ const sha384hex = z.hash("sha384");
1047
+ const sha384base64 = z.hash("sha384", { enc: "base64" });
1048
+
1049
+ expect(
1050
+ sha384hex.parse("59e1748777448c69de6b800d7a33bbfb9ff1b463e44354c3553bcdb9c666fa90125a3c79f90397bdf5f6a13de828684f")
1051
+ ).toBe("59e1748777448c69de6b800d7a33bbfb9ff1b463e44354c3553bcdb9c666fa90125a3c79f90397bdf5f6a13de828684f");
1052
+ expect(sha384base64.parse("WeF0h3dEjGneawDXozO7+5/xtGPkQ1TDVTvNucZm+pASWjx5+QOXvfX2oT3oKGhP")).toBe(
1053
+ "WeF0h3dEjGneawDXozO7+5/xtGPkQ1TDVTvNucZm+pASWjx5+QOXvfX2oT3oKGhP"
1054
+ );
1055
+
1056
+ // SHA512 tests
1057
+ const sha512hex = z.hash("sha512");
1058
+ const sha512base64 = z.hash("sha512", { enc: "base64" });
1059
+
1060
+ expect(
1061
+ sha512hex.parse(
1062
+ "9b71d224bd62f3785d96d46ad3ea3d73319bfbc2890caadae2dff72519673ca72323c3d99ba5c11d7c7acc6e14b8c5da0c4663475c2e5c3adef46f73bcdec043"
1063
+ )
1064
+ ).toBe(
1065
+ "9b71d224bd62f3785d96d46ad3ea3d73319bfbc2890caadae2dff72519673ca72323c3d99ba5c11d7c7acc6e14b8c5da0c4663475c2e5c3adef46f73bcdec043"
1066
+ );
1067
+ expect(
1068
+ sha512base64.parse("m3HSJL1i83hdltRq0+o9czGb+8KJDKra4t/3JRlnPKcjI8PZm6XBHXx6zG4UuMXaDEZjR1wuXDre9G9zvN7AQw==")
1069
+ ).toBe("m3HSJL1i83hdltRq0+o9czGb+8KJDKra4t/3JRlnPKcjI8PZm6XBHXx6zG4UuMXaDEZjR1wuXDre9G9zvN7AQw==");
1070
+
1071
+ // Test default encoding (hex)
1072
+ const defaultHash = z.hash("sha256");
1073
+ expect(defaultHash.parse("2cf24dba4f21d4288094c4a2e2c2d6c6b0c3e0c8f0e0c8f0e0c8f0e0c8f0e0c8")).toBe(
1074
+ "2cf24dba4f21d4288094c4a2e2c2d6c6b0c3e0c8f0e0c8f0e0c8f0e0c8f0e0c8"
1075
+ );
1076
+
1077
+ // Test with custom error message
1078
+ const hashWithMessage = z.hash("md5", { message: "Invalid MD5 hash" });
1079
+ expect(() => hashWithMessage.parse("invalid")).toThrow("Invalid MD5 hash");
1080
+ });
@@ -64,3 +64,43 @@ test("z.stringbool with custom error messages", () => {
64
64
 
65
65
  expect(() => a.parse("")).toThrowError("wrong!");
66
66
  });
67
+
68
+ test("z.stringbool codec encoding", () => {
69
+ const schema = z.stringbool();
70
+
71
+ // Test encoding with default values
72
+ expect(z.encode(schema, true)).toEqual("true");
73
+ expect(z.encode(schema, false)).toEqual("false");
74
+ });
75
+
76
+ test("z.stringbool codec encoding with custom values", () => {
77
+ const schema = z.stringbool({
78
+ truthy: ["yes", "on", "1"],
79
+ falsy: ["no", "off", "0"],
80
+ });
81
+
82
+ // Should return first element of custom arrays
83
+ expect(z.encode(schema, true)).toEqual("yes");
84
+ expect(z.encode(schema, false)).toEqual("no");
85
+ });
86
+
87
+ test("z.stringbool codec round trip", () => {
88
+ const schema = z.stringbool({
89
+ truthy: ["enabled", "active"],
90
+ falsy: ["disabled", "inactive"],
91
+ });
92
+
93
+ // Test round trip: string -> boolean -> string
94
+ const decoded = z.decode(schema, "enabled");
95
+ expect(decoded).toEqual(true);
96
+
97
+ const encoded = z.encode(schema, decoded);
98
+ expect(encoded).toEqual("enabled"); // First element of truthy array
99
+
100
+ // Test with falsy value
101
+ const decodedFalse = z.decode(schema, "inactive");
102
+ expect(decodedFalse).toEqual(false);
103
+
104
+ const encodedFalse = z.encode(schema, decodedFalse);
105
+ expect(encodedFalse).toEqual("disabled"); // First element of falsy array
106
+ });
@@ -6,6 +6,7 @@ const hello = z.templateLiteral(["hello"]);
6
6
  const world = z.templateLiteral(["", z.literal("world")]);
7
7
  const one = z.templateLiteral([1]);
8
8
  const two = z.templateLiteral(["", z.literal(2)]);
9
+ const onePointOne = z.templateLiteral([z.literal(1.1)]);
9
10
  const truee = z.templateLiteral([true]);
10
11
  const anotherTrue = z.templateLiteral(["", z.literal(true)]);
11
12
  const falsee = z.templateLiteral([false]);
@@ -289,6 +290,7 @@ test("template literal parsing - success - basic cases", () => {
289
290
  world.parse("world");
290
291
  one.parse("1");
291
292
  two.parse("2");
293
+ onePointOne.parse("1.1");
292
294
  truee.parse("true");
293
295
  anotherTrue.parse("true");
294
296
  falsee.parse("false");
@@ -381,6 +383,7 @@ test("template literal parsing - failure - basic cases", () => {
381
383
  expect(() => one.parse("2")).toThrow();
382
384
  expect(() => one.parse("12")).toThrow();
383
385
  expect(() => one.parse("21")).toThrow();
386
+ expect(() => onePointOne.parse("1s1")).toThrow();
384
387
  expect(() => two.parse("1")).toThrow();
385
388
  expect(() => two.parse("21")).toThrow();
386
389
  expect(() => two.parse("12")).toThrow();
@@ -531,15 +534,15 @@ test("regexes", () => {
531
534
  expect(anyString._zod.pattern.source).toMatchInlineSnapshot(`"^[\\s\\S]{0,}$"`);
532
535
  expect(lazyString._zod.pattern.source).toMatchInlineSnapshot(`"^[\\s\\S]{0,}$"`);
533
536
  expect(anyNumber._zod.pattern.source).toMatchInlineSnapshot(`"^-?\\d+(?:\\.\\d+)?$"`);
534
- expect(anyInt._zod.pattern.source).toMatchInlineSnapshot(`"^\\d+$"`);
537
+ expect(anyInt._zod.pattern.source).toMatchInlineSnapshot(`"^-?\\d+$"`);
535
538
  // expect(anyFiniteNumber._zod.pattern.source).toMatchInlineSnapshot(`"^-?\\d+(?:\\.\\d+)?$"`);
536
539
  // expect(anyNegativeNumber._zod.pattern.source).toMatchInlineSnapshot(`"^-?\\d+(?:\\.\\d+)?$"`);
537
540
  // expect(anyPositiveNumber._zod.pattern.source).toMatchInlineSnapshot(`"^-?\\d+(?:\\.\\d+)?$"`);
538
541
  // expect(zeroButInADumbWay._zod.pattern.source).toMatchInlineSnapshot(`"^-?\\d+(?:\\.\\d+)?$"`);
539
542
  // expect(finiteButInADumbWay._zod.pattern.source).toMatchInlineSnapshot(`"^-?\\d+(?:\\.\\d+)?$"`);
540
- expect(bool._zod.pattern.source).toMatchInlineSnapshot(`"^true|false$"`);
543
+ expect(bool._zod.pattern.source).toMatchInlineSnapshot(`"^(?:true|false)$"`);
541
544
  expect(bigone._zod.pattern.source).toMatchInlineSnapshot(`"^(1)$"`);
542
- expect(anyBigint._zod.pattern.source).toMatchInlineSnapshot(`"^\\d+n?$"`);
545
+ expect(anyBigint._zod.pattern.source).toMatchInlineSnapshot(`"^-?\\d+n?$"`);
543
546
  expect(nullableYo._zod.pattern.source).toMatchInlineSnapshot(`"^((yo)|null)$"`);
544
547
  expect(nullableString._zod.pattern.source).toMatchInlineSnapshot(`"^([\\s\\S]{0,}|null)$"`);
545
548
  expect(optionalYeah._zod.pattern.source).toMatchInlineSnapshot(`"^((yeah))?$"`);
@@ -563,11 +566,11 @@ test("regexes", () => {
563
566
  `"^(?:(?: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])$"`
564
567
  );
565
568
  expect(ipv6._zod.pattern.source).toMatchInlineSnapshot(
566
- `"^(([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})$"`
569
+ `"^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$"`
567
570
  );
568
571
  expect(ulid._zod.pattern.source).toMatchInlineSnapshot(`"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"`);
569
572
  expect(uuid._zod.pattern.source).toMatchInlineSnapshot(
570
- `"^([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)$"`
573
+ `"^([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|ffffffff-ffff-ffff-ffff-ffffffffffff)$"`
571
574
  );
572
575
  expect(stringAToZ._zod.pattern.source).toMatchInlineSnapshot(`"^[a-z]+$"`);
573
576
  expect(stringStartsWith._zod.pattern.source).toMatchInlineSnapshot(`"^hello.*$"`);
@@ -580,7 +583,7 @@ test("regexes", () => {
580
583
  expect(url._zod.pattern.source).toMatchInlineSnapshot(`"^https:\\/\\/\\w+\\.(com|net)$"`);
581
584
  expect(measurement._zod.pattern.source).toMatchInlineSnapshot(`"^-?\\d+(?:\\.\\d+)?((px|em|rem|vh|vw|vmin|vmax))?$"`);
582
585
  expect(connectionString._zod.pattern.source).toMatchInlineSnapshot(
583
- `"^mongodb:\\/\\/(\\w+:\\w+@)?\\w+:\\d+(\\/(\\w+)?(\\?(\\w+=\\w+(&\\w+=\\w+)*)?)?)?$"`
586
+ `"^mongodb:\\/\\/(\\w+:\\w+@)?\\w+:-?\\d+(\\/(\\w+)?(\\?(\\w+=\\w+(&\\w+=\\w+)*)?)?)?$"`
584
587
  );
585
588
  });
586
589
 
@@ -670,8 +673,10 @@ test("template literal parsing - failure - complex cases", () => {
670
673
  expect(() => connectionString.parse("mongodb://host1234")).toThrow();
671
674
  expect(() => connectionString.parse("mongodb://host:d234")).toThrow();
672
675
  expect(() => connectionString.parse("mongodb://host:12.34")).toThrow();
673
- expect(() => connectionString.parse("mongodb://host:-1234")).toThrow();
674
- expect(() => connectionString.parse("mongodb://host:-12.34")).toThrow();
676
+ // Note: template literal regex currently allows negative numbers despite .positive() constraint
677
+ // This is a known limitation where template literals use regex patterns directly
678
+ // expect(() => connectionString.parse("mongodb://host:-1234")).toThrow();
679
+ // expect(() => connectionString.parse("mongodb://host:-12.34")).toThrow();
675
680
  expect(() => connectionString.parse("mongodb://host:")).toThrow();
676
681
  expect(() => connectionString.parse("mongodb://:password@host:1234")).toThrow();
677
682
  expect(() => connectionString.parse("mongodb://usernamepassword@host:1234")).toThrow();
@@ -732,7 +737,7 @@ test("template literal parsing - failure - issue format", () => {
732
737
  {
733
738
  "code": "invalid_format",
734
739
  "format": "template_literal",
735
- "pattern": "^mongodb:\\\\/\\\\/(\\\\w+:\\\\w+@)?\\\\w+:\\\\d+(\\\\/(\\\\w+)?(\\\\?(\\\\w+=\\\\w+(&\\\\w+=\\\\w+)*)?)?)?$",
740
+ "pattern": "^mongodb:\\\\/\\\\/(\\\\w+:\\\\w+@)?\\\\w+:-?\\\\d+(\\\\/(\\\\w+)?(\\\\?(\\\\w+=\\\\w+(&\\\\w+=\\\\w+)*)?)?)?$",
736
741
  "path": [],
737
742
  "message": "Invalid input"
738
743
  }