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/README.md CHANGED
@@ -22,6 +22,20 @@ Table of contents
22
22
  * [optional()](#h4_chaining_optional)
23
23
  * [id(value: string)](#h4_chaining_id)
24
24
  * [description(value: string)](#h4_chaining_description)
25
+ * [Composing Schemas](#h3_union_and_record)
26
+ * [union(schemas)](#h4_union)
27
+ * [record(keySchema, valueSchema)](#h4_record)
28
+ * [tuple(schemas)](#h4_tuple)
29
+ * [intersection(schemas)](#h4_intersection)
30
+ * [lazy(typeName, getSchema)](#h4_lazy)
31
+ * [Standard Schema](#h3_standard_schema)
32
+ * [Error Shape](#h3_error_shape)
33
+ * [Deriving Object Schemas](#h3_object_utilities)
34
+ * [Formatting Errors](#h3_formatting_errors)
35
+ * [Coercion](#h3_coercion)
36
+ * [InferInput and InferOutput](#h3_infer_input)
37
+ * [Async Validation](#h3_async)
38
+ * [JSON Schema](#h3_json_schema)
25
39
  * [Literals](#h3_literals)
26
40
  * [Custom (Library Built-in) Assertions](#h3_custom_builtin_assertions)
27
41
  * [Create Custom Assertions](#h3_create_custom_assertions)
@@ -84,7 +98,12 @@ Table of contents
84
98
  * [oneOfValues](#assert_oneofvalues_mix)
85
99
  * [object](#assertdir_object)
86
100
  * [allowUnrecognized](#assert_object_method_allowunrecognized)
101
+ * [extend](#assert_extend_object)
87
102
  * [maxKeys](#assert_maxkeys_object)
103
+ * [omit](#assert_omit_object)
104
+ * [partial](#assert_partial_object)
105
+ * [pick](#assert_pick_object)
106
+ * [required](#assert_required_object)
88
107
 
89
108
  ### <a id="h3_features"> Features </a>
90
109
 
@@ -304,7 +323,7 @@ The `parseOrFail` method validates the data and throws an error on the first val
304
323
  **Syntax:**
305
324
 
306
325
  ```typeScript
307
- import { parseOrFail } from 'bguard';
326
+ import { parseOrFail, ValidationError } from 'bguard';
308
327
  // import other dependencies
309
328
 
310
329
  try {
@@ -312,8 +331,12 @@ try {
312
331
  const validatedData = parseOrFail(studentSchema, validStudentData);
313
332
  // If the data is valid, validatedData will contain the parsed value with inferred TypeScript types
314
333
  } catch (error) {
315
- // If the data does not conform to the schema, an error will be thrown
316
- console.error(error.message); // Logs the first validation error message, if any
334
+ // If the data does not conform to the schema, a ValidationError will be thrown
335
+ if (error instanceof ValidationError) {
336
+ console.error(error.message); // The first validation error message
337
+ console.error(error.pathToError); // Where in the received value it happened
338
+ console.error(error.meta?.id); // The id() of the schema that failed, if it has one
339
+ }
317
340
  }
318
341
  ```
319
342
 
@@ -327,7 +350,27 @@ Options:
327
350
 
328
351
  Explanation
329
352
 
330
- - **`parse` Method**: This method returns a tuple where the first element is an array of validation errors (if any), and the second element is the successfully parsed value (or `undefined` if errors exist). It allows collecting all errors by setting the `getAllErrors` flag.
353
+ - **`parse` Method**: Returns a tuple of `[errors, value]`. Exactly one of the two is present and the other is `null`:
354
+
355
+ - on success: `[null, parsedValue]`
356
+ - on failure: `[errors, null]`
357
+
358
+ So the first element is what you branch on:
359
+
360
+ ```typeScript
361
+ const [errors, parsedValue] = parse(schema, receivedValue);
362
+
363
+ if (errors) {
364
+ // errors is ValidationErrorData[], parsedValue is null
365
+ return errors;
366
+ }
367
+
368
+ // parsedValue is typed as InferType<typeof schema> here
369
+ ```
370
+
371
+ Do not test the second element to decide whether validation passed: a schema may legitimately parse
372
+ to `null`, for example `string().nullable()`. Set `getAllErrors` to collect every error instead of
373
+ stopping at the first.
331
374
 
332
375
  - **`parseOrFail` Method**: This method throws a `ValidationError` when the first validation rule fails, making it suitable for scenarios where early termination of validation is desired.
333
376
 
@@ -335,6 +378,28 @@ Explanation
335
378
 
336
379
  ### <a id="h3_chaining_methods"> Chaining Methods </a>
337
380
 
381
+ Schemas are immutable. Every method below returns a new schema rather than changing the one it was
382
+ called on, so a schema can be defined once and reused with different refinements:
383
+
384
+ ```typeScript
385
+ const name = string().custom(minLength(2));
386
+
387
+ const schema = object({
388
+ firstName: name, // required
389
+ middleName: name.optional(), // optional, firstName is unaffected
390
+ lastName: name.custom(maxLength(50)), // extra rule, only here
391
+ });
392
+ ```
393
+
394
+ This also means a refinement has no effect unless you keep its result:
395
+
396
+ ```typeScript
397
+ const schema = string();
398
+ schema.custom(minLength(5)); // returns a new schema, which is then discarded
399
+
400
+ const schema = string().custom(minLength(5)); // keep the result instead
401
+ ```
402
+
338
403
  #### <a id="h4_chaining_nullable"> nullable() </a>
339
404
 
340
405
  Allows the value to be `null`.
@@ -365,6 +430,20 @@ Sets a default value if the received value is `undefined`. The default value mus
365
430
 
366
431
  > **Notice:** Additionally, `default()` must be the last method in the chain because it validates during schema build time that the default value is compatible with the rest of the schema. For example, if the schema is `number()`, the default value cannot be a `string`.
367
432
 
433
+
434
+ A default also applies to a property of an object schema, so the property may be omitted from the
435
+ received value:
436
+
437
+ ```typeScript
438
+ const schema = object({ page: number().default(1), query: string() });
439
+
440
+ parseOrFail(schema, { query: 'shoes' }); // { page: 1, query: 'shoes' }
441
+ parseOrFail(schema, { page: 3, query: 'shoes' }); // { page: 3, query: 'shoes' }
442
+ ```
443
+
444
+ Each parse receives its own copy of an object or array default, so mutating one result cannot affect
445
+ a later one.
446
+
368
447
  _Example_:
369
448
 
370
449
  ```typeScript
@@ -429,6 +508,369 @@ parseOrFail(stringOrNullSchema, 'test');
429
508
  parseOrFail(stringOrNullSchema, '');
430
509
  ```
431
510
 
511
+ ### <a id="h3_union_and_record"> Composing Schemas </a>
512
+
513
+ #### <a id="h4_union"> union(schemas) </a>
514
+
515
+ Accepts a value matching any one of several schemas. Members are tried in order and the first that
516
+ validates cleanly wins, so its parsed value is the result.
517
+
518
+ Unlike `oneOfTypes`, which only compares `typeof`, each member is a full schema. Members carry their
519
+ own assertions and structure, which is what makes discriminating by shape possible.
520
+
521
+ ```typeScript
522
+ import { union } from 'bguard/union';
523
+ import { object } from 'bguard/object';
524
+ import { string } from 'bguard/string';
525
+ import { number } from 'bguard/number';
526
+
527
+ const shapeSchema = union([
528
+ object({ kind: string().equalTo('circle'), radius: number() }),
529
+ object({ kind: string().equalTo('square'), side: number() }),
530
+ ]);
531
+
532
+ // InferType: { kind: 'circle'; radius: number } | { kind: 'square'; side: number }
533
+ ```
534
+
535
+ > **Notice:** A member whose `transformBeforeValidation` coerces the value will match everything, so
536
+ > nothing after it is ever reached. Order members from most to least specific.
537
+
538
+ #### <a id="h4_record"> record(keySchema, valueSchema) </a>
539
+
540
+ Validates an object whose keys are not known in advance. Every key is checked against `keySchema` and
541
+ every value against `valueSchema`.
542
+
543
+ ```typeScript
544
+ import { record } from 'bguard/record';
545
+ import { string } from 'bguard/string';
546
+ import { number } from 'bguard/number';
547
+
548
+ const countsSchema = record(string(), number());
549
+ // InferType: Record<string, number>
550
+
551
+ const labelsSchema = record(string().oneOfValues(['en', 'sr']), string());
552
+ // InferType: Partial<Record<'en' | 'sr', string>>
553
+ ```
554
+
555
+ A restricted key type infers as `Partial`, because validation checks the keys that are present rather
556
+ than requiring the whole set. Claiming `Record<'en' | 'sr', string>` would say both keys are always
557
+ there, which validation does not guarantee.
558
+
559
+ #### <a id="h4_tuple"> tuple(schemas) </a>
560
+
561
+ A fixed-length array where each position has its own schema. Unlike `array`, which applies one schema
562
+ to every element, the inferred type keeps the positions distinct.
563
+
564
+ ```typeScript
565
+ import { tuple } from 'bguard/tuple';
566
+ import { string } from 'bguard/string';
567
+ import { number } from 'bguard/number';
568
+ import { boolean } from 'bguard/boolean';
569
+
570
+ const pointSchema = tuple([number(), number()]);
571
+ // InferType: [number, number]
572
+
573
+ const entrySchema = tuple([string(), boolean().optional()]);
574
+ // InferType: [string, boolean | undefined]
575
+ ```
576
+
577
+ > **Notice:** `optional()` on a position describes the value at that position, not whether the
578
+ > position exists. The length must still match exactly.
579
+
580
+ #### <a id="h4_intersection"> intersection(schemas) </a>
581
+
582
+ Combines object schemas into one that requires all of them. The shapes are merged when the schema is
583
+ built, so the result is an ordinary object schema — a key declared by any member is recognised.
584
+
585
+ ```typeScript
586
+ import { intersection } from 'bguard/intersection';
587
+ import { object } from 'bguard/object';
588
+ import { string } from 'bguard/string';
589
+
590
+ const withId = object({ id: string() });
591
+ const withTimestamps = object({ createdAt: string(), updatedAt: string() });
592
+
593
+ const entitySchema = intersection([withId, withTimestamps]);
594
+ // InferType: { id: string; createdAt: string; updatedAt: string }
595
+ ```
596
+
597
+ Members must be object schemas, and a key may not be declared twice. Two members declaring the same
598
+ key would mean `A & B` for that property in the type while only one schema could run during
599
+ validation, so it throws a `BuildSchemaError` rather than resolving it one way silently. Member-level
600
+ `nullable()` and `optional()` are rejected for the same reason.
601
+
602
+ #### <a id="h4_lazy"> lazy(typeName, getSchema) </a>
603
+
604
+ Defers building a schema until it is first used, which is what allows a schema to refer to itself.
605
+
606
+ ```typeScript
607
+ import { lazy } from 'bguard/lazy';
608
+ import { object } from 'bguard/object';
609
+ import { array } from 'bguard/array';
610
+ import { string } from 'bguard/string';
611
+ import type { CommonSchema } from 'bguard/core';
612
+
613
+ interface Category {
614
+ name: string;
615
+ children: Category[];
616
+ }
617
+
618
+ const categorySchema: CommonSchema = object({
619
+ name: string(),
620
+ children: array(lazy<Category>('Category', () => categorySchema)),
621
+ });
622
+
623
+ // codeGen: { name: string; children: Category[]; }
624
+ ```
625
+
626
+ The inferred type is the one you supply, because TypeScript cannot infer a type through a
627
+ self-reference. `typeName` is what `codeGen` emits at the recursion point — without it, code
628
+ generation would descend into the schema again and never finish, which is why it is required.
629
+
630
+ > **Notice:** Recursive *schemas* are supported; cyclic *values* are not. Validation follows the data,
631
+ > so a value containing a cycle recurses until the call stack is exhausted.
632
+
633
+ ### <a id="h3_standard_schema"> Standard Schema </a>
634
+
635
+ Every bguard schema implements [Standard Schema](https://github.com/standard-schema/standard-schema) v1,
636
+ so it can be handed to any library that accepts a validator — tRPC, TanStack Form and Router, Hono,
637
+ oRPC, React Hook Form — without either side knowing about the other.
638
+
639
+ ```typeScript
640
+ import { object, string, number } from 'bguard';
641
+
642
+ const schema = object({ name: string(), age: number() });
643
+
644
+ const result = schema['~standard'].validate({ name: 'a', age: 3 });
645
+ // { value: { name: 'a', age: 3 } }
646
+
647
+ const failed = schema['~standard'].validate({ name: 'a', age: 'x' });
648
+ // { issues: [{ message: 'Invalid type of data', path: ['age'] }] }
649
+ ```
650
+
651
+ `validate` collects every issue rather than stopping at the first, since a consumer rendering a form
652
+ needs them all at once. Issue paths are arrays of keys, with numbers for array and tuple positions.
653
+
654
+ ### <a id="h3_error_shape"> Error Shape </a>
655
+
656
+ Each validation error carries:
657
+
658
+ | Field | Meaning |
659
+ | --- | --- |
660
+ | `message` | The translated, human-readable message. |
661
+ | `code` | The translation key of the failure, for example `'s:minLength'`. Stable across locales, so this is what to branch on. |
662
+ | `pathToError` | The location as a string, for display: `'.users[1].mail'`. |
663
+ | `path` | The same location as keys: `['users', 1, 'mail']`. A string path cannot be taken apart again reliably, because a key may itself contain a dot. |
664
+ | `expected` / `received` | What the assertion wanted and what it got. |
665
+ | `meta` | The `id()` and `description()` of the schema that failed, if it has any. |
666
+
667
+ ### <a id="h3_object_utilities"> Deriving Object Schemas </a>
668
+
669
+ Schemas are immutable, so these return a new schema and leave the source alone.
670
+
671
+ ```typeScript
672
+ import { pick } from 'bguard/object/pick';
673
+ import { omit } from 'bguard/object/omit';
674
+ import { partial } from 'bguard/object/partial';
675
+ import { extend } from 'bguard/object/extend';
676
+ import { required } from 'bguard/object/required';
677
+ import { object } from 'bguard/object';
678
+ import { string } from 'bguard/string';
679
+ import { number } from 'bguard/number';
680
+
681
+ const userSchema = object({ id: string(), name: string(), secret: string() });
682
+
683
+ pick(userSchema, ['id', 'name']); // { id: string; name: string }
684
+ omit(userSchema, ['secret']); // { id: string; name: string }
685
+ partial(userSchema); // { id?: string; name?: string; secret?: string }
686
+ extend(userSchema, { age: number() }); // adds age
687
+ required(partial(userSchema)); // back to all required
688
+ ```
689
+
690
+ `extend` replaces a property that is already declared, which is the difference from `intersection`:
691
+ `intersection` rejects a duplicate key because it has no basis for choosing, while `extend` is an
692
+ explicit instruction to override. Each of these carries over the source's `allowUnrecognized`, object
693
+ assertions, `id` and `description`.
694
+
695
+ ### <a id="h3_formatting_errors"> Formatting Errors </a>
696
+
697
+ Two helpers turn the errors array into the shapes a form usually wants. Both work off `path`.
698
+
699
+ ```typeScript
700
+ import { flattenErrors, treeifyErrors, parse, object, string } from 'bguard';
701
+
702
+ const userSchema = object({ email: string(), address: object({ street: string() }) });
703
+ const received: unknown = { email: 1 };
704
+
705
+ const [errors] = parse(userSchema, received, { getAllErrors: true });
706
+
707
+ if (errors) {
708
+ const { formErrors, fieldErrors } = flattenErrors(errors);
709
+ // formErrors: messages belonging to no single field
710
+ // fieldErrors: { email: ['...'], password: ['...'] }
711
+
712
+ const tree = treeifyErrors(errors);
713
+ // tree.properties?.address?.properties?.street?.errors
714
+ }
715
+ ```
716
+
717
+ `flattenErrors` attributes a failure to its top-level field, so a form bound to `address` still sees a
718
+ message that came from `address.street`. `treeifyErrors` keeps the full structure instead.
719
+
720
+ ### <a id="h3_coercion"> Coercion </a>
721
+
722
+ For input that does not arrive already typed — query strings, form data, environment variables.
723
+
724
+ ```typeScript
725
+ import { coerceNumber } from 'bguard/coerce/number';
726
+ import { coerceBoolean } from 'bguard/coerce/boolean';
727
+ import { object } from 'bguard/object';
728
+ import { parseOrFail } from 'bguard';
729
+
730
+ const querySchema = object({
731
+ page: coerceNumber().default(1),
732
+ limit: coerceNumber(),
733
+ active: coerceBoolean(),
734
+ });
735
+
736
+ parseOrFail(querySchema, { limit: '20', active: 'true' });
737
+ // { page: 1, limit: 20, active: true }
738
+ ```
739
+
740
+ `coerceString`, `coerceNumber`, `coerceBoolean`, `coerceBigInt` and `coerceDate` convert the value
741
+ before validating it. Each lives in its own module — `bguard/coerce/number` and so on — like every other
742
+ assertion in the package.
743
+
744
+ They are also gathered on a `coerce` object for when several read better together:
745
+
746
+ ```typeScript
747
+ import { coerce } from 'bguard/coerce';
748
+ import { object } from 'bguard/object';
749
+
750
+ object({ page: coerce.number(), q: coerce.string() });
751
+ ```
752
+
753
+ > **Notice:** that object references all five, so a bundler has to keep all five wherever it is used.
754
+ > Reaching for `coerce.number()` alone still pulls in the string, boolean, bigint and date schemas —
755
+ > measured at 2033 bytes against 87 for importing `coerceNumber` from its own module. Import the one you
756
+ > need when bundle size matters.
757
+
758
+ Anything a helper cannot convert is left alone, so validation reports the type problem rather than the conversion silently
759
+ succeeding: `coerceNumber()` on `'abc'` fails, because `Number('abc')` is `NaN` and `number()` rejects
760
+ that.
761
+
762
+ `null` is never coerced, so `nullable()` still decides whether it is allowed instead of it becoming the
763
+ string `'null'` or the number `0`.
764
+
765
+ > **Notice:** `coerceBoolean()` only converts what unambiguously means a boolean — the strings
766
+ > `'true'` and `'false'` in any case, and the numbers `1` and `0`. Everything else is rejected. This is
767
+ > deliberately narrower than passing the value through `Boolean`, which would accept every input and
768
+ > read `'false'` as `true`.
769
+
770
+ ### <a id="h3_infer_input"> InferInput and InferOutput </a>
771
+
772
+ `InferType` is the type a schema *produces*, which is what `parse` returns. `InferInput` is the type it
773
+ *accepts*. The two differ wherever a schema converts or supplies something:
774
+
775
+ ```typeScript
776
+ import { coerceNumber } from 'bguard/coerce/number';
777
+ import { object } from 'bguard/object';
778
+ import { string } from 'bguard/string';
779
+ import type { InferType, InferInput } from 'bguard/InferType';
780
+
781
+ const schema = object({ page: coerceNumber().default(1), q: string() });
782
+
783
+ type Output = InferType<typeof schema>; // { page: number; q: string }
784
+ type Input = InferInput<typeof schema>; // { q: string; page?: unknown }
785
+ ```
786
+
787
+ A default makes a property optional on the input and present on the output. A coercing schema accepts
788
+ `unknown` and yields its target type. Everywhere else the two coincide, so `InferType` needs no
789
+ thought unless you are generating something from the input side — a form, or a client. `InferOutput` is
790
+ available as a name for symmetry and is the same type as `InferType`.
791
+
792
+ Both are reported through Standard Schema, so a consumer asks for what the schema takes rather than
793
+ what it returns.
794
+
795
+ ### <a id="h3_async"> Async Validation </a>
796
+
797
+ For a check that has to wait — a uniqueness lookup, an HTTP call — use `customAsync` and one of the
798
+ async entry points.
799
+
800
+ ```typeScript
801
+ import { object, string, parseAsync } from 'bguard';
802
+ import type { ExceptionContext } from 'bguard/core';
803
+
804
+ declare function isNameTaken(name: string): Promise<boolean>;
805
+
806
+ const signupSchema = object({
807
+ name: string().customAsync(async (received: string, ctx: ExceptionContext) => {
808
+ if (await isNameTaken(received)) ctx.addIssue('an unused name', received, 'u:taken');
809
+ }),
810
+ });
811
+
812
+ async function handleSignup(received: unknown) {
813
+ const [errors, value] = await parseAsync(signupSchema, received, { getAllErrors: true });
814
+
815
+ if (errors) return errors;
816
+ return value;
817
+ }
818
+ ```
819
+
820
+ `parseAsync` and `parseOrFailAsync` mirror `parse` and `parseOrFail`. The structure is validated
821
+ synchronously first and the async validations are collected as they are reached, then awaited **all
822
+ together** — so several slow checks across one schema cost one round of waiting rather than one each.
823
+
824
+ A synchronous `parse` of a schema carrying an async validation throws a `BuildSchemaError` naming the
825
+ async entry points, rather than skipping the validation. A validation that never runs is worse than a
826
+ clear instruction.
827
+
828
+ Standard Schema handles this on its own: `~standard.validate` returns a promise for a schema that needs
829
+ awaiting and stays synchronous for one that does not. The spec allows either, chosen per call, so a
830
+ consumer that never awaits keeps working for every other schema.
831
+
832
+ > **Notice:** Because the async validations are awaited after the walk, their issues come after the
833
+ > synchronous ones. `parseOrFailAsync` therefore cannot stop at the first error the way `parseOrFail`
834
+ > does; it throws the first one found once everything has been awaited.
835
+
836
+ ### <a id="h3_json_schema"> JSON Schema </a>
837
+
838
+ `toJSONSchema` renders a schema as a JSON Schema document, for OpenAPI, form generators and LLM tool
839
+ definitions.
840
+
841
+ ```typeScript
842
+ import { object, string, number, toJSONSchema } from 'bguard';
843
+ import { minLength } from 'bguard/string/minLength';
844
+
845
+ const userSchema = object({ name: string().custom(minLength(2)), age: number().optional() });
846
+
847
+ toJSONSchema(userSchema, { dialect: null });
848
+ // {
849
+ // type: 'object',
850
+ // properties: { name: { type: 'string', minLength: 2 }, age: { type: 'number' } },
851
+ // required: ['name'],
852
+ // additionalProperties: false,
853
+ // }
854
+ ```
855
+
856
+ Represented: types, object properties and which are required, arrays, tuples, records, unions, literals
857
+ and enums, nullability, defaults, `description()`, and recursive schemas through `$defs` and `$ref`.
858
+ Assertions that map onto a keyword are included — string lengths, patterns and formats, numeric bounds,
859
+ array lengths, `maxKeys`.
860
+
861
+ Assertions with no JSON Schema counterpart are **left out rather than approximated**. `contains('x')`
862
+ has no keyword, so it does not appear; a value the document accepts may still be rejected by bguard.
863
+ The document is a faithful description of what it can express, not a complete one.
864
+
865
+ `bigint` raises a `BuildSchemaError`, since it is not representable in JSON at all and emitting
866
+ `integer` would be a lie. A `date()` becomes `{ type: 'string', format: 'date-time' }`.
867
+
868
+ Pass `dialect: null` to leave out `$schema`, which is what you want when embedding the result in an
869
+ OpenAPI `components.schemas` entry.
870
+
871
+ > **Verified against a real validator:** the generated documents are cross-checked with `ajv` over 70
872
+ > values across 19 schemas, so a JSON Schema validator agrees with bguard about which values pass.
873
+
432
874
  ### <a id="h3_literals"> Literals </a>
433
875
 
434
876
  - <b>String Literals</b>:
@@ -451,6 +893,7 @@ All built-in asserts are documented in the [Built-in Custom Assert Documentation
451
893
  Example
452
894
 
453
895
  ```typeScript
896
+ import { number } from 'bguard/number';
454
897
  import { min } from 'bguard/number/min';
455
898
  import { max } from 'bguard/number/max';
456
899
 
@@ -466,7 +909,7 @@ Bguard allows developers to create custom validation functions that can be integ
466
909
  Example: Creating a `minLength` Custom Validation
467
910
 
468
911
  ```typescript
469
- import { ExceptionContext, RequiredValidation } from 'bguard/ExceptionContext';
912
+ import { ExceptionContext, RequiredValidation } from 'bguard/core';
470
913
  import { setToDefaultLocale } from 'bguard/translationMap';
471
914
 
472
915
  const minLengthErrorMessage = 'The received value {{r}} is shorter than the expected length {{e}}';
@@ -582,6 +1025,9 @@ We have two sets of translations: common errors and specific assertions.
582
1025
  'c:invalidType': 'Invalid type of data',
583
1026
  'c:isBoolean': 'The received value is not {{e}}',
584
1027
  'c:date': 'The received value is not a valid instance of Date',
1028
+ 'c:nan': 'The received number is not a valid number',
1029
+ 'c:union': 'The received value does not match any of the expected types',
1030
+ 'c:tupleLength': 'The received tuple has {{r}} entries but {{e}} were expected',
585
1031
  ```
586
1032
 
587
1033
  <b>Custom Assertion Translations</b>:
@@ -661,6 +1107,9 @@ import { string } from 'bguard/string';
661
1107
  ```typescript
662
1108
  string().oneOfValues(['foo', 'bar']); // Infers the type 'foo' | 'bar'
663
1109
  ```
1110
+
1111
+ Reads the once-only flag without setting it. The flag belongs on the schema that `custom`
1112
+ returns, not on the one it was derived from.
664
1113
 
665
1114
 
666
1115
  ##### <a id="assert_atleastonedigit_string"> atLeastOneDigit </a>
@@ -1325,6 +1774,9 @@ import { bigint } from 'bguard/bigint';
1325
1774
  ```typescript
1326
1775
  bigint().oneOfValues([5n, 7n]); // Infers the type 5n | 7n
1327
1776
  ```
1777
+
1778
+ Reads the once-only flag without setting it. The flag belongs on the schema that `custom`
1779
+ returns, not on the one it was derived from.
1328
1780
 
1329
1781
 
1330
1782
  ##### <a id="assert_bigintmax_bigint"> bigintMax </a>
@@ -1464,6 +1916,10 @@ import { dateMin } from 'bguard/date/dateMin';
1464
1916
  import { oneOfTypes } from 'bguard/mix';
1465
1917
  ```
1466
1918
 
1919
+ Listing `'undefined'` infers `| undefined`, so the schema has to accept a missing value as well,
1920
+ and an object property holding it has to be optional. Both follow from the `WithUndefined` brand
1921
+ plus `isOptional` on the context.
1922
+
1467
1923
  * _Description_ Creates a new schema for validating values that can match any one of the specified primitive types.
1468
1924
 
1469
1925
  * _Param_ {T} valueTypes - An array of primitive types that the value can match.
@@ -1552,6 +2008,30 @@ import { object } from 'bguard/object';
1552
2008
  ```
1553
2009
 
1554
2010
 
2011
+ ##### <a id="assert_extend_object"> extend </a>
2012
+
2013
+ ```typescript
2014
+ import { extend } from 'bguard/object/extend';
2015
+ ```
2016
+
2017
+ * _Description_ Creates a new object schema with extra properties added.
2018
+
2019
+ A property already declared is replaced by the one given here, which is what distinguishes `extend`
2020
+ from `intersection`: `intersection` rejects a duplicate key because it has no basis for choosing,
2021
+ while `extend` is an explicit instruction to override.
2022
+
2023
+
2024
+ @template U
2025
+ * _Param_ {WithObject<CommonSchema, T>} schema - The object schema to build on.
2026
+ @param {U} shapeSchema - The properties to add or replace.
2027
+ * _Example_
2028
+ ```typescript
2029
+ const baseSchema = object({ id: string() });
2030
+ const timestamped = extend(baseSchema, { createdAt: string() });
2031
+ parseOrFail(timestamped, { id: '1', createdAt: 'now' }); // Validates successfully
2032
+ ```
2033
+
2034
+
1555
2035
  ##### <a id="assert_maxkeys_object"> maxKeys </a>
1556
2036
 
1557
2037
  ```typescript
@@ -1578,5 +2058,109 @@ import { maxKeys } from 'bguard/object/maxKeys';
1578
2058
  ```
1579
2059
  * _See_ Error Translation Key = 'o:maxKeys'
1580
2060
 
2061
+
2062
+ ##### <a id="assert_omit_object"> omit </a>
2063
+
2064
+ ```typescript
2065
+ import { omit } from 'bguard/object/omit';
2066
+ ```
2067
+
2068
+ * _Description_ Creates a new object schema without the named properties.
2069
+
2070
+ The original is untouched.
2071
+
2072
+
2073
+ @template K
2074
+ * _Param_ {WithObject<CommonSchema, T>} schema - The object schema to narrow.
2075
+ @param {readonly K[]} keys - The properties to drop.
2076
+ * _Example_
2077
+ ```typescript
2078
+ const userSchema = object({ id: string(), name: string(), secret: string() });
2079
+ const publicSchema = omit(userSchema, ['secret']);
2080
+ parseOrFail(publicSchema, { id: '1', name: 'a' }); // Validates successfully
2081
+ ```
2082
+
2083
+
2084
+ ##### <a id="assert_partial_object"> partial </a>
2085
+
2086
+ ```typescript
2087
+ import { partial } from 'bguard/object/partial';
2088
+ ```
2089
+
2090
+ Named rather than written inline in both the signature and the cast: the two spellings of the same
2091
+ mapped type are not provably identical to the compiler once `~standard` puts a deferred
2092
+ `InferType<this>` inside them.
2093
+
2094
+ * _Description_ Creates a new object schema in which every property is optional.
2095
+
2096
+ Each property schema is made optional in its own right, so the original schema and the property
2097
+ schemas it holds are unchanged.
2098
+
2099
+
2100
+ * _Param_ {WithObject<CommonSchema, T>} schema - The object schema to relax.
2101
+ * _Example_
2102
+ ```typescript
2103
+ const userSchema = object({ id: string(), name: string() });
2104
+ const patchSchema = partial(userSchema);
2105
+ parseOrFail(patchSchema, {}); // Validates successfully
2106
+ ```
2107
+
2108
+
2109
+ ##### <a id="assert_pick_object"> pick </a>
2110
+
2111
+ ```typescript
2112
+ import { pick } from 'bguard/object/pick';
2113
+ ```
2114
+
2115
+ * _Description_ Creates a new object schema keeping only the named properties.
2116
+
2117
+ The original is untouched, and the properties keep the schemas they had, including their assertions
2118
+ and metadata.
2119
+
2120
+
2121
+ @template K
2122
+ * _Param_ {WithObject<CommonSchema, T>} schema - The object schema to narrow.
2123
+ @param {readonly K[]} keys - The properties to keep.
2124
+ * _Example_
2125
+ ```typescript
2126
+ const userSchema = object({ id: string(), name: string(), secret: string() });
2127
+ const publicSchema = pick(userSchema, ['id', 'name']);
2128
+ parseOrFail(publicSchema, { id: '1', name: 'a' }); // Validates successfully
2129
+ ```
2130
+
2131
+ Reads the shape of a schema that must be an object schema. Shared by the object utilities.
2132
+
2133
+ Builds a new object schema from a shape, carrying over the source's own settings.
2134
+
2135
+
2136
+ ##### <a id="assert_required_object"> required </a>
2137
+
2138
+ ```typescript
2139
+ import { required } from 'bguard/object/required';
2140
+ ```
2141
+
2142
+ Named rather than written inline in both the signature and the cast: the two spellings of the same
2143
+ mapped type are not provably identical to the compiler once `~standard` puts a deferred
2144
+ `InferType<this>` inside them.
2145
+
2146
+ Removing the brand rather than trying to recover the type it wraps, because an intersection cannot
2147
+ be taken apart again. What matters to `InferType` is that the result no longer carries the marker.
2148
+
2149
+ * _Description_ Creates a new object schema in which every property is required, the counterpart to
2150
+ `partial`.
2151
+
2152
+ A property that carried a default keeps it, so it may still be omitted — a default is what makes a
2153
+ property supply its own value rather than optional.
2154
+
2155
+
2156
+ * _Param_ {WithObject<CommonSchema, T>} schema - The object schema to tighten.
2157
+ * _Example_
2158
+ ```typescript
2159
+ const patchSchema = partial(object({ id: string(), name: string() }));
2160
+ const fullSchema = required(patchSchema);
2161
+ parseOrFail(fullSchema, { id: '1', name: 'a' }); // Validates successfully
2162
+ parseOrFail(fullSchema, {}); // Throws a validation error
2163
+ ```
2164
+
1581
2165
  ### Contributing
1582
2166
  Contributions are welcome! Please open an issue or submit a pull request for any bugs or feature requests.