bguard 0.6.0 → 0.7.1

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 (743) hide show
  1. package/README.md +589 -5
  2. package/lib/InferType.d.mts +37 -3
  3. package/lib/InferType.d.ts +37 -3
  4. package/lib/asserts/array/index.d.mts +2 -1
  5. package/lib/asserts/array/index.d.ts +2 -1
  6. package/lib/asserts/array/index.js +8 -6
  7. package/lib/asserts/array/index.js.map +1 -1
  8. package/lib/asserts/array/index.mjs +7 -5
  9. package/lib/asserts/array/maxArrayLength.d.mts +2 -1
  10. package/lib/asserts/array/maxArrayLength.d.ts +2 -1
  11. package/lib/asserts/array/maxArrayLength.js +5 -4
  12. package/lib/asserts/array/maxArrayLength.js.map +1 -1
  13. package/lib/asserts/array/maxArrayLength.mjs +4 -3
  14. package/lib/asserts/array/minArrayLength.d.mts +2 -1
  15. package/lib/asserts/array/minArrayLength.d.ts +2 -1
  16. package/lib/asserts/array/minArrayLength.js +5 -4
  17. package/lib/asserts/array/minArrayLength.js.map +1 -1
  18. package/lib/asserts/array/minArrayLength.mjs +4 -3
  19. package/lib/asserts/bigint/bigintMax.d.mts +2 -1
  20. package/lib/asserts/bigint/bigintMax.d.ts +2 -1
  21. package/lib/asserts/bigint/bigintMax.js +4 -4
  22. package/lib/asserts/bigint/bigintMax.mjs +3 -3
  23. package/lib/asserts/bigint/bigintMaxExcluded.d.mts +2 -1
  24. package/lib/asserts/bigint/bigintMaxExcluded.d.ts +2 -1
  25. package/lib/asserts/bigint/bigintMaxExcluded.js +4 -4
  26. package/lib/asserts/bigint/bigintMaxExcluded.mjs +3 -3
  27. package/lib/asserts/bigint/bigintMin.d.mts +2 -1
  28. package/lib/asserts/bigint/bigintMin.d.ts +2 -1
  29. package/lib/asserts/bigint/bigintMin.js +4 -4
  30. package/lib/asserts/bigint/bigintMin.mjs +3 -3
  31. package/lib/asserts/bigint/bigintMinExcluded.d.mts +2 -1
  32. package/lib/asserts/bigint/bigintMinExcluded.d.ts +2 -1
  33. package/lib/asserts/bigint/bigintMinExcluded.js +4 -4
  34. package/lib/asserts/bigint/bigintMinExcluded.mjs +3 -3
  35. package/lib/asserts/bigint/index.d.mts +9 -4
  36. package/lib/asserts/bigint/index.d.ts +9 -4
  37. package/lib/asserts/bigint/index.js +11 -9
  38. package/lib/asserts/bigint/index.js.map +1 -1
  39. package/lib/asserts/bigint/index.mjs +10 -8
  40. package/lib/asserts/boolean/index.d.mts +10 -3
  41. package/lib/asserts/boolean/index.d.ts +10 -3
  42. package/lib/asserts/boolean/index.js +9 -7
  43. package/lib/asserts/boolean/index.js.map +1 -1
  44. package/lib/asserts/boolean/index.mjs +8 -6
  45. package/lib/asserts/coerce/bigint.d.mts +32 -0
  46. package/lib/asserts/coerce/bigint.d.ts +32 -0
  47. package/lib/asserts/coerce/bigint.js +16 -0
  48. package/lib/asserts/coerce/bigint.js.map +1 -0
  49. package/lib/asserts/coerce/bigint.mjs +16 -0
  50. package/lib/asserts/coerce/bigint.mjs.map +1 -0
  51. package/lib/asserts/coerce/boolean.d.mts +35 -0
  52. package/lib/asserts/coerce/boolean.d.ts +35 -0
  53. package/lib/asserts/coerce/boolean.js +14 -0
  54. package/lib/asserts/coerce/boolean.js.map +1 -0
  55. package/lib/asserts/coerce/boolean.mjs +14 -0
  56. package/lib/asserts/coerce/boolean.mjs.map +1 -0
  57. package/lib/asserts/coerce/date.d.mts +32 -0
  58. package/lib/asserts/coerce/date.d.ts +32 -0
  59. package/lib/asserts/coerce/date.js +13 -0
  60. package/lib/asserts/coerce/date.js.map +1 -0
  61. package/lib/asserts/coerce/date.mjs +13 -0
  62. package/lib/asserts/coerce/date.mjs.map +1 -0
  63. package/lib/asserts/coerce/index.d.mts +41 -0
  64. package/lib/asserts/coerce/index.d.ts +41 -0
  65. package/lib/asserts/coerce/index.js +41 -0
  66. package/lib/asserts/coerce/index.js.map +1 -0
  67. package/lib/asserts/coerce/index.mjs +41 -0
  68. package/lib/asserts/coerce/index.mjs.map +1 -0
  69. package/lib/asserts/coerce/number.d.mts +33 -0
  70. package/lib/asserts/coerce/number.d.ts +33 -0
  71. package/lib/asserts/coerce/number.js +16 -0
  72. package/lib/asserts/coerce/number.js.map +1 -0
  73. package/lib/asserts/coerce/number.mjs +16 -0
  74. package/lib/asserts/coerce/number.mjs.map +1 -0
  75. package/lib/asserts/coerce/string.d.mts +30 -0
  76. package/lib/asserts/coerce/string.d.ts +30 -0
  77. package/lib/asserts/coerce/string.js +17 -0
  78. package/lib/asserts/coerce/string.js.map +1 -0
  79. package/lib/asserts/coerce/string.mjs +17 -0
  80. package/lib/asserts/coerce/string.mjs.map +1 -0
  81. package/lib/asserts/date/dateMax.d.mts +2 -1
  82. package/lib/asserts/date/dateMax.d.ts +2 -1
  83. package/lib/asserts/date/dateMax.js +4 -4
  84. package/lib/asserts/date/dateMax.mjs +3 -3
  85. package/lib/asserts/date/dateMin.d.mts +2 -1
  86. package/lib/asserts/date/dateMin.d.ts +2 -1
  87. package/lib/asserts/date/dateMin.js +4 -4
  88. package/lib/asserts/date/dateMin.mjs +3 -3
  89. package/lib/asserts/date/index.d.mts +2 -1
  90. package/lib/asserts/date/index.d.ts +2 -1
  91. package/lib/asserts/date/index.js +8 -6
  92. package/lib/asserts/date/index.js.map +1 -1
  93. package/lib/asserts/date/index.mjs +7 -5
  94. package/lib/asserts/intersection/index.d.mts +36 -0
  95. package/lib/asserts/intersection/index.d.ts +36 -0
  96. package/lib/asserts/intersection/index.js +13 -0
  97. package/lib/asserts/intersection/index.js.map +1 -0
  98. package/lib/asserts/intersection/index.mjs +13 -0
  99. package/lib/asserts/intersection/index.mjs.map +1 -0
  100. package/lib/asserts/lazy/index.d.mts +42 -0
  101. package/lib/asserts/lazy/index.d.ts +42 -0
  102. package/lib/asserts/lazy/index.js +12 -0
  103. package/lib/asserts/lazy/index.js.map +1 -0
  104. package/lib/asserts/lazy/index.mjs +12 -0
  105. package/lib/asserts/lazy/index.mjs.map +1 -0
  106. package/lib/asserts/mix/equalTo.d.mts +2 -1
  107. package/lib/asserts/mix/equalTo.d.ts +2 -1
  108. package/lib/asserts/mix/equalTo.js +4 -4
  109. package/lib/asserts/mix/equalTo.mjs +3 -3
  110. package/lib/asserts/mix/index.d.mts +10 -3
  111. package/lib/asserts/mix/index.d.ts +10 -3
  112. package/lib/asserts/mix/index.js +6 -6
  113. package/lib/asserts/mix/index.mjs +5 -5
  114. package/lib/asserts/mix/oneOfValues.d.mts +2 -1
  115. package/lib/asserts/mix/oneOfValues.d.ts +2 -1
  116. package/lib/asserts/mix/oneOfValues.js +4 -4
  117. package/lib/asserts/mix/oneOfValues.mjs +3 -3
  118. package/lib/asserts/number/index.d.mts +4 -3
  119. package/lib/asserts/number/index.d.ts +4 -3
  120. package/lib/asserts/number/index.js +11 -9
  121. package/lib/asserts/number/index.js.map +1 -1
  122. package/lib/asserts/number/index.mjs +10 -8
  123. package/lib/asserts/number/max.d.mts +2 -1
  124. package/lib/asserts/number/max.d.ts +2 -1
  125. package/lib/asserts/number/max.js +5 -4
  126. package/lib/asserts/number/max.js.map +1 -1
  127. package/lib/asserts/number/max.mjs +4 -3
  128. package/lib/asserts/number/maxExcluded.d.mts +2 -1
  129. package/lib/asserts/number/maxExcluded.d.ts +2 -1
  130. package/lib/asserts/number/maxExcluded.js +5 -4
  131. package/lib/asserts/number/maxExcluded.js.map +1 -1
  132. package/lib/asserts/number/maxExcluded.mjs +4 -3
  133. package/lib/asserts/number/min.d.mts +2 -1
  134. package/lib/asserts/number/min.d.ts +2 -1
  135. package/lib/asserts/number/min.js +5 -4
  136. package/lib/asserts/number/min.js.map +1 -1
  137. package/lib/asserts/number/min.mjs +4 -3
  138. package/lib/asserts/number/minExcluded.d.mts +2 -1
  139. package/lib/asserts/number/minExcluded.d.ts +2 -1
  140. package/lib/asserts/number/minExcluded.js +5 -4
  141. package/lib/asserts/number/minExcluded.js.map +1 -1
  142. package/lib/asserts/number/minExcluded.mjs +4 -3
  143. package/lib/asserts/number/negative.d.mts +2 -1
  144. package/lib/asserts/number/negative.d.ts +2 -1
  145. package/lib/asserts/number/negative.js +5 -4
  146. package/lib/asserts/number/negative.js.map +1 -1
  147. package/lib/asserts/number/negative.mjs +4 -3
  148. package/lib/asserts/number/positive.d.mts +2 -1
  149. package/lib/asserts/number/positive.d.ts +2 -1
  150. package/lib/asserts/number/positive.js +5 -4
  151. package/lib/asserts/number/positive.js.map +1 -1
  152. package/lib/asserts/number/positive.mjs +4 -3
  153. package/lib/asserts/object/extend.d.mts +29 -0
  154. package/lib/asserts/object/extend.d.ts +29 -0
  155. package/lib/asserts/object/extend.js +14 -0
  156. package/lib/asserts/object/extend.js.map +1 -0
  157. package/lib/asserts/object/extend.mjs +14 -0
  158. package/lib/asserts/object/extend.mjs.map +1 -0
  159. package/lib/asserts/object/index.d.mts +3 -2
  160. package/lib/asserts/object/index.d.ts +3 -2
  161. package/lib/asserts/object/index.js +8 -6
  162. package/lib/asserts/object/index.js.map +1 -1
  163. package/lib/asserts/object/index.mjs +7 -5
  164. package/lib/asserts/object/maxKeys.d.mts +2 -1
  165. package/lib/asserts/object/maxKeys.d.ts +2 -1
  166. package/lib/asserts/object/maxKeys.js +5 -4
  167. package/lib/asserts/object/maxKeys.js.map +1 -1
  168. package/lib/asserts/object/maxKeys.mjs +4 -3
  169. package/lib/asserts/object/omit.d.mts +27 -0
  170. package/lib/asserts/object/omit.d.ts +27 -0
  171. package/lib/asserts/object/omit.js +14 -0
  172. package/lib/asserts/object/omit.js.map +1 -0
  173. package/lib/asserts/object/omit.mjs +14 -0
  174. package/lib/asserts/object/omit.mjs.map +1 -0
  175. package/lib/asserts/object/partial.d.mts +34 -0
  176. package/lib/asserts/object/partial.d.ts +34 -0
  177. package/lib/asserts/object/partial.js +14 -0
  178. package/lib/asserts/object/partial.js.map +1 -0
  179. package/lib/asserts/object/partial.mjs +14 -0
  180. package/lib/asserts/object/partial.mjs.map +1 -0
  181. package/lib/asserts/object/pick.d.mts +32 -0
  182. package/lib/asserts/object/pick.d.ts +32 -0
  183. package/lib/asserts/object/pick.js +17 -0
  184. package/lib/asserts/object/pick.js.map +1 -0
  185. package/lib/asserts/object/pick.mjs +17 -0
  186. package/lib/asserts/object/pick.mjs.map +1 -0
  187. package/lib/asserts/object/required.d.mts +39 -0
  188. package/lib/asserts/object/required.d.ts +39 -0
  189. package/lib/asserts/object/required.js +14 -0
  190. package/lib/asserts/object/required.js.map +1 -0
  191. package/lib/asserts/object/required.mjs +14 -0
  192. package/lib/asserts/object/required.mjs.map +1 -0
  193. package/lib/asserts/record/index.d.mts +28 -0
  194. package/lib/asserts/record/index.d.ts +28 -0
  195. package/lib/asserts/record/index.js +12 -0
  196. package/lib/asserts/record/index.js.map +1 -0
  197. package/lib/asserts/record/index.mjs +12 -0
  198. package/lib/asserts/record/index.mjs.map +1 -0
  199. package/lib/asserts/string/atLeastOneDigit.d.mts +2 -1
  200. package/lib/asserts/string/atLeastOneDigit.d.ts +2 -1
  201. package/lib/asserts/string/atLeastOneDigit.js +4 -4
  202. package/lib/asserts/string/atLeastOneDigit.mjs +3 -3
  203. package/lib/asserts/string/atLeastOneLowerChar.d.mts +2 -1
  204. package/lib/asserts/string/atLeastOneLowerChar.d.ts +2 -1
  205. package/lib/asserts/string/atLeastOneLowerChar.js +4 -4
  206. package/lib/asserts/string/atLeastOneLowerChar.mjs +3 -3
  207. package/lib/asserts/string/atLeastOneSpecialChar.d.mts +2 -1
  208. package/lib/asserts/string/atLeastOneSpecialChar.d.ts +2 -1
  209. package/lib/asserts/string/atLeastOneSpecialChar.js +4 -4
  210. package/lib/asserts/string/atLeastOneSpecialChar.mjs +3 -3
  211. package/lib/asserts/string/atLeastOneUpperChar.d.mts +2 -1
  212. package/lib/asserts/string/atLeastOneUpperChar.d.ts +2 -1
  213. package/lib/asserts/string/atLeastOneUpperChar.js +4 -4
  214. package/lib/asserts/string/atLeastOneUpperChar.mjs +3 -3
  215. package/lib/asserts/string/contains.d.mts +2 -1
  216. package/lib/asserts/string/contains.d.ts +2 -1
  217. package/lib/asserts/string/contains.js +4 -4
  218. package/lib/asserts/string/contains.mjs +3 -3
  219. package/lib/asserts/string/email.d.mts +2 -1
  220. package/lib/asserts/string/email.d.ts +2 -1
  221. package/lib/asserts/string/email.js +5 -4
  222. package/lib/asserts/string/email.js.map +1 -1
  223. package/lib/asserts/string/email.mjs +4 -3
  224. package/lib/asserts/string/endsWith.d.mts +2 -1
  225. package/lib/asserts/string/endsWith.d.ts +2 -1
  226. package/lib/asserts/string/endsWith.js +4 -4
  227. package/lib/asserts/string/endsWith.mjs +3 -3
  228. package/lib/asserts/string/index.d.mts +9 -4
  229. package/lib/asserts/string/index.d.ts +9 -4
  230. package/lib/asserts/string/index.js +12 -9
  231. package/lib/asserts/string/index.js.map +1 -1
  232. package/lib/asserts/string/index.mjs +11 -8
  233. package/lib/asserts/string/isValidDate.d.mts +2 -1
  234. package/lib/asserts/string/isValidDate.d.ts +2 -1
  235. package/lib/asserts/string/isValidDate.js +5 -4
  236. package/lib/asserts/string/isValidDate.js.map +1 -1
  237. package/lib/asserts/string/isValidDate.mjs +4 -3
  238. package/lib/asserts/string/isValidDateTime.d.mts +2 -1
  239. package/lib/asserts/string/isValidDateTime.d.ts +2 -1
  240. package/lib/asserts/string/isValidDateTime.js +5 -4
  241. package/lib/asserts/string/isValidDateTime.js.map +1 -1
  242. package/lib/asserts/string/isValidDateTime.mjs +4 -3
  243. package/lib/asserts/string/isValidTime.d.mts +2 -1
  244. package/lib/asserts/string/isValidTime.d.ts +2 -1
  245. package/lib/asserts/string/isValidTime.js +5 -4
  246. package/lib/asserts/string/isValidTime.js.map +1 -1
  247. package/lib/asserts/string/isValidTime.mjs +4 -3
  248. package/lib/asserts/string/lowerCase.d.mts +2 -1
  249. package/lib/asserts/string/lowerCase.d.ts +2 -1
  250. package/lib/asserts/string/lowerCase.js +4 -4
  251. package/lib/asserts/string/lowerCase.mjs +3 -3
  252. package/lib/asserts/string/maxLength.d.mts +2 -1
  253. package/lib/asserts/string/maxLength.d.ts +2 -1
  254. package/lib/asserts/string/maxLength.js +5 -4
  255. package/lib/asserts/string/maxLength.js.map +1 -1
  256. package/lib/asserts/string/maxLength.mjs +4 -3
  257. package/lib/asserts/string/minLength.d.mts +2 -1
  258. package/lib/asserts/string/minLength.d.ts +2 -1
  259. package/lib/asserts/string/minLength.js +5 -4
  260. package/lib/asserts/string/minLength.js.map +1 -1
  261. package/lib/asserts/string/minLength.mjs +4 -3
  262. package/lib/asserts/string/regExp.d.mts +2 -1
  263. package/lib/asserts/string/regExp.d.ts +2 -1
  264. package/lib/asserts/string/regExp.js +5 -4
  265. package/lib/asserts/string/regExp.js.map +1 -1
  266. package/lib/asserts/string/regExp.mjs +4 -3
  267. package/lib/asserts/string/startsWith.d.mts +2 -1
  268. package/lib/asserts/string/startsWith.d.ts +2 -1
  269. package/lib/asserts/string/startsWith.js +4 -4
  270. package/lib/asserts/string/startsWith.mjs +3 -3
  271. package/lib/asserts/string/upperCase.d.mts +2 -1
  272. package/lib/asserts/string/upperCase.d.ts +2 -1
  273. package/lib/asserts/string/upperCase.js +4 -4
  274. package/lib/asserts/string/upperCase.mjs +3 -3
  275. package/lib/asserts/string/uuid.d.mts +2 -1
  276. package/lib/asserts/string/uuid.d.ts +2 -1
  277. package/lib/asserts/string/uuid.js +5 -4
  278. package/lib/asserts/string/uuid.js.map +1 -1
  279. package/lib/asserts/string/uuid.mjs +4 -3
  280. package/lib/asserts/string/uuidV1.d.mts +2 -1
  281. package/lib/asserts/string/uuidV1.d.ts +2 -1
  282. package/lib/asserts/string/uuidV1.js +4 -4
  283. package/lib/asserts/string/uuidV1.mjs +3 -3
  284. package/lib/asserts/string/uuidV2.d.mts +2 -1
  285. package/lib/asserts/string/uuidV2.d.ts +2 -1
  286. package/lib/asserts/string/uuidV2.js +4 -4
  287. package/lib/asserts/string/uuidV2.mjs +3 -3
  288. package/lib/asserts/string/uuidV3.d.mts +2 -1
  289. package/lib/asserts/string/uuidV3.d.ts +2 -1
  290. package/lib/asserts/string/uuidV3.js +4 -4
  291. package/lib/asserts/string/uuidV3.mjs +3 -3
  292. package/lib/asserts/string/uuidV4.d.mts +2 -1
  293. package/lib/asserts/string/uuidV4.d.ts +2 -1
  294. package/lib/asserts/string/uuidV4.js +4 -4
  295. package/lib/asserts/string/uuidV4.mjs +3 -3
  296. package/lib/asserts/string/uuidV5.d.mts +2 -1
  297. package/lib/asserts/string/uuidV5.d.ts +2 -1
  298. package/lib/asserts/string/uuidV5.js +4 -4
  299. package/lib/asserts/string/uuidV5.mjs +3 -3
  300. package/lib/asserts/string/validUrl.d.mts +2 -1
  301. package/lib/asserts/string/validUrl.d.ts +2 -1
  302. package/lib/asserts/string/validUrl.js +5 -4
  303. package/lib/asserts/string/validUrl.js.map +1 -1
  304. package/lib/asserts/string/validUrl.mjs +4 -3
  305. package/lib/asserts/tuple/index.d.mts +28 -0
  306. package/lib/asserts/tuple/index.d.ts +28 -0
  307. package/lib/asserts/tuple/index.js +12 -0
  308. package/lib/asserts/tuple/index.js.map +1 -0
  309. package/lib/asserts/tuple/index.mjs +12 -0
  310. package/lib/asserts/tuple/index.mjs.map +1 -0
  311. package/lib/asserts/union/index.d.mts +29 -0
  312. package/lib/asserts/union/index.d.ts +29 -0
  313. package/lib/asserts/union/index.js +12 -0
  314. package/lib/asserts/union/index.js.map +1 -0
  315. package/lib/asserts/union/index.mjs +12 -0
  316. package/lib/asserts/union/index.mjs.map +1 -0
  317. package/lib/chunk-23R5R7PL.js +69 -0
  318. package/lib/chunk-23R5R7PL.js.map +1 -0
  319. package/lib/{chunk-Y5MNJGFX.js → chunk-2AYQ7GRP.js} +9 -6
  320. package/lib/chunk-2AYQ7GRP.js.map +1 -0
  321. package/lib/{chunk-OMSHZITC.js → chunk-2KLV3CHA.js} +3 -3
  322. package/lib/{chunk-OMSHZITC.js.map → chunk-2KLV3CHA.js.map} +1 -1
  323. package/lib/{chunk-MHWPSQB3.js → chunk-2X6V3ODY.js} +3 -3
  324. package/lib/{chunk-MHWPSQB3.js.map → chunk-2X6V3ODY.js.map} +1 -1
  325. package/lib/{chunk-QIFA6S5U.mjs → chunk-346TIMNH.mjs} +2 -2
  326. package/lib/{chunk-QIFA6S5U.mjs.map → chunk-346TIMNH.mjs.map} +1 -1
  327. package/lib/{chunk-PAV4SQQL.js → chunk-3D6TPN7F.js} +3 -3
  328. package/lib/{chunk-PAV4SQQL.js.map → chunk-3D6TPN7F.js.map} +1 -1
  329. package/lib/{chunk-4UPXP4I3.js → chunk-3OAUE5VW.js} +8 -5
  330. package/lib/chunk-3OAUE5VW.js.map +1 -0
  331. package/lib/chunk-3PTVMZY7.js +22 -0
  332. package/lib/chunk-3PTVMZY7.js.map +1 -0
  333. package/lib/{chunk-QEG24G7E.mjs → chunk-3T5QKF7X.mjs} +2 -2
  334. package/lib/{chunk-QEG24G7E.mjs.map → chunk-3T5QKF7X.mjs.map} +1 -1
  335. package/lib/{chunk-FI737YZJ.js → chunk-45K4AUO3.js} +9 -6
  336. package/lib/chunk-45K4AUO3.js.map +1 -0
  337. package/lib/{chunk-PNSDUVRE.mjs → chunk-4AZOGLHD.mjs} +2 -2
  338. package/lib/{chunk-PNSDUVRE.mjs.map → chunk-4AZOGLHD.mjs.map} +1 -1
  339. package/lib/chunk-4PPMVVQY.js +67 -0
  340. package/lib/chunk-4PPMVVQY.js.map +1 -0
  341. package/lib/{chunk-HWVM4SYU.mjs → chunk-54F462SS.mjs} +7 -4
  342. package/lib/chunk-54F462SS.mjs.map +1 -0
  343. package/lib/{chunk-S4FWDTEW.mjs → chunk-55P4YTMX.mjs} +2 -2
  344. package/lib/{chunk-S4FWDTEW.mjs.map → chunk-55P4YTMX.mjs.map} +1 -1
  345. package/lib/chunk-56TWNROC.js +20 -0
  346. package/lib/chunk-56TWNROC.js.map +1 -0
  347. package/lib/chunk-5PIGAEGL.mjs +22 -0
  348. package/lib/chunk-5PIGAEGL.mjs.map +1 -0
  349. package/lib/{chunk-NFD7D5GZ.mjs → chunk-5PXMSVTE.mjs} +30 -22
  350. package/lib/chunk-5PXMSVTE.mjs.map +1 -0
  351. package/lib/{chunk-ZGUF5ZDP.mjs → chunk-5U5CYDRB.mjs} +2 -2
  352. package/lib/{chunk-ZGUF5ZDP.mjs.map → chunk-5U5CYDRB.mjs.map} +1 -1
  353. package/lib/{chunk-V7C77FML.mjs → chunk-5WLWZKC6.mjs} +7 -4
  354. package/lib/chunk-5WLWZKC6.mjs.map +1 -0
  355. package/lib/{chunk-GFWZQ4XW.mjs → chunk-5WV7FMW7.mjs} +8 -5
  356. package/lib/chunk-5WV7FMW7.mjs.map +1 -0
  357. package/lib/{chunk-OE3L7EKN.mjs → chunk-65X7NTUS.mjs} +18 -9
  358. package/lib/chunk-65X7NTUS.mjs.map +1 -0
  359. package/lib/chunk-6LUSV3SS.js +595 -0
  360. package/lib/chunk-6LUSV3SS.js.map +1 -0
  361. package/lib/{chunk-BRFUFNU4.js → chunk-7A4RN5UD.js} +9 -6
  362. package/lib/chunk-7A4RN5UD.js.map +1 -0
  363. package/lib/{chunk-ENZ5WDUQ.js → chunk-7CNZKYPM.js} +8 -5
  364. package/lib/chunk-7CNZKYPM.js.map +1 -0
  365. package/lib/{chunk-NS4GXUCA.mjs → chunk-7F4P72SG.mjs} +2 -2
  366. package/lib/{chunk-NS4GXUCA.mjs.map → chunk-7F4P72SG.mjs.map} +1 -1
  367. package/lib/{chunk-6WKSLMJG.mjs → chunk-A2LPSUNQ.mjs} +8 -7
  368. package/lib/{chunk-6WKSLMJG.mjs.map → chunk-A2LPSUNQ.mjs.map} +1 -1
  369. package/lib/chunk-A36G62K5.mjs +49 -0
  370. package/lib/chunk-A36G62K5.mjs.map +1 -0
  371. package/lib/{chunk-24LO7MNY.js → chunk-A5OEVSSV.js} +8 -5
  372. package/lib/chunk-A5OEVSSV.js.map +1 -0
  373. package/lib/{chunk-KRCOKWAB.mjs → chunk-ABSZMCDX.mjs} +8 -5
  374. package/lib/chunk-ABSZMCDX.mjs.map +1 -0
  375. package/lib/chunk-AGB5RWYD.js +32 -0
  376. package/lib/chunk-AGB5RWYD.js.map +1 -0
  377. package/lib/{chunk-PVQALO2H.js → chunk-ALXDH7GS.js} +3 -3
  378. package/lib/{chunk-PVQALO2H.js.map → chunk-ALXDH7GS.js.map} +1 -1
  379. package/lib/chunk-AO6DKPJZ.js +49 -0
  380. package/lib/chunk-AO6DKPJZ.js.map +1 -0
  381. package/lib/{chunk-TQDMUHTA.mjs → chunk-AYJCGPXI.mjs} +2 -2
  382. package/lib/{chunk-TQDMUHTA.mjs.map → chunk-AYJCGPXI.mjs.map} +1 -1
  383. package/lib/{chunk-OSFIPFQ3.mjs → chunk-AYSJLD4S.mjs} +5 -5
  384. package/lib/{chunk-OSFIPFQ3.mjs.map → chunk-AYSJLD4S.mjs.map} +1 -1
  385. package/lib/chunk-B3IWQRZF.mjs +22 -0
  386. package/lib/chunk-B3IWQRZF.mjs.map +1 -0
  387. package/lib/{chunk-DCPRPCZ3.js → chunk-B4WB3UB7.js} +3 -3
  388. package/lib/{chunk-DCPRPCZ3.js.map → chunk-B4WB3UB7.js.map} +1 -1
  389. package/lib/chunk-BZ6R6RWE.mjs +19 -0
  390. package/lib/chunk-BZ6R6RWE.mjs.map +1 -0
  391. package/lib/{chunk-MCQHWS3E.mjs → chunk-C6ICGQEX.mjs} +7 -4
  392. package/lib/chunk-C6ICGQEX.mjs.map +1 -0
  393. package/lib/{chunk-2ANPCB4O.mjs → chunk-C76DLZFD.mjs} +2 -2
  394. package/lib/{chunk-2ANPCB4O.mjs.map → chunk-C76DLZFD.mjs.map} +1 -1
  395. package/lib/chunk-CLRHVTVY.js +50 -0
  396. package/lib/chunk-CLRHVTVY.js.map +1 -0
  397. package/lib/{chunk-QMIH3A4D.js → chunk-CWYS6MUA.js} +3 -3
  398. package/lib/{chunk-QMIH3A4D.js.map → chunk-CWYS6MUA.js.map} +1 -1
  399. package/lib/{chunk-W3U7RYLP.mjs → chunk-D42AL6CN.mjs} +2 -2
  400. package/lib/{chunk-W3U7RYLP.mjs.map → chunk-D42AL6CN.mjs.map} +1 -1
  401. package/lib/{chunk-YDTQASAY.mjs → chunk-D4YY45O2.mjs} +8 -5
  402. package/lib/chunk-D4YY45O2.mjs.map +1 -0
  403. package/lib/{chunk-WLPDAJB3.js → chunk-DKGRAVID.js} +29 -11
  404. package/lib/chunk-DKGRAVID.js.map +1 -0
  405. package/lib/{chunk-TZBAW5OO.mjs → chunk-DLEDKNPD.mjs} +2 -2
  406. package/lib/{chunk-TZBAW5OO.mjs.map → chunk-DLEDKNPD.mjs.map} +1 -1
  407. package/lib/{chunk-OZ3BTSSQ.mjs → chunk-DS2LUTTF.mjs} +23 -20
  408. package/lib/chunk-DS2LUTTF.mjs.map +1 -0
  409. package/lib/{chunk-6JPYR2TS.js → chunk-ECLNZ233.js} +9 -6
  410. package/lib/chunk-ECLNZ233.js.map +1 -0
  411. package/lib/chunk-EEKYR5IA.js +19 -0
  412. package/lib/chunk-EEKYR5IA.js.map +1 -0
  413. package/lib/chunk-EI6TQG4L.js +80 -0
  414. package/lib/chunk-EI6TQG4L.js.map +1 -0
  415. package/lib/{chunk-6LPQRAFN.js → chunk-EN745GWN.js} +10 -7
  416. package/lib/chunk-EN745GWN.js.map +1 -0
  417. package/lib/chunk-ET2I4EXQ.mjs +18 -0
  418. package/lib/chunk-ET2I4EXQ.mjs.map +1 -0
  419. package/lib/{chunk-OFZMO7PB.mjs → chunk-ETBJ4NF4.mjs} +7 -4
  420. package/lib/chunk-ETBJ4NF4.mjs.map +1 -0
  421. package/lib/chunk-FA3S35LQ.mjs +20 -0
  422. package/lib/chunk-FA3S35LQ.mjs.map +1 -0
  423. package/lib/{chunk-23QTSXPQ.js → chunk-FJEBPEGR.js} +8 -5
  424. package/lib/chunk-FJEBPEGR.js.map +1 -0
  425. package/lib/chunk-FTHEF6SB.js +14 -0
  426. package/lib/{chunk-XDVSL5B6.js.map → chunk-FTHEF6SB.js.map} +1 -1
  427. package/lib/{chunk-WYM2TIVW.mjs → chunk-FU5WAVRB.mjs} +5 -4
  428. package/lib/{chunk-WYM2TIVW.mjs.map → chunk-FU5WAVRB.mjs.map} +1 -1
  429. package/lib/chunk-G2VC3SQB.js +22 -0
  430. package/lib/chunk-G2VC3SQB.js.map +1 -0
  431. package/lib/{chunk-NOJB5GBZ.mjs → chunk-G6YZVGWC.mjs} +8 -5
  432. package/lib/chunk-G6YZVGWC.mjs.map +1 -0
  433. package/lib/{chunk-Z2HZXSDA.js → chunk-GSLVYDXO.js} +3 -3
  434. package/lib/{chunk-Z2HZXSDA.js.map → chunk-GSLVYDXO.js.map} +1 -1
  435. package/lib/{chunk-H4OW6OUF.js → chunk-GTGXSQKC.js} +3 -3
  436. package/lib/{chunk-H4OW6OUF.js.map → chunk-GTGXSQKC.js.map} +1 -1
  437. package/lib/{chunk-Z3NPFUIA.mjs → chunk-H3FXZTYS.mjs} +2 -2
  438. package/lib/{chunk-Z3NPFUIA.mjs.map → chunk-H3FXZTYS.mjs.map} +1 -1
  439. package/lib/{chunk-T2A3XXQZ.mjs → chunk-HKDDJSN2.mjs} +8 -5
  440. package/lib/chunk-HKDDJSN2.mjs.map +1 -0
  441. package/lib/chunk-HU5SDECP.js +29 -0
  442. package/lib/chunk-HU5SDECP.js.map +1 -0
  443. package/lib/{chunk-THU5VBSO.mjs → chunk-IIL6D2UL.mjs} +2 -2
  444. package/lib/{chunk-AJHBPMZT.mjs → chunk-IWNVHB2K.mjs} +8 -5
  445. package/lib/chunk-IWNVHB2K.mjs.map +1 -0
  446. package/lib/{chunk-UYQFYQQG.mjs → chunk-J3EKIWPZ.mjs} +33 -22
  447. package/lib/chunk-J3EKIWPZ.mjs.map +1 -0
  448. package/lib/chunk-JCX2TB7E.js +13 -0
  449. package/lib/chunk-JCX2TB7E.js.map +1 -0
  450. package/lib/{chunk-2ESDKTV4.js → chunk-JF7KZZ7R.js} +9 -6
  451. package/lib/chunk-JF7KZZ7R.js.map +1 -0
  452. package/lib/chunk-JHONMWCE.js +27 -0
  453. package/lib/chunk-JHONMWCE.js.map +1 -0
  454. package/lib/{chunk-DED5KDLM.js → chunk-JLEQOYDW.js} +15 -13
  455. package/lib/chunk-JLEQOYDW.js.map +1 -0
  456. package/lib/{chunk-HD37VXPZ.mjs → chunk-JND3VAPR.mjs} +2 -2
  457. package/lib/{chunk-HD37VXPZ.mjs.map → chunk-JND3VAPR.mjs.map} +1 -1
  458. package/lib/chunk-K4YXIN2V.mjs +33 -0
  459. package/lib/chunk-K4YXIN2V.mjs.map +1 -0
  460. package/lib/{chunk-NY2TPU6O.mjs → chunk-K6QYFFMX.mjs} +8 -5
  461. package/lib/chunk-K6QYFFMX.mjs.map +1 -0
  462. package/lib/chunk-K7CDOU6F.js +13 -0
  463. package/lib/chunk-K7CDOU6F.js.map +1 -0
  464. package/lib/{chunk-M3HYPZLE.mjs → chunk-KAFZGQ2W.mjs} +10 -8
  465. package/lib/chunk-KAFZGQ2W.mjs.map +1 -0
  466. package/lib/chunk-KALHMMEN.mjs +29 -0
  467. package/lib/chunk-KALHMMEN.mjs.map +1 -0
  468. package/lib/{chunk-DFYP4GKE.js → chunk-KDPYWGMJ.js} +8 -5
  469. package/lib/chunk-KDPYWGMJ.js.map +1 -0
  470. package/lib/chunk-KGXWQ3XP.mjs +69 -0
  471. package/lib/chunk-KGXWQ3XP.mjs.map +1 -0
  472. package/lib/{chunk-R25HSJPH.js → chunk-KIVIWBIY.js} +3 -3
  473. package/lib/{chunk-R25HSJPH.js.map → chunk-KIVIWBIY.js.map} +1 -1
  474. package/lib/{chunk-ZNQHNLKW.js → chunk-KZBW5WCK.js} +8 -5
  475. package/lib/chunk-KZBW5WCK.js.map +1 -0
  476. package/lib/{chunk-VVXKATDH.js → chunk-L36PQXUB.js} +8 -5
  477. package/lib/chunk-L36PQXUB.js.map +1 -0
  478. package/lib/chunk-LDZFOOWN.mjs +595 -0
  479. package/lib/chunk-LDZFOOWN.mjs.map +1 -0
  480. package/lib/{chunk-AXKX5BGH.js → chunk-LHEU4XAC.js} +2 -2
  481. package/lib/chunk-LHEU4XAC.js.map +1 -0
  482. package/lib/chunk-LNBZ7SJR.js +26 -0
  483. package/lib/chunk-LNBZ7SJR.js.map +1 -0
  484. package/lib/{chunk-AQCV7PB4.mjs → chunk-M7EMQU7U.mjs} +5 -5
  485. package/lib/{chunk-AQCV7PB4.mjs.map → chunk-M7EMQU7U.mjs.map} +1 -1
  486. package/lib/{chunk-GGWJJFXY.mjs → chunk-MOHROZTD.mjs} +2 -2
  487. package/lib/{chunk-GGWJJFXY.mjs.map → chunk-MOHROZTD.mjs.map} +1 -1
  488. package/lib/{chunk-SBO6OQIX.mjs → chunk-MQGE7GIK.mjs} +8 -5
  489. package/lib/chunk-MQGE7GIK.mjs.map +1 -0
  490. package/lib/chunk-MUXY6Q45.mjs +13 -0
  491. package/lib/chunk-MUXY6Q45.mjs.map +1 -0
  492. package/lib/{chunk-H2M4FCRZ.mjs → chunk-NC7E2FQR.mjs} +2 -2
  493. package/lib/{chunk-H2M4FCRZ.mjs.map → chunk-NC7E2FQR.mjs.map} +1 -1
  494. package/lib/chunk-NM3VRT77.mjs +120 -0
  495. package/lib/chunk-NM3VRT77.mjs.map +1 -0
  496. package/lib/{chunk-OHUOBIHX.mjs → chunk-NM4TCTZM.mjs} +28 -10
  497. package/lib/chunk-NM4TCTZM.mjs.map +1 -0
  498. package/lib/chunk-NXS5ULAJ.mjs +22 -0
  499. package/lib/chunk-NXS5ULAJ.mjs.map +1 -0
  500. package/lib/{chunk-2D3HCTJV.js → chunk-NZOANK7A.js} +3 -3
  501. package/lib/{chunk-2D3HCTJV.js.map → chunk-NZOANK7A.js.map} +1 -1
  502. package/lib/{chunk-ZTCXXAKD.mjs → chunk-O2WD4JBG.mjs} +8 -2
  503. package/lib/chunk-O2WD4JBG.mjs.map +1 -0
  504. package/lib/chunk-O4FVL7CA.js +33 -0
  505. package/lib/chunk-O4FVL7CA.js.map +1 -0
  506. package/lib/{chunk-ARIYSQMH.js → chunk-OHJ2EB4T.js} +3 -3
  507. package/lib/{chunk-ARIYSQMH.js.map → chunk-OHJ2EB4T.js.map} +1 -1
  508. package/lib/{chunk-TLPVFRWR.js → chunk-OPA6AXSH.js} +3 -3
  509. package/lib/{chunk-TLPVFRWR.js.map → chunk-OPA6AXSH.js.map} +1 -1
  510. package/lib/chunk-OQB5UGWG.mjs +24 -0
  511. package/lib/chunk-OQB5UGWG.mjs.map +1 -0
  512. package/lib/{chunk-3W2COCXV.js → chunk-ORQBVFHY.js} +3 -3
  513. package/lib/{chunk-3W2COCXV.js.map → chunk-ORQBVFHY.js.map} +1 -1
  514. package/lib/{chunk-C44KAKMR.js → chunk-OW7RK5YW.js} +3 -3
  515. package/lib/{chunk-C44KAKMR.js.map → chunk-OW7RK5YW.js.map} +1 -1
  516. package/lib/{chunk-22254THF.mjs → chunk-OY5DJBRV.mjs} +2 -2
  517. package/lib/{chunk-22254THF.mjs.map → chunk-OY5DJBRV.mjs.map} +1 -1
  518. package/lib/chunk-P2SQQBVB.js +22 -0
  519. package/lib/chunk-P2SQQBVB.js.map +1 -0
  520. package/lib/chunk-P6CI5ITJ.js +22 -0
  521. package/lib/chunk-P6CI5ITJ.js.map +1 -0
  522. package/lib/{chunk-2IPGGARK.mjs → chunk-P6M6QZU5.mjs} +7 -4
  523. package/lib/chunk-P6M6QZU5.mjs.map +1 -0
  524. package/lib/{chunk-Y54K6TQO.js → chunk-PFADKWMO.js} +3 -3
  525. package/lib/{chunk-Y54K6TQO.js.map → chunk-PFADKWMO.js.map} +1 -1
  526. package/lib/chunk-POPLWPM4.mjs +19 -0
  527. package/lib/chunk-POPLWPM4.mjs.map +1 -0
  528. package/lib/{chunk-VOFKYSJD.js → chunk-POQZCV3D.js} +3 -3
  529. package/lib/{chunk-VOFKYSJD.js.map → chunk-POQZCV3D.js.map} +1 -1
  530. package/lib/{chunk-M2GOQ7TZ.mjs → chunk-QM4MJTTD.mjs} +7 -4
  531. package/lib/chunk-QM4MJTTD.mjs.map +1 -0
  532. package/lib/{chunk-WJGXVKZY.js → chunk-QNA4O6AU.js} +3 -3
  533. package/lib/{chunk-WJGXVKZY.js.map → chunk-QNA4O6AU.js.map} +1 -1
  534. package/lib/{chunk-ZDXO3TGZ.mjs → chunk-RCD6EO4Q.mjs} +7 -4
  535. package/lib/chunk-RCD6EO4Q.mjs.map +1 -0
  536. package/lib/{chunk-ZEGRYDE5.mjs → chunk-RDJK3X4J.mjs} +8 -5
  537. package/lib/chunk-RDJK3X4J.mjs.map +1 -0
  538. package/lib/{chunk-4N5J426R.mjs → chunk-RXU74KSN.mjs} +2 -2
  539. package/lib/{chunk-4N5J426R.mjs.map → chunk-RXU74KSN.mjs.map} +1 -1
  540. package/lib/{chunk-S5D5AFDF.js → chunk-S6N4N4FT.js} +9 -6
  541. package/lib/chunk-S6N4N4FT.js.map +1 -0
  542. package/lib/chunk-SBNUNRI3.mjs +13 -0
  543. package/lib/chunk-SBNUNRI3.mjs.map +1 -0
  544. package/lib/{chunk-SFIX77W5.js → chunk-SGWF66HS.js} +3 -3
  545. package/lib/{chunk-SFIX77W5.js.map → chunk-SGWF66HS.js.map} +1 -1
  546. package/lib/{chunk-OU5BTUDV.mjs → chunk-SKMDZ4S6.mjs} +2 -2
  547. package/lib/{chunk-OU5BTUDV.mjs.map → chunk-SKMDZ4S6.mjs.map} +1 -1
  548. package/lib/chunk-SVRCKC65.js +120 -0
  549. package/lib/chunk-SVRCKC65.js.map +1 -0
  550. package/lib/{chunk-OQYS7JVF.js → chunk-SY2V2V54.js} +6 -6
  551. package/lib/{chunk-OQYS7JVF.js.map → chunk-SY2V2V54.js.map} +1 -1
  552. package/lib/{chunk-YMPRYKNY.js → chunk-SZO4SUUG.js} +9 -6
  553. package/lib/chunk-SZO4SUUG.js.map +1 -0
  554. package/lib/chunk-TCHVA6VG.js +24 -0
  555. package/lib/chunk-TCHVA6VG.js.map +1 -0
  556. package/lib/chunk-TD3Y3IV3.js +13 -0
  557. package/lib/chunk-TD3Y3IV3.js.map +1 -0
  558. package/lib/{chunk-C2VSTWID.js → chunk-TJ7IQSHU.js} +9 -6
  559. package/lib/chunk-TJ7IQSHU.js.map +1 -0
  560. package/lib/{chunk-7JL66G7G.mjs → chunk-TPSWNY5K.mjs} +2 -2
  561. package/lib/{chunk-7JL66G7G.mjs.map → chunk-TPSWNY5K.mjs.map} +1 -1
  562. package/lib/chunk-UCY3HEYZ.mjs +13 -0
  563. package/lib/chunk-UCY3HEYZ.mjs.map +1 -0
  564. package/lib/{chunk-HPIF2CMT.js → chunk-UIJIIIOA.js} +9 -6
  565. package/lib/chunk-UIJIIIOA.js.map +1 -0
  566. package/lib/chunk-UMS4M7FU.mjs +22 -0
  567. package/lib/chunk-UMS4M7FU.mjs.map +1 -0
  568. package/lib/{chunk-N3EHGKZV.mjs → chunk-UN5S46LE.mjs} +7 -4
  569. package/lib/chunk-UN5S46LE.mjs.map +1 -0
  570. package/lib/chunk-UYAF7QRD.mjs +22 -0
  571. package/lib/chunk-UYAF7QRD.mjs.map +1 -0
  572. package/lib/chunk-VERUOTB3.mjs +10 -0
  573. package/lib/chunk-VERUOTB3.mjs.map +1 -0
  574. package/lib/{chunk-62EKGBXF.js → chunk-VGOAXY26.js} +8 -5
  575. package/lib/chunk-VGOAXY26.js.map +1 -0
  576. package/lib/chunk-VKSBOWCE.mjs +50 -0
  577. package/lib/chunk-VKSBOWCE.mjs.map +1 -0
  578. package/lib/chunk-VT2JBMWQ.mjs +27 -0
  579. package/lib/chunk-VT2JBMWQ.mjs.map +1 -0
  580. package/lib/{chunk-LXZTBF7F.js → chunk-VWHKNZLG.js} +3 -3
  581. package/lib/{chunk-LXZTBF7F.js.map → chunk-VWHKNZLG.js.map} +1 -1
  582. package/lib/chunk-WH7WJMFF.js +79 -0
  583. package/lib/chunk-WH7WJMFF.js.map +1 -0
  584. package/lib/{chunk-TLRVQWCI.mjs → chunk-WL7BV4XV.mjs} +9 -6
  585. package/lib/chunk-WL7BV4XV.mjs.map +1 -0
  586. package/lib/chunk-WLZZTIOV.js +18 -0
  587. package/lib/chunk-WLZZTIOV.js.map +1 -0
  588. package/lib/chunk-WOPNDC4R.js +10 -0
  589. package/lib/chunk-WOPNDC4R.js.map +1 -0
  590. package/lib/chunk-X6SI76NQ.js +22 -0
  591. package/lib/chunk-X6SI76NQ.js.map +1 -0
  592. package/lib/{chunk-UHMICS34.mjs → chunk-YETYTLAD.mjs} +2 -2
  593. package/lib/{chunk-UHMICS34.mjs.map → chunk-YETYTLAD.mjs.map} +1 -1
  594. package/lib/chunk-YJUYGFG2.mjs +26 -0
  595. package/lib/chunk-YJUYGFG2.mjs.map +1 -0
  596. package/lib/chunk-YOF36UOS.js +19 -0
  597. package/lib/chunk-YOF36UOS.js.map +1 -0
  598. package/lib/{chunk-NBR3QGKW.js → chunk-YPOEO3UF.js} +7 -6
  599. package/lib/chunk-YPOEO3UF.js.map +1 -0
  600. package/lib/{chunk-4ZKU4RJL.mjs → chunk-YQP44G45.mjs} +2 -2
  601. package/lib/{chunk-4ZKU4RJL.mjs.map → chunk-YQP44G45.mjs.map} +1 -1
  602. package/lib/{chunk-22VHHJSS.js → chunk-Z7LBOQRQ.js} +6 -6
  603. package/lib/{chunk-22VHHJSS.js.map → chunk-Z7LBOQRQ.js.map} +1 -1
  604. package/lib/{chunk-IDDU6B6T.js → chunk-ZIBHO6FI.js} +3 -3
  605. package/lib/{chunk-IDDU6B6T.js.map → chunk-ZIBHO6FI.js.map} +1 -1
  606. package/lib/{chunk-TJQ5NVL4.js → chunk-ZJGY6EOE.js} +19 -10
  607. package/lib/chunk-ZJGY6EOE.js.map +1 -0
  608. package/lib/{chunk-V2J4TQR5.mjs → chunk-ZQKVVWD5.mjs} +2 -2
  609. package/lib/{chunk-V2J4TQR5.mjs.map → chunk-ZQKVVWD5.mjs.map} +1 -1
  610. package/lib/{chunk-FIDPCCCW.js → chunk-ZWFSAKQK.js} +8 -2
  611. package/lib/chunk-ZWFSAKQK.js.map +1 -0
  612. package/lib/codeGen.d.mts +1 -0
  613. package/lib/codeGen.d.ts +1 -0
  614. package/lib/codeGen.js +3 -3
  615. package/lib/codeGen.mjs +2 -2
  616. package/lib/commonTypes.d.mts +34 -1
  617. package/lib/commonTypes.d.ts +34 -1
  618. package/lib/core.d.mts +153 -23
  619. package/lib/core.d.ts +153 -23
  620. package/lib/core.js +9 -5
  621. package/lib/core.js.map +1 -1
  622. package/lib/core.mjs +10 -6
  623. package/lib/exceptions.d.mts +5 -1
  624. package/lib/exceptions.d.ts +5 -1
  625. package/lib/exceptions.js +2 -2
  626. package/lib/exceptions.mjs +1 -1
  627. package/lib/formatErrors.d.mts +40 -0
  628. package/lib/formatErrors.d.ts +40 -0
  629. package/lib/formatErrors.js +9 -0
  630. package/lib/formatErrors.js.map +1 -0
  631. package/lib/formatErrors.mjs +9 -0
  632. package/lib/formatErrors.mjs.map +1 -0
  633. package/lib/helpers/constants.js +2 -2
  634. package/lib/helpers/constants.mjs +1 -1
  635. package/lib/helpers/jsonSchemaConstraint.d.mts +18 -0
  636. package/lib/helpers/jsonSchemaConstraint.d.ts +18 -0
  637. package/lib/helpers/jsonSchemaConstraint.js +7 -0
  638. package/lib/helpers/jsonSchemaConstraint.js.map +1 -0
  639. package/lib/helpers/jsonSchemaConstraint.mjs +7 -0
  640. package/lib/helpers/jsonSchemaConstraint.mjs.map +1 -0
  641. package/lib/helpers/quoteStringLiteral.d.mts +3 -0
  642. package/lib/helpers/quoteStringLiteral.d.ts +3 -0
  643. package/lib/helpers/quoteStringLiteral.js +7 -0
  644. package/lib/helpers/quoteStringLiteral.js.map +1 -0
  645. package/lib/helpers/quoteStringLiteral.mjs +7 -0
  646. package/lib/helpers/quoteStringLiteral.mjs.map +1 -0
  647. package/lib/helpers/setStrictType.d.mts +1 -0
  648. package/lib/helpers/setStrictType.d.ts +1 -0
  649. package/lib/helpers/setStrictType.js +3 -3
  650. package/lib/helpers/setStrictType.mjs +2 -2
  651. package/lib/index.d.mts +21 -2
  652. package/lib/index.d.ts +21 -2
  653. package/lib/index.js +135 -55
  654. package/lib/index.js.map +1 -1
  655. package/lib/index.mjs +166 -86
  656. package/lib/standardSchema.d.mts +44 -0
  657. package/lib/standardSchema.d.ts +44 -0
  658. package/lib/standardSchema.js +1 -0
  659. package/lib/standardSchema.js.map +1 -0
  660. package/lib/standardSchema.mjs +1 -0
  661. package/lib/standardSchema.mjs.map +1 -0
  662. package/lib/toJSONSchema.d.mts +44 -0
  663. package/lib/toJSONSchema.d.ts +44 -0
  664. package/lib/toJSONSchema.js +12 -0
  665. package/lib/toJSONSchema.js.map +1 -0
  666. package/lib/toJSONSchema.mjs +12 -0
  667. package/lib/toJSONSchema.mjs.map +1 -0
  668. package/lib/translationMap.d.mts +7 -0
  669. package/lib/translationMap.d.ts +7 -0
  670. package/lib/translationMap.js +3 -3
  671. package/lib/translationMap.mjs +2 -2
  672. package/package.json +194 -46
  673. package/lib/chunk-23QTSXPQ.js.map +0 -1
  674. package/lib/chunk-24LO7MNY.js.map +0 -1
  675. package/lib/chunk-2ESDKTV4.js.map +0 -1
  676. package/lib/chunk-2HGS4STD.js +0 -48
  677. package/lib/chunk-2HGS4STD.js.map +0 -1
  678. package/lib/chunk-2IPGGARK.mjs.map +0 -1
  679. package/lib/chunk-4UPXP4I3.js.map +0 -1
  680. package/lib/chunk-5NYVRFG3.mjs +0 -48
  681. package/lib/chunk-5NYVRFG3.mjs.map +0 -1
  682. package/lib/chunk-62EKGBXF.js.map +0 -1
  683. package/lib/chunk-6JPYR2TS.js.map +0 -1
  684. package/lib/chunk-6LPQRAFN.js.map +0 -1
  685. package/lib/chunk-AJHBPMZT.mjs.map +0 -1
  686. package/lib/chunk-AXKX5BGH.js.map +0 -1
  687. package/lib/chunk-BRFUFNU4.js.map +0 -1
  688. package/lib/chunk-C2VSTWID.js.map +0 -1
  689. package/lib/chunk-D6G32F2K.js +0 -69
  690. package/lib/chunk-D6G32F2K.js.map +0 -1
  691. package/lib/chunk-DED5KDLM.js.map +0 -1
  692. package/lib/chunk-DFYP4GKE.js.map +0 -1
  693. package/lib/chunk-ENZ5WDUQ.js.map +0 -1
  694. package/lib/chunk-FI737YZJ.js.map +0 -1
  695. package/lib/chunk-FIDPCCCW.js.map +0 -1
  696. package/lib/chunk-GFWZQ4XW.mjs.map +0 -1
  697. package/lib/chunk-HPIF2CMT.js.map +0 -1
  698. package/lib/chunk-HUWO5UKU.js +0 -64
  699. package/lib/chunk-HUWO5UKU.js.map +0 -1
  700. package/lib/chunk-HWVM4SYU.mjs.map +0 -1
  701. package/lib/chunk-KRCOKWAB.mjs.map +0 -1
  702. package/lib/chunk-M2GOQ7TZ.mjs.map +0 -1
  703. package/lib/chunk-M3HYPZLE.mjs.map +0 -1
  704. package/lib/chunk-MCQHWS3E.mjs.map +0 -1
  705. package/lib/chunk-N3EHGKZV.mjs.map +0 -1
  706. package/lib/chunk-NBR3QGKW.js.map +0 -1
  707. package/lib/chunk-NFD7D5GZ.mjs.map +0 -1
  708. package/lib/chunk-NOJB5GBZ.mjs.map +0 -1
  709. package/lib/chunk-NY2TPU6O.mjs.map +0 -1
  710. package/lib/chunk-OE3L7EKN.mjs.map +0 -1
  711. package/lib/chunk-OFZMO7PB.mjs.map +0 -1
  712. package/lib/chunk-OHUOBIHX.mjs.map +0 -1
  713. package/lib/chunk-OZ3BTSSQ.mjs.map +0 -1
  714. package/lib/chunk-QIPGUTIG.mjs +0 -302
  715. package/lib/chunk-QIPGUTIG.mjs.map +0 -1
  716. package/lib/chunk-S5D5AFDF.js.map +0 -1
  717. package/lib/chunk-SBO6OQIX.mjs.map +0 -1
  718. package/lib/chunk-T2A3XXQZ.mjs.map +0 -1
  719. package/lib/chunk-TCDQA2NU.js +0 -31
  720. package/lib/chunk-TCDQA2NU.js.map +0 -1
  721. package/lib/chunk-TJQ5NVL4.js.map +0 -1
  722. package/lib/chunk-TLRVQWCI.mjs.map +0 -1
  723. package/lib/chunk-UYQFYQQG.mjs.map +0 -1
  724. package/lib/chunk-V7C77FML.mjs.map +0 -1
  725. package/lib/chunk-VN4GLOEN.js +0 -302
  726. package/lib/chunk-VN4GLOEN.js.map +0 -1
  727. package/lib/chunk-VVXKATDH.js.map +0 -1
  728. package/lib/chunk-WLPDAJB3.js.map +0 -1
  729. package/lib/chunk-XBE75VFX.js +0 -13
  730. package/lib/chunk-XBE75VFX.js.map +0 -1
  731. package/lib/chunk-XDVSL5B6.js +0 -14
  732. package/lib/chunk-XIOV4SHZ.mjs +0 -13
  733. package/lib/chunk-XIOV4SHZ.mjs.map +0 -1
  734. package/lib/chunk-Y5MNJGFX.js.map +0 -1
  735. package/lib/chunk-YDTQASAY.mjs.map +0 -1
  736. package/lib/chunk-YMPRYKNY.js.map +0 -1
  737. package/lib/chunk-Z4XOKGU3.js +0 -71
  738. package/lib/chunk-Z4XOKGU3.js.map +0 -1
  739. package/lib/chunk-ZDXO3TGZ.mjs.map +0 -1
  740. package/lib/chunk-ZEGRYDE5.mjs.map +0 -1
  741. package/lib/chunk-ZNQHNLKW.js.map +0 -1
  742. package/lib/chunk-ZTCXXAKD.mjs.map +0 -1
  743. /package/lib/{chunk-THU5VBSO.mjs.map → chunk-IIL6D2UL.mjs.map} +0 -0
package/lib/core.d.mts CHANGED
@@ -1,6 +1,7 @@
1
- import { BaseType, TranslationErrorMap, ValidationErrorData, MetaContext, TransformCallback, WithNull, WithUndefined } from './commonTypes.mjs';
2
- import { InferType } from './InferType.mjs';
1
+ import { BaseType, TranslationErrorMap, ValidationErrorData, MetaContext, TransformCallback, WithBGuardType, WithArray, WithTuple, WithObject, WithRecord, WithNull, WithUndefined, WithDefault, WithInput } from './commonTypes.mjs';
2
+ import { InferInput, InferType } from './InferType.mjs';
3
3
  import { ctxSymbol } from './helpers/constants.mjs';
4
+ import { StandardSchemaProps } from './standardSchema.mjs';
4
5
 
5
6
  declare class ExceptionContext {
6
7
  readonly initialReceived: unknown;
@@ -8,20 +9,96 @@ declare class ExceptionContext {
8
9
  readonly pathToError: string;
9
10
  readonly errors?: ValidationErrorData[] | undefined;
10
11
  readonly meta?: MetaContext | undefined;
11
- constructor(initialReceived: unknown, t: TranslationErrorMap, pathToError: string, errors?: ValidationErrorData[] | undefined, meta?: MetaContext | undefined);
12
- createChild(childPathToError: string, childMeta?: MetaContext): ExceptionContext;
12
+ /** The same location as `pathToError`, as keys. A string path cannot be taken apart again
13
+ * reliably, because a key may itself contain a dot or a bracket. */
14
+ readonly path: readonly PropertyKey[];
15
+ /** Where async validations are collected. Absent during a synchronous parse, which is how one
16
+ * is detected and reported rather than silently skipped. */
17
+ readonly pending?: PendingValidation[] | undefined;
18
+ constructor(initialReceived: unknown, t: TranslationErrorMap, pathToError: string, errors?: ValidationErrorData[] | undefined, meta?: MetaContext | undefined,
19
+ /** The same location as `pathToError`, as keys. A string path cannot be taken apart again
20
+ * reliably, because a key may itself contain a dot or a bracket. */
21
+ path?: readonly PropertyKey[],
22
+ /** Where async validations are collected. Absent during a synchronous parse, which is how one
23
+ * is detected and reported rather than silently skipped. */
24
+ pending?: PendingValidation[] | undefined);
25
+ /**
26
+ * The same location, reporting into a different errors list.
27
+ *
28
+ * A union tries each member against a throwaway list so a member that does not match is not fatal.
29
+ * An async validation reached inside the winning member is awaited long after that decision, so it
30
+ * has to be re-pointed at the real list or its issues would be collected where nobody reads them.
31
+ */
32
+ withErrors(errors?: ValidationErrorData[]): ExceptionContext;
33
+ /**
34
+ * Records async validations to be awaited once the walk is over.
35
+ *
36
+ * Throws during a synchronous parse rather than dropping them: a validation that never runs is worse
37
+ * than a clear instruction to use parseAsync.
38
+ */
39
+ enqueueAsync(validations: AsyncRequiredValidation[], received: unknown): void;
40
+ /**
41
+ * Descends into a property or an index, deriving both forms of the location from the same key so
42
+ * they cannot disagree.
43
+ */
44
+ createChild(pathSegment: PropertyKey, childMeta?: MetaContext): ExceptionContext;
13
45
  ref(path: string): unknown;
14
46
  addIssue(expected: unknown, received: unknown, messageKey: string): never | void;
15
47
  }
16
- type RequiredValidation = (received: any, ctx: ExceptionContext) => void;
48
+ /**
49
+ * A validation function run against an already type-checked value.
50
+ *
51
+ * `T` is the value the assert knows how to inspect, and it is what stops a string assert from
52
+ * being attached to a number schema: `custom` asks for `RequiredValidation<AssertInput<this>>`,
53
+ * and function parameters are compared contravariantly under `strictFunctionTypes`.
54
+ *
55
+ * An assert that genuinely accepts anything should declare `RequiredValidation<unknown>`, which
56
+ * stays assignable to every schema. The default of `any` is deliberate, so that custom asserts
57
+ * written against the previous signature keep compiling.
58
+ */
59
+ type RequiredValidation<T = any> = (received: T, ctx: ExceptionContext) => void;
60
+ /**
61
+ * A validation that has to wait for something — a database lookup, an HTTP call.
62
+ *
63
+ * Registered with `customAsync` and run by `parseAsync`. Asserts only add issues, they never change the
64
+ * value, so the value the synchronous walk produced is already final by the time these run.
65
+ */
66
+ type AsyncRequiredValidation<T = any> = (received: T, ctx: ExceptionContext) => Promise<void>;
67
+ /** An async validation that has been reached, waiting to be awaited once the walk is over. */
68
+ interface PendingValidation {
69
+ validations: AsyncRequiredValidation[];
70
+ received: unknown;
71
+ ctx: ExceptionContext;
72
+ }
73
+ /**
74
+ * The runtime value a schema hands to its asserts. Nullish is stripped, because `innerCheck`
75
+ * returns before running asserts when the value is `null` or `undefined`.
76
+ */
77
+ type AssertInput<T> = T extends WithBGuardType<unknown, infer Y> ? NonNullable<Y> : T extends WithArray<unknown, unknown> ? unknown[] : T extends WithTuple<unknown, unknown> ? unknown[] : T extends WithObject<unknown, unknown> ? Record<string, unknown> : T extends WithRecord<unknown, unknown, unknown> ? Record<string, unknown> : unknown;
17
78
  type ObjectShapeSchemaType = Record<string, CommonSchema>;
79
+ interface RecordSchemaType {
80
+ key: CommonSchema;
81
+ value: CommonSchema;
82
+ }
83
+ interface LazySchemaType {
84
+ /** The name codeGen emits at the recursion point, instead of descending forever. */
85
+ typeName: string;
86
+ getSchema: () => CommonSchema;
87
+ /** Filled on first use, so the thunk runs once however many values are validated. */
88
+ resolved?: CommonSchema;
89
+ }
18
90
  interface ValidatorContext {
19
91
  type: BaseType[];
20
92
  isNullable?: boolean;
21
93
  isOptional?: boolean;
22
94
  requiredValidations: RequiredValidation[];
95
+ asyncValidations?: AsyncRequiredValidation[];
23
96
  array?: CommonSchema;
24
97
  object?: ObjectShapeSchemaType;
98
+ union?: CommonSchema[];
99
+ record?: RecordSchemaType;
100
+ tuple?: CommonSchema[];
101
+ lazy?: LazySchemaType;
25
102
  allowUnrecognizedObjectProps?: boolean;
26
103
  strictType?: boolean;
27
104
  strictTypeValue?: unknown;
@@ -33,21 +110,58 @@ interface ValidatorContext {
33
110
  declare class CommonSchema {
34
111
  [ctxSymbol]: ValidatorContext;
35
112
  constructor(ctx: ValidatorContext);
113
+ /**
114
+ * The Standard Schema v1 interface, which lets a bguard schema be used by any library that accepts
115
+ * a validator without either side knowing about the other.
116
+ *
117
+ * A getter rather than a stored property, so it costs nothing until something asks for it and is
118
+ * not copied by `clone`. `types` is declared but deliberately never assigned: the spec defines it
119
+ * as type-only. Input and output are reported separately, so a consumer generating a form asks for
120
+ * what the schema takes rather than what it returns.
121
+ */
122
+ get '~standard'(): StandardSchemaProps<InferInput<this>, InferType<this>>;
123
+ /**
124
+ * Returns a copy of this schema that carries its own context.
125
+ *
126
+ * Every refining method goes through this, so a schema can be shared between properties and
127
+ * reused as a base without one use leaking into another. Construction is deliberately bypassed:
128
+ * the subclass constructors validate their arguments and take extra parameters, and neither
129
+ * applies when deriving from an already-valid schema.
130
+ *
131
+ * Public because deriving a schema is a reasonable thing to do from outside as well — the object
132
+ * utilities need it to rebuild a property schema without touching the one they were handed.
133
+ */
134
+ clone(): this;
36
135
  /**
37
136
  * @param validators - One or more custom validation functions.
38
- * @returns {this} The schema instance with the added custom validation.
137
+ * @returns {this} A new schema instance with the added custom validation.
138
+ */
139
+ custom(...validators: RequiredValidation<AssertInput<this>>[]): this;
140
+ /**
141
+ * Adds validations that have to wait for something, such as a database lookup.
142
+ *
143
+ * These run only under `parseAsync` or `parseOrFailAsync`; a synchronous parse reports a
144
+ * `BuildSchemaError` rather than skipping them. They are awaited after the structural walk is
145
+ * complete, all together, so several slow checks across a schema cost one round of waiting.
146
+ *
147
+ * @param validators - One or more async validation functions.
148
+ * @returns {this} A new schema instance with the added validations.
149
+ * @example
150
+ * const schema = string().customAsync(async (received, ctx) => {
151
+ * if (await isTaken(received)) ctx.addIssue('an unused name', received, 'name is taken');
152
+ * });
39
153
  */
40
- custom(...validators: RequiredValidation[]): this;
154
+ customAsync(...validators: AsyncRequiredValidation<AssertInput<this>>[]): this;
41
155
  /**
42
156
  * Marks the schema as nullable, allowing the value to be `null`.
43
157
  *
44
- * @returns {WithNull<this>} The schema instance marked as nullable.
158
+ * @returns {WithNull<this>} A new schema instance marked as nullable.
45
159
  */
46
160
  nullable(): WithNull<this>;
47
161
  /**
48
162
  * Marks the schema as optional, allowing the value to be `undefined`.
49
163
  *
50
- * @returns {WithUndefined<this>} The schema instance marked as optional.
164
+ * @returns {WithUndefined<this>} A new schema instance marked as optional.
51
165
  */
52
166
  optional(): WithUndefined<this>;
53
167
  /**
@@ -55,7 +169,7 @@ declare class CommonSchema {
55
169
  *
56
170
  * @returns {this} The schema instance. This method should be used as a last one because it does the check of previous methods and
57
171
  */
58
- default(defaultValue: InferType<this>): this;
172
+ default(defaultValue: InferType<this>): WithDefault<this>;
59
173
  /**
60
174
  * Applies a transformation to the input value before any validation occurs.
61
175
  * The transformation should return a value of the same type as the inferred type of the schema,
@@ -63,7 +177,7 @@ declare class CommonSchema {
63
177
  *
64
178
  * @template In - The type of the input value before transformation (defaults to `unknown`).
65
179
  * @param {TransformCallback<In, InferType<this>>} cb - The callback function that performs the transformation.
66
- * @returns {this} The updated schema with the applied transformation.
180
+ * @returns {this} A new schema with the applied transformation.
67
181
  *
68
182
  * @example
69
183
  * const schema = string()
@@ -77,14 +191,14 @@ declare class CommonSchema {
77
191
  * // Parsing '' will be transformed to null and will pass due to .nullable().
78
192
  * parseOrFail(schema, '');
79
193
  */
80
- transformBeforeValidation<In>(cb: TransformCallback<In, InferType<this>>): this;
194
+ transformBeforeValidation<In>(cb: TransformCallback<In, InferType<this>>): WithInput<this, In>;
81
195
  /**
82
196
  * Assigns a unique identifier to the schema.
83
197
  * This ID can be used to track or map validation errors back to specific fields
84
198
  * in a form or other structures.
85
199
  *
86
200
  * @param {string} value - The unique identifier for the schema.
87
- * @returns {this} The updated schema with the assigned ID.
201
+ * @returns {this} A new schema with the assigned ID.
88
202
  *
89
203
  * @example
90
204
  * const schema = string().id('username');
@@ -95,7 +209,7 @@ declare class CommonSchema {
95
209
  * The description can be used when displaying validation errors or for documentation purposes.
96
210
  *
97
211
  * @param {string} value - The description for the schema.
98
- * @returns {this} The updated schema with the added description.
212
+ * @returns {this} A new schema with the added description.
99
213
  *
100
214
  * @example
101
215
  * const schema = string().description('The username of the account holder.');
@@ -141,17 +255,14 @@ interface ParseOptions {
141
255
  */
142
256
  lng?: string;
143
257
  }
144
- interface ParseOptions {
145
- /**
146
- * Set language keyword to map error messages.
147
- * @default 'default'
148
- * @example 'sr' or 'Serbia' or any string to identify language
149
- */
150
- lng?: string;
258
+ interface ParseAllOptions extends ParseOptions {
151
259
  /**
152
260
  * If true, collects all validation errors and returns them.
153
261
  * If false or undefined, returns the first validation error it can find and stops looking,
154
262
  * which provides a small runtime optimization.
263
+ *
264
+ * Declared only where it is honoured. `parseOrFail` throws on the first error by definition, and it
265
+ * used to accept this flag and ignore it.
155
266
  * @default undefined
156
267
  */
157
268
  getAllErrors?: boolean;
@@ -195,6 +306,25 @@ interface ParseOptions {
195
306
  * // First element in array "errors" will have an error because 'age' should be a number, not a string.
196
307
  * // With provided options { lng: 'SR'}, errors will be translated to a language mapped with keyword 'SR'
197
308
  */
198
- declare function parse<T extends CommonSchema>(schema: T, receivedValue: unknown, options?: ParseOptions): [ValidationErrorData[], undefined] | [undefined, InferType<T>];
309
+ declare function parse<T extends CommonSchema>(schema: T, receivedValue: unknown, options?: ParseAllOptions): [ValidationErrorData[], null] | [null, InferType<T>];
310
+ /**
311
+ * The asynchronous counterpart of {@link parse}, for schemas carrying `customAsync` validations.
312
+ *
313
+ * The structure is validated synchronously first and the async validations run afterwards, all
314
+ * together. That means their issues come after the synchronous ones in the returned array, and that an
315
+ * async validation is never reached for a value the synchronous pass already rejected structurally.
316
+ *
317
+ * @example
318
+ * const [errors, value] = await parseAsync(schema, received, { getAllErrors: true });
319
+ */
320
+ declare function parseAsync<T extends CommonSchema>(schema: T, receivedValue: unknown, options?: ParseAllOptions): Promise<[ValidationErrorData[], null] | [null, InferType<T>]>;
321
+ /**
322
+ * The asynchronous counterpart of {@link parseOrFail}.
323
+ *
324
+ * Unlike the synchronous version it cannot stop at the first error, because the async validations have
325
+ * to be awaited before anything can be reported. It throws the first error found, in the same order
326
+ * `parseAsync` reports them.
327
+ */
328
+ declare function parseOrFailAsync<T extends CommonSchema>(schema: T, receivedValue: unknown, options?: ParseOptions): Promise<InferType<T>>;
199
329
 
200
- export { CommonSchema, ExceptionContext, type ObjectShapeSchemaType, type RequiredValidation, type ValidatorContext, parse, parseOrFail };
330
+ export { type AssertInput, type AsyncRequiredValidation, CommonSchema, ExceptionContext, type LazySchemaType, type ObjectShapeSchemaType, type RecordSchemaType, type RequiredValidation, type ValidatorContext, parse, parseAsync, parseOrFail, parseOrFailAsync };
package/lib/core.d.ts CHANGED
@@ -1,6 +1,7 @@
1
- import { BaseType, TranslationErrorMap, ValidationErrorData, MetaContext, TransformCallback, WithNull, WithUndefined } from './commonTypes.js';
2
- import { InferType } from './InferType.js';
1
+ import { BaseType, TranslationErrorMap, ValidationErrorData, MetaContext, TransformCallback, WithBGuardType, WithArray, WithTuple, WithObject, WithRecord, WithNull, WithUndefined, WithDefault, WithInput } from './commonTypes.js';
2
+ import { InferInput, InferType } from './InferType.js';
3
3
  import { ctxSymbol } from './helpers/constants.js';
4
+ import { StandardSchemaProps } from './standardSchema.js';
4
5
 
5
6
  declare class ExceptionContext {
6
7
  readonly initialReceived: unknown;
@@ -8,20 +9,96 @@ declare class ExceptionContext {
8
9
  readonly pathToError: string;
9
10
  readonly errors?: ValidationErrorData[] | undefined;
10
11
  readonly meta?: MetaContext | undefined;
11
- constructor(initialReceived: unknown, t: TranslationErrorMap, pathToError: string, errors?: ValidationErrorData[] | undefined, meta?: MetaContext | undefined);
12
- createChild(childPathToError: string, childMeta?: MetaContext): ExceptionContext;
12
+ /** The same location as `pathToError`, as keys. A string path cannot be taken apart again
13
+ * reliably, because a key may itself contain a dot or a bracket. */
14
+ readonly path: readonly PropertyKey[];
15
+ /** Where async validations are collected. Absent during a synchronous parse, which is how one
16
+ * is detected and reported rather than silently skipped. */
17
+ readonly pending?: PendingValidation[] | undefined;
18
+ constructor(initialReceived: unknown, t: TranslationErrorMap, pathToError: string, errors?: ValidationErrorData[] | undefined, meta?: MetaContext | undefined,
19
+ /** The same location as `pathToError`, as keys. A string path cannot be taken apart again
20
+ * reliably, because a key may itself contain a dot or a bracket. */
21
+ path?: readonly PropertyKey[],
22
+ /** Where async validations are collected. Absent during a synchronous parse, which is how one
23
+ * is detected and reported rather than silently skipped. */
24
+ pending?: PendingValidation[] | undefined);
25
+ /**
26
+ * The same location, reporting into a different errors list.
27
+ *
28
+ * A union tries each member against a throwaway list so a member that does not match is not fatal.
29
+ * An async validation reached inside the winning member is awaited long after that decision, so it
30
+ * has to be re-pointed at the real list or its issues would be collected where nobody reads them.
31
+ */
32
+ withErrors(errors?: ValidationErrorData[]): ExceptionContext;
33
+ /**
34
+ * Records async validations to be awaited once the walk is over.
35
+ *
36
+ * Throws during a synchronous parse rather than dropping them: a validation that never runs is worse
37
+ * than a clear instruction to use parseAsync.
38
+ */
39
+ enqueueAsync(validations: AsyncRequiredValidation[], received: unknown): void;
40
+ /**
41
+ * Descends into a property or an index, deriving both forms of the location from the same key so
42
+ * they cannot disagree.
43
+ */
44
+ createChild(pathSegment: PropertyKey, childMeta?: MetaContext): ExceptionContext;
13
45
  ref(path: string): unknown;
14
46
  addIssue(expected: unknown, received: unknown, messageKey: string): never | void;
15
47
  }
16
- type RequiredValidation = (received: any, ctx: ExceptionContext) => void;
48
+ /**
49
+ * A validation function run against an already type-checked value.
50
+ *
51
+ * `T` is the value the assert knows how to inspect, and it is what stops a string assert from
52
+ * being attached to a number schema: `custom` asks for `RequiredValidation<AssertInput<this>>`,
53
+ * and function parameters are compared contravariantly under `strictFunctionTypes`.
54
+ *
55
+ * An assert that genuinely accepts anything should declare `RequiredValidation<unknown>`, which
56
+ * stays assignable to every schema. The default of `any` is deliberate, so that custom asserts
57
+ * written against the previous signature keep compiling.
58
+ */
59
+ type RequiredValidation<T = any> = (received: T, ctx: ExceptionContext) => void;
60
+ /**
61
+ * A validation that has to wait for something — a database lookup, an HTTP call.
62
+ *
63
+ * Registered with `customAsync` and run by `parseAsync`. Asserts only add issues, they never change the
64
+ * value, so the value the synchronous walk produced is already final by the time these run.
65
+ */
66
+ type AsyncRequiredValidation<T = any> = (received: T, ctx: ExceptionContext) => Promise<void>;
67
+ /** An async validation that has been reached, waiting to be awaited once the walk is over. */
68
+ interface PendingValidation {
69
+ validations: AsyncRequiredValidation[];
70
+ received: unknown;
71
+ ctx: ExceptionContext;
72
+ }
73
+ /**
74
+ * The runtime value a schema hands to its asserts. Nullish is stripped, because `innerCheck`
75
+ * returns before running asserts when the value is `null` or `undefined`.
76
+ */
77
+ type AssertInput<T> = T extends WithBGuardType<unknown, infer Y> ? NonNullable<Y> : T extends WithArray<unknown, unknown> ? unknown[] : T extends WithTuple<unknown, unknown> ? unknown[] : T extends WithObject<unknown, unknown> ? Record<string, unknown> : T extends WithRecord<unknown, unknown, unknown> ? Record<string, unknown> : unknown;
17
78
  type ObjectShapeSchemaType = Record<string, CommonSchema>;
79
+ interface RecordSchemaType {
80
+ key: CommonSchema;
81
+ value: CommonSchema;
82
+ }
83
+ interface LazySchemaType {
84
+ /** The name codeGen emits at the recursion point, instead of descending forever. */
85
+ typeName: string;
86
+ getSchema: () => CommonSchema;
87
+ /** Filled on first use, so the thunk runs once however many values are validated. */
88
+ resolved?: CommonSchema;
89
+ }
18
90
  interface ValidatorContext {
19
91
  type: BaseType[];
20
92
  isNullable?: boolean;
21
93
  isOptional?: boolean;
22
94
  requiredValidations: RequiredValidation[];
95
+ asyncValidations?: AsyncRequiredValidation[];
23
96
  array?: CommonSchema;
24
97
  object?: ObjectShapeSchemaType;
98
+ union?: CommonSchema[];
99
+ record?: RecordSchemaType;
100
+ tuple?: CommonSchema[];
101
+ lazy?: LazySchemaType;
25
102
  allowUnrecognizedObjectProps?: boolean;
26
103
  strictType?: boolean;
27
104
  strictTypeValue?: unknown;
@@ -33,21 +110,58 @@ interface ValidatorContext {
33
110
  declare class CommonSchema {
34
111
  [ctxSymbol]: ValidatorContext;
35
112
  constructor(ctx: ValidatorContext);
113
+ /**
114
+ * The Standard Schema v1 interface, which lets a bguard schema be used by any library that accepts
115
+ * a validator without either side knowing about the other.
116
+ *
117
+ * A getter rather than a stored property, so it costs nothing until something asks for it and is
118
+ * not copied by `clone`. `types` is declared but deliberately never assigned: the spec defines it
119
+ * as type-only. Input and output are reported separately, so a consumer generating a form asks for
120
+ * what the schema takes rather than what it returns.
121
+ */
122
+ get '~standard'(): StandardSchemaProps<InferInput<this>, InferType<this>>;
123
+ /**
124
+ * Returns a copy of this schema that carries its own context.
125
+ *
126
+ * Every refining method goes through this, so a schema can be shared between properties and
127
+ * reused as a base without one use leaking into another. Construction is deliberately bypassed:
128
+ * the subclass constructors validate their arguments and take extra parameters, and neither
129
+ * applies when deriving from an already-valid schema.
130
+ *
131
+ * Public because deriving a schema is a reasonable thing to do from outside as well — the object
132
+ * utilities need it to rebuild a property schema without touching the one they were handed.
133
+ */
134
+ clone(): this;
36
135
  /**
37
136
  * @param validators - One or more custom validation functions.
38
- * @returns {this} The schema instance with the added custom validation.
137
+ * @returns {this} A new schema instance with the added custom validation.
138
+ */
139
+ custom(...validators: RequiredValidation<AssertInput<this>>[]): this;
140
+ /**
141
+ * Adds validations that have to wait for something, such as a database lookup.
142
+ *
143
+ * These run only under `parseAsync` or `parseOrFailAsync`; a synchronous parse reports a
144
+ * `BuildSchemaError` rather than skipping them. They are awaited after the structural walk is
145
+ * complete, all together, so several slow checks across a schema cost one round of waiting.
146
+ *
147
+ * @param validators - One or more async validation functions.
148
+ * @returns {this} A new schema instance with the added validations.
149
+ * @example
150
+ * const schema = string().customAsync(async (received, ctx) => {
151
+ * if (await isTaken(received)) ctx.addIssue('an unused name', received, 'name is taken');
152
+ * });
39
153
  */
40
- custom(...validators: RequiredValidation[]): this;
154
+ customAsync(...validators: AsyncRequiredValidation<AssertInput<this>>[]): this;
41
155
  /**
42
156
  * Marks the schema as nullable, allowing the value to be `null`.
43
157
  *
44
- * @returns {WithNull<this>} The schema instance marked as nullable.
158
+ * @returns {WithNull<this>} A new schema instance marked as nullable.
45
159
  */
46
160
  nullable(): WithNull<this>;
47
161
  /**
48
162
  * Marks the schema as optional, allowing the value to be `undefined`.
49
163
  *
50
- * @returns {WithUndefined<this>} The schema instance marked as optional.
164
+ * @returns {WithUndefined<this>} A new schema instance marked as optional.
51
165
  */
52
166
  optional(): WithUndefined<this>;
53
167
  /**
@@ -55,7 +169,7 @@ declare class CommonSchema {
55
169
  *
56
170
  * @returns {this} The schema instance. This method should be used as a last one because it does the check of previous methods and
57
171
  */
58
- default(defaultValue: InferType<this>): this;
172
+ default(defaultValue: InferType<this>): WithDefault<this>;
59
173
  /**
60
174
  * Applies a transformation to the input value before any validation occurs.
61
175
  * The transformation should return a value of the same type as the inferred type of the schema,
@@ -63,7 +177,7 @@ declare class CommonSchema {
63
177
  *
64
178
  * @template In - The type of the input value before transformation (defaults to `unknown`).
65
179
  * @param {TransformCallback<In, InferType<this>>} cb - The callback function that performs the transformation.
66
- * @returns {this} The updated schema with the applied transformation.
180
+ * @returns {this} A new schema with the applied transformation.
67
181
  *
68
182
  * @example
69
183
  * const schema = string()
@@ -77,14 +191,14 @@ declare class CommonSchema {
77
191
  * // Parsing '' will be transformed to null and will pass due to .nullable().
78
192
  * parseOrFail(schema, '');
79
193
  */
80
- transformBeforeValidation<In>(cb: TransformCallback<In, InferType<this>>): this;
194
+ transformBeforeValidation<In>(cb: TransformCallback<In, InferType<this>>): WithInput<this, In>;
81
195
  /**
82
196
  * Assigns a unique identifier to the schema.
83
197
  * This ID can be used to track or map validation errors back to specific fields
84
198
  * in a form or other structures.
85
199
  *
86
200
  * @param {string} value - The unique identifier for the schema.
87
- * @returns {this} The updated schema with the assigned ID.
201
+ * @returns {this} A new schema with the assigned ID.
88
202
  *
89
203
  * @example
90
204
  * const schema = string().id('username');
@@ -95,7 +209,7 @@ declare class CommonSchema {
95
209
  * The description can be used when displaying validation errors or for documentation purposes.
96
210
  *
97
211
  * @param {string} value - The description for the schema.
98
- * @returns {this} The updated schema with the added description.
212
+ * @returns {this} A new schema with the added description.
99
213
  *
100
214
  * @example
101
215
  * const schema = string().description('The username of the account holder.');
@@ -141,17 +255,14 @@ interface ParseOptions {
141
255
  */
142
256
  lng?: string;
143
257
  }
144
- interface ParseOptions {
145
- /**
146
- * Set language keyword to map error messages.
147
- * @default 'default'
148
- * @example 'sr' or 'Serbia' or any string to identify language
149
- */
150
- lng?: string;
258
+ interface ParseAllOptions extends ParseOptions {
151
259
  /**
152
260
  * If true, collects all validation errors and returns them.
153
261
  * If false or undefined, returns the first validation error it can find and stops looking,
154
262
  * which provides a small runtime optimization.
263
+ *
264
+ * Declared only where it is honoured. `parseOrFail` throws on the first error by definition, and it
265
+ * used to accept this flag and ignore it.
155
266
  * @default undefined
156
267
  */
157
268
  getAllErrors?: boolean;
@@ -195,6 +306,25 @@ interface ParseOptions {
195
306
  * // First element in array "errors" will have an error because 'age' should be a number, not a string.
196
307
  * // With provided options { lng: 'SR'}, errors will be translated to a language mapped with keyword 'SR'
197
308
  */
198
- declare function parse<T extends CommonSchema>(schema: T, receivedValue: unknown, options?: ParseOptions): [ValidationErrorData[], undefined] | [undefined, InferType<T>];
309
+ declare function parse<T extends CommonSchema>(schema: T, receivedValue: unknown, options?: ParseAllOptions): [ValidationErrorData[], null] | [null, InferType<T>];
310
+ /**
311
+ * The asynchronous counterpart of {@link parse}, for schemas carrying `customAsync` validations.
312
+ *
313
+ * The structure is validated synchronously first and the async validations run afterwards, all
314
+ * together. That means their issues come after the synchronous ones in the returned array, and that an
315
+ * async validation is never reached for a value the synchronous pass already rejected structurally.
316
+ *
317
+ * @example
318
+ * const [errors, value] = await parseAsync(schema, received, { getAllErrors: true });
319
+ */
320
+ declare function parseAsync<T extends CommonSchema>(schema: T, receivedValue: unknown, options?: ParseAllOptions): Promise<[ValidationErrorData[], null] | [null, InferType<T>]>;
321
+ /**
322
+ * The asynchronous counterpart of {@link parseOrFail}.
323
+ *
324
+ * Unlike the synchronous version it cannot stop at the first error, because the async validations have
325
+ * to be awaited before anything can be reported. It throws the first error found, in the same order
326
+ * `parseAsync` reports them.
327
+ */
328
+ declare function parseOrFailAsync<T extends CommonSchema>(schema: T, receivedValue: unknown, options?: ParseOptions): Promise<InferType<T>>;
199
329
 
200
- export { CommonSchema, ExceptionContext, type ObjectShapeSchemaType, type RequiredValidation, type ValidatorContext, parse, parseOrFail };
330
+ export { type AssertInput, type AsyncRequiredValidation, CommonSchema, ExceptionContext, type LazySchemaType, type ObjectShapeSchemaType, type RecordSchemaType, type RequiredValidation, type ValidatorContext, parse, parseAsync, parseOrFail, parseOrFailAsync };
package/lib/core.js CHANGED
@@ -3,15 +3,19 @@
3
3
 
4
4
 
5
5
 
6
- var _chunkVN4GLOENjs = require('./chunk-VN4GLOEN.js');
6
+
7
+
8
+ var _chunk6LUSV3SSjs = require('./chunk-6LUSV3SS.js');
9
+ require('./chunk-ZJGY6EOE.js');
7
10
  require('./chunk-VBTWYDEM.js');
8
- require('./chunk-TJQ5NVL4.js');
9
- require('./chunk-FIDPCCCW.js');
10
- require('./chunk-AXKX5BGH.js');
11
+ require('./chunk-LHEU4XAC.js');
12
+ require('./chunk-ZWFSAKQK.js');
13
+
14
+
11
15
 
12
16
 
13
17
 
14
18
 
15
19
 
16
- exports.CommonSchema = _chunkVN4GLOENjs.CommonSchema; exports.ExceptionContext = _chunkVN4GLOENjs.ExceptionContext; exports.parse = _chunkVN4GLOENjs.parse; exports.parseOrFail = _chunkVN4GLOENjs.parseOrFail;
20
+ exports.CommonSchema = _chunk6LUSV3SSjs.CommonSchema; exports.ExceptionContext = _chunk6LUSV3SSjs.ExceptionContext; exports.parse = _chunk6LUSV3SSjs.parse; exports.parseAsync = _chunk6LUSV3SSjs.parseAsync; exports.parseOrFail = _chunk6LUSV3SSjs.parseOrFail; exports.parseOrFailAsync = _chunk6LUSV3SSjs.parseOrFailAsync;
17
21
  //# sourceMappingURL=core.js.map
package/lib/core.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/bguard/bguard/lib/core.js"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACF,sDAA4B;AAC5B,+BAA4B;AAC5B,+BAA4B;AAC5B,+BAA4B;AAC5B,+BAA4B;AAC5B;AACE;AACA;AACA;AACA;AACF,+MAAC","file":"/home/runner/work/bguard/bguard/lib/core.js"}
1
+ {"version":3,"sources":["/home/runner/work/bguard/bguard/lib/core.js"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACF,sDAA4B;AAC5B,+BAA4B;AAC5B,+BAA4B;AAC5B,+BAA4B;AAC5B,+BAA4B;AAC5B;AACE;AACA;AACA;AACA;AACA;AACA;AACF,+TAAC","file":"/home/runner/work/bguard/bguard/lib/core.js"}
package/lib/core.mjs CHANGED
@@ -2,16 +2,20 @@ import {
2
2
  CommonSchema,
3
3
  ExceptionContext,
4
4
  parse,
5
- parseOrFail
6
- } from "./chunk-QIPGUTIG.mjs";
5
+ parseAsync,
6
+ parseOrFail,
7
+ parseOrFailAsync
8
+ } from "./chunk-LDZFOOWN.mjs";
9
+ import "./chunk-65X7NTUS.mjs";
7
10
  import "./chunk-YBVMP4EI.mjs";
8
- import "./chunk-OE3L7EKN.mjs";
9
- import "./chunk-ZTCXXAKD.mjs";
10
- import "./chunk-2ANPCB4O.mjs";
11
+ import "./chunk-C76DLZFD.mjs";
12
+ import "./chunk-O2WD4JBG.mjs";
11
13
  export {
12
14
  CommonSchema,
13
15
  ExceptionContext,
14
16
  parse,
15
- parseOrFail
17
+ parseAsync,
18
+ parseOrFail,
19
+ parseOrFailAsync
16
20
  };
17
21
  //# sourceMappingURL=core.mjs.map
@@ -4,9 +4,13 @@ declare class ValidationError extends Error {
4
4
  expected: unknown;
5
5
  received: unknown;
6
6
  pathToError: string;
7
+ /** The same location as `pathToError`, as keys. */
8
+ path: readonly PropertyKey[];
9
+ /** The translation key of this failure, stable across locales. */
10
+ code: string;
7
11
  message: string;
8
12
  meta?: MetaContext;
9
- constructor(expected: unknown, received: unknown, pathToError: string, message: string, meta?: MetaContext);
13
+ constructor(expected: unknown, received: unknown, pathToError: string, message: string, meta?: MetaContext, path?: readonly PropertyKey[], code?: string);
10
14
  }
11
15
  declare class BuildSchemaError extends Error {
12
16
  }
@@ -4,9 +4,13 @@ declare class ValidationError extends Error {
4
4
  expected: unknown;
5
5
  received: unknown;
6
6
  pathToError: string;
7
+ /** The same location as `pathToError`, as keys. */
8
+ path: readonly PropertyKey[];
9
+ /** The translation key of this failure, stable across locales. */
10
+ code: string;
7
11
  message: string;
8
12
  meta?: MetaContext;
9
- constructor(expected: unknown, received: unknown, pathToError: string, message: string, meta?: MetaContext);
13
+ constructor(expected: unknown, received: unknown, pathToError: string, message: string, meta?: MetaContext, path?: readonly PropertyKey[], code?: string);
10
14
  }
11
15
  declare class BuildSchemaError extends Error {
12
16
  }
package/lib/exceptions.js CHANGED
@@ -1,9 +1,9 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
3
 
4
- var _chunkFIDPCCCWjs = require('./chunk-FIDPCCCW.js');
4
+ var _chunkZWFSAKQKjs = require('./chunk-ZWFSAKQK.js');
5
5
 
6
6
 
7
7
 
8
- exports.BuildSchemaError = _chunkFIDPCCCWjs.BuildSchemaError; exports.ValidationError = _chunkFIDPCCCWjs.ValidationError;
8
+ exports.BuildSchemaError = _chunkZWFSAKQKjs.BuildSchemaError; exports.ValidationError = _chunkZWFSAKQKjs.ValidationError;
9
9
  //# sourceMappingURL=exceptions.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  BuildSchemaError,
3
3
  ValidationError
4
- } from "./chunk-ZTCXXAKD.mjs";
4
+ } from "./chunk-O2WD4JBG.mjs";
5
5
  export {
6
6
  BuildSchemaError,
7
7
  ValidationError