@oxog/vld 2.0.2 → 2.1.0

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 (450) hide show
  1. package/CHANGELOG.md +75 -1
  2. package/LICENSE +20 -20
  3. package/README.md +101 -37
  4. package/dist/chunks/errors-core-BeiFUtZM.js +81 -0
  5. package/dist/chunks/{index-CETyGkrv.js → index-0R2ntSud.js} +16 -402
  6. package/dist/chunks/index-BvH403Yy.js +88 -0
  7. package/dist/chunks/security-B0Pd_vSY.js +35 -0
  8. package/dist/chunks/string-BJRQod3t.js +530 -0
  9. package/dist/cjs/chunks/errors-core-DWxLFs2f.cjs +83 -0
  10. package/dist/cjs/chunks/index-BkI37108.cjs +538 -0
  11. package/dist/cjs/chunks/index-Cc3bjUMX.cjs +91 -0
  12. package/dist/cjs/chunks/security-Dc3Jh13T.cjs +37 -0
  13. package/dist/cjs/chunks/string-BKZrc4hs.cjs +533 -0
  14. package/dist/cjs/cli/bin.cjs +506 -0
  15. package/dist/cjs/cli/index.cjs +209 -0
  16. package/dist/cjs/codecs/index.cjs +45 -0
  17. package/dist/{chunks/date-ODue_rtq.js → cjs/coercion/index.cjs} +185 -103
  18. package/dist/cjs/compat/emitter.cjs +184 -0
  19. package/dist/cjs/compat/result.cjs +189 -0
  20. package/dist/cjs/errors.cjs +6 -213
  21. package/dist/cjs/index.cjs +1558 -9647
  22. package/dist/cjs/kernel.cjs +415 -0
  23. package/dist/cjs/locales/af.cjs +108 -0
  24. package/dist/cjs/locales/ar.cjs +108 -0
  25. package/dist/cjs/locales/bn.cjs +108 -0
  26. package/dist/cjs/locales/da.cjs +108 -0
  27. package/dist/cjs/locales/de.cjs +108 -0
  28. package/dist/cjs/locales/en.cjs +108 -0
  29. package/dist/cjs/locales/es-MX.cjs +107 -0
  30. package/dist/cjs/locales/es.cjs +96 -0
  31. package/dist/cjs/locales/fi.cjs +108 -0
  32. package/dist/cjs/locales/fr.cjs +96 -0
  33. package/dist/cjs/locales/hi.cjs +108 -0
  34. package/dist/cjs/locales/id.cjs +108 -0
  35. package/dist/cjs/locales/index.cjs +41 -2875
  36. package/dist/cjs/locales/it.cjs +108 -0
  37. package/dist/cjs/locales/ja.cjs +108 -0
  38. package/dist/cjs/locales/ko.cjs +108 -0
  39. package/dist/cjs/locales/lazy.cjs +42 -3023
  40. package/dist/cjs/locales/nl.cjs +108 -0
  41. package/dist/cjs/locales/no.cjs +108 -0
  42. package/dist/cjs/locales/pl.cjs +108 -0
  43. package/dist/cjs/locales/pt-BR.cjs +108 -0
  44. package/dist/cjs/locales/pt.cjs +108 -0
  45. package/dist/cjs/locales/ru.cjs +108 -0
  46. package/dist/cjs/locales/runtime.cjs +51 -0
  47. package/dist/cjs/locales/sv.cjs +108 -0
  48. package/dist/cjs/locales/sw.cjs +108 -0
  49. package/dist/cjs/locales/th.cjs +108 -0
  50. package/dist/cjs/locales/tr.cjs +108 -0
  51. package/dist/cjs/locales/vi.cjs +108 -0
  52. package/dist/cjs/locales/zh.cjs +108 -0
  53. package/dist/cjs/mini.cjs +121 -7208
  54. package/dist/cjs/pigment.cjs +207 -0
  55. package/dist/cjs/plugins/index.cjs +12 -0
  56. package/dist/cjs/registry.cjs +37 -0
  57. package/dist/cjs/v3/index.cjs +425 -0
  58. package/dist/cjs/v4/core/index.cjs +894 -0
  59. package/dist/cjs/v4/index.cjs +425 -0
  60. package/dist/cjs/v4/locales/index.cjs +130 -0
  61. package/dist/cjs/v4/mini/index.cjs +509 -0
  62. package/dist/cjs/v4-mini/index.cjs +532 -0
  63. package/dist/cjs/validators/any.cjs +40 -0
  64. package/dist/cjs/validators/array.cjs +283 -0
  65. package/dist/cjs/validators/base.cjs +887 -0
  66. package/dist/cjs/validators/base64.cjs +73 -0
  67. package/dist/cjs/validators/bigint.cjs +232 -0
  68. package/dist/cjs/validators/boolean.cjs +146 -0
  69. package/dist/cjs/validators/codec.cjs +205 -0
  70. package/dist/cjs/validators/custom.cjs +71 -0
  71. package/dist/cjs/validators/date.cjs +278 -0
  72. package/dist/cjs/validators/discriminated-union.cjs +130 -0
  73. package/dist/cjs/validators/enum.cjs +154 -0
  74. package/dist/cjs/validators/file.cjs +130 -0
  75. package/dist/cjs/validators/function.cjs +63 -0
  76. package/dist/cjs/validators/hex.cjs +70 -0
  77. package/dist/cjs/validators/index.cjs +123 -0
  78. package/dist/cjs/validators/intersection.cjs +120 -0
  79. package/dist/cjs/validators/json.cjs +70 -0
  80. package/dist/cjs/validators/lazy.cjs +53 -0
  81. package/dist/cjs/validators/literal.cjs +64 -0
  82. package/dist/cjs/validators/map.cjs +218 -0
  83. package/dist/cjs/validators/nan.cjs +41 -0
  84. package/dist/cjs/validators/never.cjs +36 -0
  85. package/dist/cjs/validators/null.cjs +43 -0
  86. package/dist/cjs/validators/number.cjs +427 -0
  87. package/dist/cjs/validators/object.cjs +868 -0
  88. package/dist/cjs/validators/promise.cjs +115 -0
  89. package/dist/cjs/validators/record.cjs +262 -0
  90. package/dist/cjs/validators/set.cjs +203 -0
  91. package/dist/cjs/validators/string-bool.cjs +124 -0
  92. package/dist/cjs/validators/string-formats.cjs +168 -0
  93. package/dist/cjs/validators/string.cjs +12 -0
  94. package/dist/cjs/validators/symbol.cjs +62 -0
  95. package/dist/cjs/validators/template-literal.cjs +108 -0
  96. package/dist/cjs/validators/tuple.cjs +187 -0
  97. package/dist/cjs/validators/uint8array.cjs +106 -0
  98. package/dist/cjs/validators/undefined.cjs +43 -0
  99. package/dist/cjs/validators/union.cjs +191 -0
  100. package/dist/cjs/validators/unknown.cjs +40 -0
  101. package/dist/cjs/validators/void.cjs +48 -0
  102. package/dist/cjs/validators/xor.cjs +69 -0
  103. package/dist/cli/bin.d.ts +0 -1
  104. package/dist/cli/bin.js +407 -0
  105. package/dist/cli/commands/benchmark.d.ts +1 -2
  106. package/dist/cli/commands/validate.d.ts +1 -2
  107. package/dist/cli/index.d.ts +0 -1
  108. package/dist/cli/index.js +205 -0
  109. package/dist/codecs/index.d.ts +21 -4
  110. package/dist/codecs/index.js +11 -4
  111. package/dist/coercion/bigint.d.ts +2 -3
  112. package/dist/coercion/boolean.d.ts +3 -3
  113. package/dist/coercion/date.d.ts +3 -3
  114. package/dist/coercion/index.d.ts +5 -6
  115. package/dist/coercion/index.js +473 -5
  116. package/dist/coercion/number.d.ts +2 -3
  117. package/dist/coercion/string.d.ts +2 -3
  118. package/dist/compat/emitter.d.ts +0 -1
  119. package/dist/compat/emitter.js +0 -1
  120. package/dist/compat/index.d.ts +4 -5
  121. package/dist/compat/result.d.ts +1 -2
  122. package/dist/compat/result.js +0 -1
  123. package/dist/errors-core.d.ts +39 -0
  124. package/dist/errors.d.ts +4 -54
  125. package/dist/errors.js +4 -68
  126. package/dist/events.d.ts +3 -4
  127. package/dist/index.d.ts +1195 -600
  128. package/dist/index.js +1262 -44
  129. package/dist/kernel.d.ts +2 -3
  130. package/dist/kernel.js +10 -6
  131. package/dist/locales/af.d.ts +1 -2
  132. package/dist/locales/af.js +0 -1
  133. package/dist/locales/ar.d.ts +1 -2
  134. package/dist/locales/ar.js +0 -1
  135. package/dist/locales/bn.d.ts +1 -2
  136. package/dist/locales/bn.js +0 -1
  137. package/dist/locales/da.d.ts +1 -2
  138. package/dist/locales/da.js +0 -1
  139. package/dist/locales/de.d.ts +1 -2
  140. package/dist/locales/de.js +0 -1
  141. package/dist/locales/en.d.ts +1 -2
  142. package/dist/locales/en.js +0 -1
  143. package/dist/locales/es-MX.d.ts +1 -2
  144. package/dist/locales/es-MX.js +0 -1
  145. package/dist/locales/es.d.ts +1 -2
  146. package/dist/locales/es.js +0 -1
  147. package/dist/locales/fi.d.ts +1 -2
  148. package/dist/locales/fi.js +0 -1
  149. package/dist/locales/fr.d.ts +1 -2
  150. package/dist/locales/fr.js +0 -1
  151. package/dist/locales/hi.d.ts +1 -2
  152. package/dist/locales/hi.js +0 -1
  153. package/dist/locales/id.d.ts +1 -2
  154. package/dist/locales/id.js +0 -1
  155. package/dist/locales/index.d.ts +10 -15
  156. package/dist/locales/index.js +28 -2
  157. package/dist/locales/it.d.ts +1 -2
  158. package/dist/locales/it.js +0 -1
  159. package/dist/locales/ja.d.ts +1 -2
  160. package/dist/locales/ja.js +0 -1
  161. package/dist/locales/ko.d.ts +1 -2
  162. package/dist/locales/ko.js +0 -1
  163. package/dist/locales/lazy.d.ts +4 -26
  164. package/dist/locales/lazy.js +12 -55
  165. package/dist/locales/nl.d.ts +1 -2
  166. package/dist/locales/nl.js +0 -1
  167. package/dist/locales/no.d.ts +1 -2
  168. package/dist/locales/no.js +0 -1
  169. package/dist/locales/pl.d.ts +1 -2
  170. package/dist/locales/pl.js +0 -1
  171. package/dist/locales/pt-BR.d.ts +1 -2
  172. package/dist/locales/pt-BR.js +0 -1
  173. package/dist/locales/pt.d.ts +1 -2
  174. package/dist/locales/pt.js +0 -1
  175. package/dist/locales/ru.d.ts +1 -2
  176. package/dist/locales/ru.js +0 -1
  177. package/dist/locales/runtime.d.ts +10 -0
  178. package/dist/locales/runtime.js +41 -0
  179. package/dist/locales/sv.d.ts +1 -2
  180. package/dist/locales/sv.js +0 -1
  181. package/dist/locales/sw.d.ts +1 -2
  182. package/dist/locales/sw.js +0 -1
  183. package/dist/locales/th.d.ts +1 -2
  184. package/dist/locales/th.js +0 -1
  185. package/dist/locales/tr.d.ts +1 -2
  186. package/dist/locales/tr.js +0 -1
  187. package/dist/locales/types.d.ts +0 -1
  188. package/dist/locales/vi.d.ts +1 -2
  189. package/dist/locales/vi.js +0 -1
  190. package/dist/locales/zh.d.ts +1 -2
  191. package/dist/locales/zh.js +0 -1
  192. package/dist/logger.d.ts +0 -1
  193. package/dist/mini.d.ts +64 -65
  194. package/dist/mini.js +31 -7
  195. package/dist/pigment.d.ts +0 -1
  196. package/dist/pigment.js +6 -4
  197. package/dist/plugins/index.d.ts +2 -3
  198. package/dist/plugins/index.js +1 -0
  199. package/dist/plugins/types.d.ts +4 -5
  200. package/dist/registry.d.ts +23 -0
  201. package/dist/registry.js +34 -0
  202. package/dist/utils/codec-utils.d.ts +0 -1
  203. package/dist/utils/deep-merge.d.ts +0 -1
  204. package/dist/utils/ip-validation.d.ts +0 -1
  205. package/dist/utils/json-schema.d.ts +77 -0
  206. package/dist/utils/security.d.ts +2 -6
  207. package/dist/v3/index.d.ts +2 -0
  208. package/dist/v3/index.js +46 -0
  209. package/dist/v4/core/index.d.ts +260 -0
  210. package/dist/v4/core/index.js +277 -0
  211. package/dist/v4/index.d.ts +4 -0
  212. package/dist/v4/index.js +50 -0
  213. package/dist/v4/locales/index.d.ts +53 -0
  214. package/dist/v4/locales/index.js +77 -0
  215. package/dist/v4/mini/index.d.ts +2 -0
  216. package/dist/v4/mini/index.js +47 -0
  217. package/dist/v4-mini/index.d.ts +22 -0
  218. package/dist/v4-mini/index.js +75 -0
  219. package/dist/validators/any.d.ts +7 -2
  220. package/dist/validators/any.js +37 -0
  221. package/dist/validators/array.d.ts +9 -2
  222. package/dist/validators/array.js +279 -0
  223. package/dist/validators/base.d.ts +228 -5
  224. package/dist/validators/base.js +868 -0
  225. package/dist/validators/base64.d.ts +1 -2
  226. package/dist/validators/base64.js +68 -0
  227. package/dist/validators/bigint.d.ts +21 -3
  228. package/dist/validators/bigint.js +228 -0
  229. package/dist/validators/boolean.d.ts +13 -4
  230. package/dist/validators/boolean.js +142 -0
  231. package/dist/validators/codec.d.ts +9 -2
  232. package/dist/validators/codec.js +200 -0
  233. package/dist/validators/custom.d.ts +15 -2
  234. package/dist/validators/custom.js +67 -0
  235. package/dist/validators/date.d.ts +19 -3
  236. package/dist/validators/date.js +274 -0
  237. package/dist/validators/discriminated-union.d.ts +4 -3
  238. package/dist/validators/discriminated-union.js +123 -0
  239. package/dist/validators/enum.d.ts +10 -7
  240. package/dist/validators/enum.js +150 -0
  241. package/dist/validators/file.d.ts +7 -2
  242. package/dist/validators/file.js +125 -0
  243. package/dist/validators/function.d.ts +11 -5
  244. package/dist/validators/function.js +58 -0
  245. package/dist/validators/hex.d.ts +1 -2
  246. package/dist/validators/hex.js +65 -0
  247. package/dist/validators/index.d.ts +38 -38
  248. package/dist/validators/index.js +35 -5
  249. package/dist/validators/intersection.d.ts +1 -2
  250. package/dist/validators/intersection.js +116 -0
  251. package/dist/validators/json.d.ts +1 -2
  252. package/dist/validators/json.js +66 -0
  253. package/dist/validators/lazy.d.ts +5 -9
  254. package/dist/validators/lazy.js +50 -0
  255. package/dist/validators/literal.d.ts +2 -2
  256. package/dist/validators/literal.js +60 -0
  257. package/dist/validators/map.d.ts +15 -2
  258. package/dist/validators/map.js +214 -0
  259. package/dist/validators/nan.d.ts +2 -3
  260. package/dist/validators/nan.js +38 -0
  261. package/dist/validators/never.d.ts +1 -2
  262. package/dist/validators/never.js +32 -0
  263. package/dist/validators/null.d.ts +3 -3
  264. package/dist/validators/null.js +40 -0
  265. package/dist/validators/number.d.ts +80 -21
  266. package/dist/validators/number.js +423 -0
  267. package/dist/validators/object.d.ts +30 -9
  268. package/dist/validators/object.js +864 -0
  269. package/dist/validators/promise.d.ts +58 -0
  270. package/dist/validators/promise.js +111 -0
  271. package/dist/validators/record.d.ts +11 -2
  272. package/dist/validators/record.js +258 -0
  273. package/dist/validators/set.d.ts +11 -2
  274. package/dist/validators/set.js +199 -0
  275. package/dist/validators/string-bool.d.ts +7 -10
  276. package/dist/validators/string-bool.js +120 -0
  277. package/dist/validators/string-formats.d.ts +13 -4
  278. package/dist/validators/string-formats.js +135 -0
  279. package/dist/validators/string.d.ts +39 -18
  280. package/dist/validators/string.js +4 -0
  281. package/dist/validators/symbol.d.ts +8 -3
  282. package/dist/validators/symbol.js +58 -0
  283. package/dist/validators/template-literal.d.ts +1 -2
  284. package/dist/validators/template-literal.js +103 -0
  285. package/dist/validators/tuple.d.ts +15 -2
  286. package/dist/validators/tuple.js +183 -0
  287. package/dist/validators/uint8array.d.ts +3 -4
  288. package/dist/validators/uint8array.js +101 -0
  289. package/dist/validators/undefined.d.ts +3 -3
  290. package/dist/validators/undefined.js +40 -0
  291. package/dist/validators/union.d.ts +7 -4
  292. package/dist/validators/union.js +187 -0
  293. package/dist/validators/unknown.d.ts +7 -2
  294. package/dist/{chunks/unknown-SLIH1VCf.js → validators/unknown.js} +12 -3
  295. package/dist/validators/void.d.ts +3 -2
  296. package/dist/validators/void.js +44 -0
  297. package/dist/validators/xor.d.ts +2 -3
  298. package/dist/validators/xor.js +66 -0
  299. package/package.json +116 -31
  300. package/dist/chunks/bigint-DgsCr2dC.js +0 -1709
  301. package/dist/chunks/bigint-DgsCr2dC.js.map +0 -1
  302. package/dist/chunks/date-ODue_rtq.js.map +0 -1
  303. package/dist/chunks/index-BZqWZvVe.js +0 -426
  304. package/dist/chunks/index-BZqWZvVe.js.map +0 -1
  305. package/dist/chunks/index-CETyGkrv.js.map +0 -1
  306. package/dist/chunks/json-o20GFhTh.js +0 -2021
  307. package/dist/chunks/json-o20GFhTh.js.map +0 -1
  308. package/dist/chunks/unknown-SLIH1VCf.js.map +0 -1
  309. package/dist/cjs/errors.cjs.map +0 -1
  310. package/dist/cjs/index.cjs.map +0 -1
  311. package/dist/cjs/locales/index.cjs.map +0 -1
  312. package/dist/cjs/locales/lazy.cjs.map +0 -1
  313. package/dist/cjs/mini.cjs.map +0 -1
  314. package/dist/cli/bin.d.ts.map +0 -1
  315. package/dist/cli/commands/benchmark.d.ts.map +0 -1
  316. package/dist/cli/commands/validate.d.ts.map +0 -1
  317. package/dist/cli/index.d.ts.map +0 -1
  318. package/dist/codecs/index.d.ts.map +0 -1
  319. package/dist/codecs/index.js.map +0 -1
  320. package/dist/coercion/bigint.d.ts.map +0 -1
  321. package/dist/coercion/boolean.d.ts.map +0 -1
  322. package/dist/coercion/date.d.ts.map +0 -1
  323. package/dist/coercion/index.d.ts.map +0 -1
  324. package/dist/coercion/index.js.map +0 -1
  325. package/dist/coercion/number.d.ts.map +0 -1
  326. package/dist/coercion/string.d.ts.map +0 -1
  327. package/dist/compat/emitter.d.ts.map +0 -1
  328. package/dist/compat/emitter.js.map +0 -1
  329. package/dist/compat/index.d.ts.map +0 -1
  330. package/dist/compat/result.d.ts.map +0 -1
  331. package/dist/compat/result.js.map +0 -1
  332. package/dist/errors.d.ts.map +0 -1
  333. package/dist/errors.js.map +0 -1
  334. package/dist/events.d.ts.map +0 -1
  335. package/dist/index.d.ts.map +0 -1
  336. package/dist/index.js.map +0 -1
  337. package/dist/kernel.d.ts.map +0 -1
  338. package/dist/kernel.js.map +0 -1
  339. package/dist/locales/af.d.ts.map +0 -1
  340. package/dist/locales/af.js.map +0 -1
  341. package/dist/locales/ar.d.ts.map +0 -1
  342. package/dist/locales/ar.js.map +0 -1
  343. package/dist/locales/backup-en.d.ts +0 -3
  344. package/dist/locales/backup-en.d.ts.map +0 -1
  345. package/dist/locales/bn.d.ts.map +0 -1
  346. package/dist/locales/bn.js.map +0 -1
  347. package/dist/locales/da.d.ts.map +0 -1
  348. package/dist/locales/da.js.map +0 -1
  349. package/dist/locales/de.d.ts.map +0 -1
  350. package/dist/locales/de.js.map +0 -1
  351. package/dist/locales/en.d.ts.map +0 -1
  352. package/dist/locales/en.js.map +0 -1
  353. package/dist/locales/es-MX.d.ts.map +0 -1
  354. package/dist/locales/es-MX.js.map +0 -1
  355. package/dist/locales/es.d.ts.map +0 -1
  356. package/dist/locales/es.js.map +0 -1
  357. package/dist/locales/fi.d.ts.map +0 -1
  358. package/dist/locales/fi.js.map +0 -1
  359. package/dist/locales/fr.d.ts.map +0 -1
  360. package/dist/locales/fr.js.map +0 -1
  361. package/dist/locales/hi.d.ts.map +0 -1
  362. package/dist/locales/hi.js.map +0 -1
  363. package/dist/locales/id.d.ts.map +0 -1
  364. package/dist/locales/id.js.map +0 -1
  365. package/dist/locales/index.d.ts.map +0 -1
  366. package/dist/locales/index.js.map +0 -1
  367. package/dist/locales/it.d.ts.map +0 -1
  368. package/dist/locales/it.js.map +0 -1
  369. package/dist/locales/ja.d.ts.map +0 -1
  370. package/dist/locales/ja.js.map +0 -1
  371. package/dist/locales/ko.d.ts.map +0 -1
  372. package/dist/locales/ko.js.map +0 -1
  373. package/dist/locales/lazy.d.ts.map +0 -1
  374. package/dist/locales/lazy.js.map +0 -1
  375. package/dist/locales/nl.d.ts.map +0 -1
  376. package/dist/locales/nl.js.map +0 -1
  377. package/dist/locales/no.d.ts.map +0 -1
  378. package/dist/locales/no.js.map +0 -1
  379. package/dist/locales/pl.d.ts.map +0 -1
  380. package/dist/locales/pl.js.map +0 -1
  381. package/dist/locales/pt-BR.d.ts.map +0 -1
  382. package/dist/locales/pt-BR.js.map +0 -1
  383. package/dist/locales/pt.d.ts.map +0 -1
  384. package/dist/locales/pt.js.map +0 -1
  385. package/dist/locales/ru.d.ts.map +0 -1
  386. package/dist/locales/ru.js.map +0 -1
  387. package/dist/locales/sv.d.ts.map +0 -1
  388. package/dist/locales/sv.js.map +0 -1
  389. package/dist/locales/sw.d.ts.map +0 -1
  390. package/dist/locales/sw.js.map +0 -1
  391. package/dist/locales/th.d.ts.map +0 -1
  392. package/dist/locales/th.js.map +0 -1
  393. package/dist/locales/tr.d.ts.map +0 -1
  394. package/dist/locales/tr.js.map +0 -1
  395. package/dist/locales/types.d.ts.map +0 -1
  396. package/dist/locales/vi.d.ts.map +0 -1
  397. package/dist/locales/vi.js.map +0 -1
  398. package/dist/locales/zh.d.ts.map +0 -1
  399. package/dist/locales/zh.js.map +0 -1
  400. package/dist/logger.d.ts.map +0 -1
  401. package/dist/mini.d.ts.map +0 -1
  402. package/dist/mini.js.map +0 -1
  403. package/dist/pigment.d.ts.map +0 -1
  404. package/dist/pigment.js.map +0 -1
  405. package/dist/plugins/index.d.ts.map +0 -1
  406. package/dist/plugins/types.d.ts.map +0 -1
  407. package/dist/utils/codec-utils.d.ts.map +0 -1
  408. package/dist/utils/deep-merge.d.ts.map +0 -1
  409. package/dist/utils/ip-validation.d.ts.map +0 -1
  410. package/dist/utils/security.d.ts.map +0 -1
  411. package/dist/validators/any.d.ts.map +0 -1
  412. package/dist/validators/array.d.ts.map +0 -1
  413. package/dist/validators/base.d.ts.map +0 -1
  414. package/dist/validators/base64.d.ts.map +0 -1
  415. package/dist/validators/bigint.d.ts.map +0 -1
  416. package/dist/validators/boolean.d.ts.map +0 -1
  417. package/dist/validators/codec.d.ts.map +0 -1
  418. package/dist/validators/custom.d.ts.map +0 -1
  419. package/dist/validators/date.d.ts.map +0 -1
  420. package/dist/validators/discriminated-union.d.ts.map +0 -1
  421. package/dist/validators/enum.d.ts.map +0 -1
  422. package/dist/validators/file.d.ts.map +0 -1
  423. package/dist/validators/function.d.ts.map +0 -1
  424. package/dist/validators/hex.d.ts.map +0 -1
  425. package/dist/validators/index.d.ts.map +0 -1
  426. package/dist/validators/index.js.map +0 -1
  427. package/dist/validators/intersection.d.ts.map +0 -1
  428. package/dist/validators/json.d.ts.map +0 -1
  429. package/dist/validators/lazy.d.ts.map +0 -1
  430. package/dist/validators/literal.d.ts.map +0 -1
  431. package/dist/validators/map.d.ts.map +0 -1
  432. package/dist/validators/nan.d.ts.map +0 -1
  433. package/dist/validators/never.d.ts.map +0 -1
  434. package/dist/validators/null.d.ts.map +0 -1
  435. package/dist/validators/number.d.ts.map +0 -1
  436. package/dist/validators/object.d.ts.map +0 -1
  437. package/dist/validators/record.d.ts.map +0 -1
  438. package/dist/validators/set.d.ts.map +0 -1
  439. package/dist/validators/string-bool.d.ts.map +0 -1
  440. package/dist/validators/string-formats.d.ts.map +0 -1
  441. package/dist/validators/string.d.ts.map +0 -1
  442. package/dist/validators/symbol.d.ts.map +0 -1
  443. package/dist/validators/template-literal.d.ts.map +0 -1
  444. package/dist/validators/tuple.d.ts.map +0 -1
  445. package/dist/validators/uint8array.d.ts.map +0 -1
  446. package/dist/validators/undefined.d.ts.map +0 -1
  447. package/dist/validators/union.d.ts.map +0 -1
  448. package/dist/validators/unknown.d.ts.map +0 -1
  449. package/dist/validators/void.d.ts.map +0 -1
  450. package/dist/validators/xor.d.ts.map +0 -1
@@ -0,0 +1,279 @@
1
+ import { VldBase, VLD_VALIDATOR_TYPES } from './base.js';
2
+ import { getMessages } from '../locales/runtime.js';
3
+ import { V as VldError } from '../chunks/errors-core-BeiFUtZM.js';
4
+
5
+ function createArrayError(message) {
6
+ return new VldError([{ code: 'invalid_array', path: [], message }]);
7
+ }
8
+ /**
9
+ * Immutable array validator with chainable methods
10
+ */
11
+ class VldArray extends VldBase {
12
+ /**
13
+ * Private constructor to enforce immutability
14
+ */
15
+ constructor(config) {
16
+ super(VLD_VALIDATOR_TYPES.ARRAY);
17
+ this.config = config;
18
+ this._simpleItemMode = this.getSimpleItemMode(config.itemValidator);
19
+ }
20
+ getSimpleItemMode(itemValidator) {
21
+ if (itemValidator.isSimple !== true) {
22
+ return undefined;
23
+ }
24
+ switch (itemValidator.validatorType) {
25
+ case VLD_VALIDATOR_TYPES.STRING:
26
+ return 'string';
27
+ case VLD_VALIDATOR_TYPES.NUMBER:
28
+ return 'number';
29
+ case VLD_VALIDATOR_TYPES.BOOLEAN:
30
+ return 'boolean';
31
+ default:
32
+ return undefined;
33
+ }
34
+ }
35
+ /**
36
+ * Create a new array validator
37
+ */
38
+ static create(itemValidator) {
39
+ return new VldArray({ itemValidator });
40
+ }
41
+ /**
42
+ * Parse and validate an array value
43
+ */
44
+ parse(value) {
45
+ if (!Array.isArray(value)) {
46
+ throw new Error(this.config.errorMessage || getMessages().invalidArray);
47
+ }
48
+ return this.parseArrayValue(value);
49
+ }
50
+ /**
51
+ * Parse a value that has already passed the array type guard.
52
+ * @internal Used by object validators to avoid duplicate hot-path checks.
53
+ */
54
+ parseKnownArray(value) {
55
+ return this.parseArrayValue(value);
56
+ }
57
+ parseArrayValue(value) {
58
+ // Validate length constraints
59
+ if (this.config.exactLength !== undefined && value.length !== this.config.exactLength) {
60
+ throw new Error(this.config.errorMessage || getMessages().arrayLength(this.config.exactLength));
61
+ }
62
+ if (this.config.minLength !== undefined && value.length < this.config.minLength) {
63
+ throw new Error(this.config.errorMessage || getMessages().arrayMin(this.config.minLength));
64
+ }
65
+ if (this.config.maxLength !== undefined && value.length > this.config.maxLength) {
66
+ throw new Error(this.config.errorMessage || getMessages().arrayMax(this.config.maxLength));
67
+ }
68
+ const length = value.length;
69
+ const result = new Array(length);
70
+ const simpleItemMode = this._simpleItemMode;
71
+ if (simpleItemMode !== undefined) {
72
+ for (let i = 0; i < length; i++) {
73
+ const item = value[i];
74
+ switch (simpleItemMode) {
75
+ case 'string':
76
+ if (typeof item !== 'string') {
77
+ throw new Error(getMessages().arrayItem(i, getMessages().invalidString));
78
+ }
79
+ result[i] = item;
80
+ break;
81
+ case 'number':
82
+ if (typeof item !== 'number' || isNaN(item)) {
83
+ throw new Error(getMessages().arrayItem(i, getMessages().invalidNumber));
84
+ }
85
+ result[i] = item;
86
+ break;
87
+ case 'boolean':
88
+ if (typeof item !== 'boolean') {
89
+ throw new Error(getMessages().arrayItem(i, getMessages().invalidBoolean));
90
+ }
91
+ result[i] = item;
92
+ break;
93
+ }
94
+ }
95
+ if (this.config.unique) {
96
+ this.checkUnique(result);
97
+ }
98
+ return result;
99
+ }
100
+ // Validate each item without allocating a ParseResult object per element.
101
+ for (let i = 0; i < length; i++) {
102
+ try {
103
+ result[i] = this.config.itemValidator.parse(value[i]);
104
+ }
105
+ catch (error) {
106
+ const message = error instanceof Error ? error.message : String(error);
107
+ throw new Error(getMessages().arrayItem(i, message));
108
+ }
109
+ }
110
+ // Check uniqueness if required - optimized with Map-based approach
111
+ if (this.config.unique) {
112
+ this.checkUnique(result);
113
+ }
114
+ return result;
115
+ }
116
+ /**
117
+ * Safely parse and validate an array value
118
+ */
119
+ safeParse(value) {
120
+ try {
121
+ return { success: true, data: this.parse(value) };
122
+ }
123
+ catch (error) {
124
+ return { success: false, error: createArrayError(error.message) };
125
+ }
126
+ }
127
+ /**
128
+ * Optimized uniqueness check using Map-based approach
129
+ * Avoids repeated stableStringify calls by caching serialized values
130
+ */
131
+ checkUnique(items) {
132
+ const seen = new Set(); // Set of seen keys
133
+ const objectKeys = new WeakMap(); // Cache for object->string mappings
134
+ for (const item of items) {
135
+ let key;
136
+ if (typeof item === 'object' && item !== null) {
137
+ // Check if we've already serialized this object reference
138
+ const cached = objectKeys.get(item);
139
+ if (cached !== undefined) {
140
+ key = cached;
141
+ }
142
+ else {
143
+ // Serialize and cache
144
+ const serialized = this.stableStringify(item);
145
+ key = serialized;
146
+ objectKeys.set(item, serialized);
147
+ }
148
+ }
149
+ else {
150
+ // Primitives can be used directly as keys
151
+ key = item;
152
+ }
153
+ if (seen.has(key)) {
154
+ throw new Error('Array must contain unique items');
155
+ }
156
+ seen.add(key);
157
+ }
158
+ }
159
+ /**
160
+ * Create a stable string representation of an object for hashing
161
+ * Handles circular references and deep nesting gracefully
162
+ * BUG-006 FIX: Added depth limit to prevent stack overflow
163
+ * BUG-NEW-003 FIX: Fixed depth tracking to properly track recursion depth
164
+ */
165
+ stableStringify(obj) {
166
+ const seen = new WeakSet();
167
+ const MAX_DEPTH = 100; // Reasonable depth limit to prevent stack overflow
168
+ // Helper function to sort keys and create stable representation
169
+ const sortedStringify = (value, depth = 0) => {
170
+ // Check depth limit
171
+ if (depth > MAX_DEPTH) {
172
+ return '"[Max Depth Exceeded]"';
173
+ }
174
+ // Handle primitives
175
+ if (value === null)
176
+ return 'null';
177
+ if (value === undefined)
178
+ return 'undefined';
179
+ if (typeof value !== 'object')
180
+ return JSON.stringify(value);
181
+ // Handle circular references
182
+ if (seen.has(value)) {
183
+ return '"[Circular]"';
184
+ }
185
+ seen.add(value);
186
+ try {
187
+ // Handle arrays
188
+ if (Array.isArray(value)) {
189
+ const items = value.map(item => sortedStringify(item, depth + 1));
190
+ return `[${items.join(',')}]`;
191
+ }
192
+ // Handle objects - sort keys for stability
193
+ const keys = Object.keys(value).sort();
194
+ const pairs = keys.map(key => {
195
+ const serializedKey = JSON.stringify(key);
196
+ const serializedValue = sortedStringify(value[key], depth + 1);
197
+ return `${serializedKey}:${serializedValue}`;
198
+ });
199
+ return `{${pairs.join(',')}}`;
200
+ }
201
+ finally {
202
+ // Clean up seen set for this branch
203
+ seen.delete(value);
204
+ }
205
+ };
206
+ try {
207
+ return sortedStringify(obj);
208
+ }
209
+ catch {
210
+ // Fallback to safe representation if stringify fails
211
+ return String(obj);
212
+ }
213
+ }
214
+ /**
215
+ * Create a new validator with minimum length constraint
216
+ */
217
+ min(length, message) {
218
+ return new VldArray({
219
+ ...this.config,
220
+ minLength: length,
221
+ errorMessage: message || getMessages().arrayMin(length)
222
+ });
223
+ }
224
+ /**
225
+ * Create a new validator with maximum length constraint
226
+ */
227
+ max(length, message) {
228
+ return new VldArray({
229
+ ...this.config,
230
+ maxLength: length,
231
+ errorMessage: message || getMessages().arrayMax(length)
232
+ });
233
+ }
234
+ /**
235
+ * Create a new validator with exact length constraint
236
+ */
237
+ length(length, message) {
238
+ return new VldArray({
239
+ ...this.config,
240
+ exactLength: length,
241
+ minLength: undefined,
242
+ maxLength: undefined,
243
+ errorMessage: message || getMessages().arrayLength(length)
244
+ });
245
+ }
246
+ /**
247
+ * Create a new validator that ensures array is not empty
248
+ */
249
+ nonempty(message) {
250
+ return new VldArray({
251
+ ...this.config,
252
+ minLength: 1,
253
+ errorMessage: message || getMessages().arrayEmpty
254
+ });
255
+ }
256
+ /**
257
+ * Create a new validator that ensures array contains unique items
258
+ */
259
+ unique(message) {
260
+ return new VldArray({
261
+ ...this.config,
262
+ unique: true,
263
+ errorMessage: message || 'Array must contain unique items'
264
+ });
265
+ }
266
+ /**
267
+ * Create a new validator with a range constraint for length
268
+ */
269
+ between(min, max, message) {
270
+ return new VldArray({
271
+ ...this.config,
272
+ minLength: min,
273
+ maxLength: max,
274
+ errorMessage: message || `Array length must be between ${min} and ${max}`
275
+ });
276
+ }
277
+ }
278
+
279
+ export { VldArray };
@@ -1,3 +1,4 @@
1
+ import type { SchemaRegistry } from '../registry.js';
1
2
  /**
2
3
  * Base result type for validation
3
4
  */
@@ -8,6 +9,108 @@ export type ParseResult<T> = {
8
9
  readonly success: false;
9
10
  readonly error: Error;
10
11
  };
12
+ export interface StandardTypedV1<Input = unknown, Output = Input> {
13
+ readonly '~standard': StandardTypedV1Props<Input, Output>;
14
+ }
15
+ export interface StandardTypedV1Props<Input = unknown, Output = Input> {
16
+ readonly version: 1;
17
+ readonly vendor: string;
18
+ readonly types?: StandardTypedV1Types<Input, Output> | undefined;
19
+ }
20
+ export interface StandardTypedV1Types<Input = unknown, Output = Input> {
21
+ readonly input: Input;
22
+ readonly output: Output;
23
+ }
24
+ export interface StandardSchemaV1<Input = unknown, Output = Input> extends StandardTypedV1<Input, Output> {
25
+ readonly '~standard': StandardSchemaV1Props<Input, Output>;
26
+ }
27
+ export interface StandardSchemaV1Props<Input = unknown, Output = Input> extends StandardTypedV1Props<Input, Output> {
28
+ readonly validate: (value: unknown, options?: StandardSchemaV1Options | undefined) => StandardSchemaV1Result<Output> | Promise<StandardSchemaV1Result<Output>>;
29
+ }
30
+ export interface StandardSchemaV1Options {
31
+ readonly libraryOptions?: Record<string, unknown> | undefined;
32
+ }
33
+ export type StandardSchemaV1Result<Output> = StandardSchemaV1SuccessResult<Output> | StandardSchemaV1FailureResult;
34
+ export interface StandardSchemaV1SuccessResult<Output> {
35
+ readonly value: Output;
36
+ readonly issues?: undefined;
37
+ }
38
+ export interface StandardSchemaV1FailureResult {
39
+ readonly issues: ReadonlyArray<StandardSchemaV1Issue>;
40
+ }
41
+ export interface StandardSchemaV1Issue {
42
+ readonly message: string;
43
+ readonly path?: ReadonlyArray<PropertyKey | StandardSchemaV1PathSegment> | undefined;
44
+ }
45
+ export interface StandardSchemaV1PathSegment {
46
+ readonly key: PropertyKey;
47
+ }
48
+ /**
49
+ * Validator type constants for O(1) dispatch
50
+ * Used by VldObject to replace instanceof chains with Map lookups
51
+ */
52
+ export declare const VLD_VALIDATOR_TYPES: {
53
+ readonly STRING: "string";
54
+ readonly STRING_FORMAT: "stringFormat";
55
+ readonly STRING_BOOL: "stringBool";
56
+ readonly NUMBER: "number";
57
+ readonly BOOLEAN: "boolean";
58
+ readonly DATE: "date";
59
+ readonly BIGINT: "bigint";
60
+ readonly UNDEFINED: "undefined";
61
+ readonly NULL: "null";
62
+ readonly UNKNOWN: "unknown";
63
+ readonly ANY: "any";
64
+ readonly VOID: "void";
65
+ readonly NEVER: "never";
66
+ readonly SYMBOL: "symbol";
67
+ readonly NAN: "nan";
68
+ readonly HEX: "hex";
69
+ readonly BASE64: "base64";
70
+ readonly UINT8_ARRAY: "uint8Array";
71
+ readonly COERCE_STRING: "coerceString";
72
+ readonly COERCE_NUMBER: "coerceNumber";
73
+ readonly COERCE_BOOLEAN: "coerceBoolean";
74
+ readonly COERCE_DATE: "coerceDate";
75
+ readonly COERCE_BIGINT: "coerceBigint";
76
+ readonly OBJECT: "object";
77
+ readonly ARRAY: "array";
78
+ readonly TUPLE: "tuple";
79
+ readonly SET: "set";
80
+ readonly MAP: "map";
81
+ readonly RECORD: "record";
82
+ readonly UNION: "union";
83
+ readonly DISCRIMINATED_UNION: "discriminatedUnion";
84
+ readonly INTERSECTION: "intersection";
85
+ readonly XOR: "xor";
86
+ readonly ENUM: "enum";
87
+ readonly LITERAL: "literal";
88
+ readonly LAZY: "lazy";
89
+ readonly CUSTOM: "custom";
90
+ readonly FUNCTION: "function";
91
+ readonly FILE: "file";
92
+ readonly JSON: "json";
93
+ readonly TEMPLATE_LITERAL: "templateLiteral";
94
+ readonly PROMISE: "promise";
95
+ readonly OPTIONAL: "optional";
96
+ readonly NULLABLE: "nullable";
97
+ readonly NULLISH: "nullish";
98
+ readonly EXACT_OPTIONAL: "exactOptional";
99
+ readonly DEFAULT: "default";
100
+ readonly CATCH: "catch";
101
+ readonly REFINE: "refine";
102
+ readonly TRANSFORM: "transform";
103
+ readonly PIPE: "pipe";
104
+ readonly PREPROCESS: "preprocess";
105
+ readonly SUPER_REFINE: "superRefine";
106
+ readonly BRAND: "brand";
107
+ readonly READONLY: "readonly";
108
+ readonly META: "meta";
109
+ readonly PREFAULT: "prefault";
110
+ readonly PREFault: "prefault";
111
+ readonly CODEC: "codec";
112
+ };
113
+ export type ValidatorType = typeof VLD_VALIDATOR_TYPES[keyof typeof VLD_VALIDATOR_TYPES];
11
114
  /**
12
115
  * Context for superRefine - allows adding multiple issues
13
116
  */
@@ -18,11 +121,32 @@ export interface SuperRefineContext {
18
121
  }): void;
19
122
  path: (string | number)[];
20
123
  }
124
+ export type ErrorMap = (issue: {
125
+ code?: string;
126
+ input?: unknown;
127
+ path?: (string | number)[];
128
+ }) => string | undefined;
129
+ export type ErrorParam = string | {
130
+ error?: string | ErrorMap;
131
+ message?: string;
132
+ };
133
+ export declare function resolveErrorMessage(error: ErrorParam | undefined, fallback: string): string;
21
134
  /**
22
135
  * Abstract base class for all validators
23
136
  * Implements immutable pattern to prevent memory leaks and race conditions
24
137
  */
25
138
  export declare abstract class VldBase<TInput, TOutput = TInput> {
139
+ /**
140
+ * Runtime type identifier for O(1) dispatch
141
+ * Used by VldObject instead of instanceof chains
142
+ */
143
+ readonly validatorType: ValidatorType;
144
+ /**
145
+ * Constructor with runtime type identifier
146
+ * @param validatorType The runtime type identifier
147
+ */
148
+ constructor(validatorType?: ValidatorType);
149
+ get '~standard'(): StandardSchemaV1Props<unknown, TOutput>;
26
150
  /**
27
151
  * Parse and validate a value, throwing an error if invalid
28
152
  * @param value The value to validate
@@ -36,6 +160,8 @@ export declare abstract class VldBase<TInput, TOutput = TInput> {
36
160
  * @returns A result object with either success and data, or failure and error
37
161
  */
38
162
  abstract safeParse(value: unknown): ParseResult<TOutput>;
163
+ parseAsync(value: unknown): Promise<TOutput>;
164
+ safeParseAsync(value: unknown): Promise<ParseResult<TOutput>>;
39
165
  /**
40
166
  * Check if a value is valid according to this validator
41
167
  * @param value The value to check
@@ -57,7 +183,7 @@ export declare abstract class VldBase<TInput, TOutput = TInput> {
57
183
  * @returns A new refined validator
58
184
  */
59
185
  refine<TRefined extends TOutput>(predicate: (value: TOutput) => value is TRefined, message?: string): VldRefine<TInput, TOutput, TRefined>;
60
- refine(predicate: (value: TOutput) => boolean, message?: string): VldRefine<TInput, TOutput, TOutput>;
186
+ refine(predicate: (value: TOutput) => boolean | Promise<boolean>, message?: string): VldRefine<TInput, TOutput, TOutput>;
61
187
  /**
62
188
  * Advanced refinement with context for adding multiple issues
63
189
  * @param refinement The refinement function with context
@@ -69,7 +195,7 @@ export declare abstract class VldBase<TInput, TOutput = TInput> {
69
195
  * @param transformer The transformation function
70
196
  * @returns A new transformed validator
71
197
  */
72
- transform<TTransformed>(transformer: (value: TOutput) => TTransformed): VldTransform<TInput, TOutput, TTransformed>;
198
+ transform<TTransformed>(transformer: (value: TOutput) => TTransformed | Promise<TTransformed>): VldTransform<TInput, TOutput, TTransformed>;
73
199
  /**
74
200
  * Create a new validator with a default value for undefined inputs
75
201
  * @param defaultValue The default value
@@ -97,6 +223,14 @@ export declare abstract class VldBase<TInput, TOutput = TInput> {
97
223
  * @returns A new nullish validator
98
224
  */
99
225
  nullish(): VldNullish<TInput, TOutput>;
226
+ /**
227
+ * Make this validator exactly optional - allows undefined but not missing
228
+ * Unlike .optional() which treats missing as undefined, exactOptional()
229
+ * requires the key to be present but allows undefined as a value
230
+ * Zod 4 API parity
231
+ * @returns A new exact optional validator
232
+ */
233
+ exactOptional(): VldExactOptional<TInput, TOutput>;
100
234
  /**
101
235
  * Pipe the output of this validator into another validator
102
236
  * @param next The next validator to pipe into
@@ -133,6 +267,72 @@ export declare abstract class VldBase<TInput, TOutput = TInput> {
133
267
  * const lengthSchema = v.string().apply(withLength); // validates string, returns number
134
268
  */
135
269
  apply<TNewOutput>(fn: (schema: this) => VldBase<TInput, TNewOutput>): VldBase<TInput, TNewOutput>;
270
+ /**
271
+ * Create a new validator that refines this one with a custom predicate
272
+ * Alias for refine() - check() is the Zod 4 API name
273
+ * @param predicate The refinement predicate
274
+ * @param message Optional custom error message
275
+ * @returns A new refined validator
276
+ */
277
+ check<TRefined extends TOutput>(predicate: (value: TOutput) => value is TRefined, message?: string): VldRefine<TInput, TOutput, TRefined>;
278
+ check(predicate: (value: TOutput) => boolean | Promise<boolean>, message?: string): VldRefine<TInput, TOutput, TOutput>;
279
+ /**
280
+ * Get metadata for this schema
281
+ * Zod 4 API parity - allows attaching OpenAPI/JSON Schema metadata
282
+ * @returns Metadata object or undefined
283
+ */
284
+ meta(): SchemaMetadata | undefined;
285
+ /**
286
+ * Set metadata for this schema
287
+ * Zod 4 API parity - allows attaching OpenAPI/JSON Schema metadata
288
+ * @param data Metadata to attach
289
+ * @returns A new validator with the metadata
290
+ */
291
+ meta(data: Partial<SchemaMetadata>): VldMeta<TInput, TOutput>;
292
+ /**
293
+ * Register this schema in a metadata registry and return the same instance.
294
+ * This mirrors Zod 4's registry convenience API without changing validator
295
+ * immutability.
296
+ */
297
+ register<TMetadata extends Record<string, unknown>>(targetRegistry: SchemaRegistry<TMetadata>, metadata: TMetadata): this;
298
+ /**
299
+ * Add a description to this schema
300
+ * Zod 4 API parity - convenience method for .meta({ description: ... })
301
+ * @param description The description to add
302
+ * @returns A new validator with the description
303
+ */
304
+ describe(description: string): VldMeta<TInput, TOutput>;
305
+ }
306
+ /**
307
+ * Schema metadata interface for OpenAPI/JSON Schema compatibility
308
+ */
309
+ export interface SchemaMetadata {
310
+ id?: string;
311
+ title?: string;
312
+ description?: string;
313
+ examples?: unknown[];
314
+ default?: unknown;
315
+ deprecated?: boolean;
316
+ readOnly?: boolean;
317
+ writeOnly?: boolean;
318
+ [key: string]: unknown;
319
+ }
320
+ /**
321
+ * Metadata validator - wraps a schema with metadata
322
+ */
323
+ export declare class VldMeta<TInput, TOutput> extends VldBase<TInput, TOutput> {
324
+ private readonly baseValidator;
325
+ private readonly metadata;
326
+ constructor(baseValidator: VldBase<TInput, TOutput>, metadata: Partial<SchemaMetadata>);
327
+ parse(value: unknown): TOutput;
328
+ safeParse(value: unknown): ParseResult<TOutput>;
329
+ /**
330
+ * Get the metadata
331
+ */
332
+ getMeta(): Readonly<Partial<SchemaMetadata>>;
333
+ meta(): SchemaMetadata | undefined;
334
+ meta(data: Partial<SchemaMetadata>): VldMeta<TInput, TOutput>;
335
+ describe(description: string): VldMeta<TInput, TOutput>;
136
336
  }
137
337
  /**
138
338
  * Readonly validator - marks output as readonly
@@ -166,9 +366,10 @@ export declare class VldRefine<TInput, TBase, TOutput extends TBase = TBase> ext
166
366
  private readonly baseValidator;
167
367
  private readonly predicate;
168
368
  private readonly customMessage?;
169
- constructor(baseValidator: VldBase<TInput, TBase>, predicate: (value: TBase) => boolean, customMessage?: string | undefined);
369
+ constructor(baseValidator: VldBase<TInput, TBase>, predicate: (value: TBase) => boolean | Promise<boolean>, customMessage?: string | undefined);
170
370
  parse(value: unknown): TOutput;
171
371
  safeParse(value: unknown): ParseResult<TOutput>;
372
+ parseAsync(value: unknown): Promise<TOutput>;
172
373
  }
173
374
  /**
174
375
  * Transform validator - transforms data after validation
@@ -176,9 +377,10 @@ export declare class VldRefine<TInput, TBase, TOutput extends TBase = TBase> ext
176
377
  export declare class VldTransform<TInput, TBase, TOutput> extends VldBase<TInput, TOutput> {
177
378
  private readonly baseValidator;
178
379
  private readonly transformer;
179
- constructor(baseValidator: VldBase<TInput, TBase>, transformer: (value: TBase) => TOutput);
380
+ constructor(baseValidator: VldBase<TInput, TBase>, transformer: (value: TBase) => TOutput | Promise<TOutput>);
180
381
  parse(value: unknown): TOutput;
181
382
  safeParse(value: unknown): ParseResult<TOutput>;
383
+ parseAsync(value: unknown): Promise<TOutput>;
182
384
  }
183
385
  /**
184
386
  * Default validator - provides default value for undefined
@@ -218,6 +420,7 @@ export declare class VldPrefault<TInput, TOutput> extends VldBase<TInput | undef
218
420
  export declare class VldCatch<TInput, TOutput> extends VldBase<TInput, TOutput> {
219
421
  private readonly baseValidator;
220
422
  private readonly fallbackValue;
423
+ private readonly simpleMode;
221
424
  constructor(baseValidator: VldBase<TInput, TOutput>, fallbackValue: TOutput);
222
425
  parse(value: unknown): TOutput;
223
426
  safeParse(value: unknown): ParseResult<TOutput>;
@@ -227,17 +430,35 @@ export declare class VldCatch<TInput, TOutput> extends VldBase<TInput, TOutput>
227
430
  */
228
431
  export declare class VldOptional<TInput, TOutput> extends VldBase<TInput | undefined, TOutput | undefined> {
229
432
  private readonly baseValidator;
433
+ private readonly simpleMode;
230
434
  constructor(baseValidator: VldBase<TInput, TOutput>);
435
+ private parseSimpleValue;
231
436
  static create<TInput, TOutput>(baseValidator: VldBase<TInput, TOutput>): VldOptional<TInput, TOutput>;
232
437
  parse(value: unknown): TOutput | undefined;
233
438
  safeParse(value: unknown): ParseResult<TOutput | undefined>;
234
439
  unwrap(): VldBase<TInput, TOutput>;
235
440
  }
441
+ /**
442
+ * Exact optional validator - allows undefined but requires key presence
443
+ * Unlike Optional which treats missing as undefined, ExactOptional
444
+ * requires the key to be present (not missing from object) but allows undefined
445
+ * Zod 4 API parity
446
+ */
447
+ export declare class VldExactOptional<TInput, TOutput> extends VldBase<TInput | undefined, TOutput | undefined> {
448
+ private readonly baseValidator;
449
+ private readonly simpleMode;
450
+ constructor(baseValidator: VldBase<TInput, TOutput>);
451
+ static create<TInput, TOutput>(baseValidator: VldBase<TInput, TOutput>): VldExactOptional<TInput, TOutput>;
452
+ parse(value: unknown): TOutput | undefined;
453
+ safeParse(value: unknown): ParseResult<TOutput | undefined>;
454
+ unwrap(): VldBase<TInput, TOutput>;
455
+ }
236
456
  /**
237
457
  * Nullable validator - allows null
238
458
  */
239
459
  export declare class VldNullable<TInput, TOutput> extends VldBase<TInput | null, TOutput | null> {
240
460
  private readonly baseValidator;
461
+ private readonly simpleMode;
241
462
  constructor(baseValidator: VldBase<TInput, TOutput>);
242
463
  static create<TInput, TOutput>(baseValidator: VldBase<TInput, TOutput>): VldNullable<TInput, TOutput>;
243
464
  parse(value: unknown): TOutput | null;
@@ -249,6 +470,7 @@ export declare class VldNullable<TInput, TOutput> extends VldBase<TInput | null,
249
470
  */
250
471
  export declare class VldNullish<TInput, TOutput> extends VldBase<TInput | null | undefined, TOutput | null | undefined> {
251
472
  private readonly baseValidator;
473
+ private readonly simpleMode;
252
474
  constructor(baseValidator: VldBase<TInput, TOutput>);
253
475
  static create<TInput, TOutput>(baseValidator: VldBase<TInput, TOutput>): VldNullish<TInput, TOutput>;
254
476
  parse(value: unknown): TOutput | null | undefined;
@@ -274,6 +496,8 @@ export declare class VldSuperRefine<TInput, TOutput> extends VldBase<TInput, TOu
274
496
  constructor(_inner: VldBase<TInput, TOutput>, _refinement: (value: TOutput, ctx: SuperRefineContext) => void | Promise<void>);
275
497
  parse(value: unknown): TOutput;
276
498
  safeParse(value: unknown): ParseResult<TOutput>;
499
+ parseAsync(value: unknown): Promise<TOutput>;
500
+ safeParseAsync(value: unknown): Promise<ParseResult<TOutput>>;
277
501
  }
278
502
  /**
279
503
  * Preprocess validator - transforms input before validation
@@ -286,4 +510,3 @@ export declare class VldPreprocess<TInput, TOutput> extends VldBase<unknown, TOu
286
510
  parse(value: unknown): TOutput;
287
511
  safeParse(value: unknown): ParseResult<TOutput>;
288
512
  }
289
- //# sourceMappingURL=base.d.ts.map