bguard 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (685) hide show
  1. package/README.md +571 -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 +1 -0
  5. package/lib/asserts/array/index.d.ts +1 -0
  6. package/lib/asserts/array/index.js +6 -6
  7. package/lib/asserts/array/index.mjs +5 -5
  8. package/lib/asserts/array/maxArrayLength.d.mts +2 -1
  9. package/lib/asserts/array/maxArrayLength.d.ts +2 -1
  10. package/lib/asserts/array/maxArrayLength.js +5 -4
  11. package/lib/asserts/array/maxArrayLength.js.map +1 -1
  12. package/lib/asserts/array/maxArrayLength.mjs +4 -3
  13. package/lib/asserts/array/minArrayLength.d.mts +2 -1
  14. package/lib/asserts/array/minArrayLength.d.ts +2 -1
  15. package/lib/asserts/array/minArrayLength.js +5 -4
  16. package/lib/asserts/array/minArrayLength.js.map +1 -1
  17. package/lib/asserts/array/minArrayLength.mjs +4 -3
  18. package/lib/asserts/bigint/bigintMax.d.mts +2 -1
  19. package/lib/asserts/bigint/bigintMax.d.ts +2 -1
  20. package/lib/asserts/bigint/bigintMax.js +4 -4
  21. package/lib/asserts/bigint/bigintMax.mjs +3 -3
  22. package/lib/asserts/bigint/bigintMaxExcluded.d.mts +2 -1
  23. package/lib/asserts/bigint/bigintMaxExcluded.d.ts +2 -1
  24. package/lib/asserts/bigint/bigintMaxExcluded.js +4 -4
  25. package/lib/asserts/bigint/bigintMaxExcluded.mjs +3 -3
  26. package/lib/asserts/bigint/bigintMin.d.mts +2 -1
  27. package/lib/asserts/bigint/bigintMin.d.ts +2 -1
  28. package/lib/asserts/bigint/bigintMin.js +4 -4
  29. package/lib/asserts/bigint/bigintMin.mjs +3 -3
  30. package/lib/asserts/bigint/bigintMinExcluded.d.mts +2 -1
  31. package/lib/asserts/bigint/bigintMinExcluded.d.ts +2 -1
  32. package/lib/asserts/bigint/bigintMinExcluded.js +4 -4
  33. package/lib/asserts/bigint/bigintMinExcluded.mjs +3 -3
  34. package/lib/asserts/bigint/index.d.mts +8 -3
  35. package/lib/asserts/bigint/index.d.ts +8 -3
  36. package/lib/asserts/bigint/index.js +9 -9
  37. package/lib/asserts/bigint/index.mjs +8 -8
  38. package/lib/asserts/boolean/index.d.mts +9 -2
  39. package/lib/asserts/boolean/index.d.ts +9 -2
  40. package/lib/asserts/boolean/index.js +7 -7
  41. package/lib/asserts/boolean/index.mjs +6 -6
  42. package/lib/asserts/coerce/index.d.mts +52 -0
  43. package/lib/asserts/coerce/index.d.ts +52 -0
  44. package/lib/asserts/coerce/index.js +21 -0
  45. package/lib/asserts/coerce/index.js.map +1 -0
  46. package/lib/asserts/coerce/index.mjs +21 -0
  47. package/lib/asserts/coerce/index.mjs.map +1 -0
  48. package/lib/asserts/date/dateMax.d.mts +2 -1
  49. package/lib/asserts/date/dateMax.d.ts +2 -1
  50. package/lib/asserts/date/dateMax.js +4 -4
  51. package/lib/asserts/date/dateMax.mjs +3 -3
  52. package/lib/asserts/date/dateMin.d.mts +2 -1
  53. package/lib/asserts/date/dateMin.d.ts +2 -1
  54. package/lib/asserts/date/dateMin.js +4 -4
  55. package/lib/asserts/date/dateMin.mjs +3 -3
  56. package/lib/asserts/date/index.d.mts +1 -0
  57. package/lib/asserts/date/index.d.ts +1 -0
  58. package/lib/asserts/date/index.js +6 -6
  59. package/lib/asserts/date/index.mjs +5 -5
  60. package/lib/asserts/intersection/index.d.mts +36 -0
  61. package/lib/asserts/intersection/index.d.ts +36 -0
  62. package/lib/asserts/intersection/index.js +13 -0
  63. package/lib/asserts/intersection/index.js.map +1 -0
  64. package/lib/asserts/intersection/index.mjs +13 -0
  65. package/lib/asserts/intersection/index.mjs.map +1 -0
  66. package/lib/asserts/lazy/index.d.mts +42 -0
  67. package/lib/asserts/lazy/index.d.ts +42 -0
  68. package/lib/asserts/lazy/index.js +12 -0
  69. package/lib/asserts/lazy/index.js.map +1 -0
  70. package/lib/asserts/lazy/index.mjs +12 -0
  71. package/lib/asserts/lazy/index.mjs.map +1 -0
  72. package/lib/asserts/mix/equalTo.d.mts +2 -1
  73. package/lib/asserts/mix/equalTo.d.ts +2 -1
  74. package/lib/asserts/mix/equalTo.js +4 -4
  75. package/lib/asserts/mix/equalTo.mjs +3 -3
  76. package/lib/asserts/mix/index.d.mts +10 -3
  77. package/lib/asserts/mix/index.d.ts +10 -3
  78. package/lib/asserts/mix/index.js +6 -6
  79. package/lib/asserts/mix/index.mjs +5 -5
  80. package/lib/asserts/mix/oneOfValues.d.mts +2 -1
  81. package/lib/asserts/mix/oneOfValues.d.ts +2 -1
  82. package/lib/asserts/mix/oneOfValues.js +4 -4
  83. package/lib/asserts/mix/oneOfValues.mjs +3 -3
  84. package/lib/asserts/number/index.d.mts +3 -2
  85. package/lib/asserts/number/index.d.ts +3 -2
  86. package/lib/asserts/number/index.js +9 -9
  87. package/lib/asserts/number/index.mjs +8 -8
  88. package/lib/asserts/number/max.d.mts +2 -1
  89. package/lib/asserts/number/max.d.ts +2 -1
  90. package/lib/asserts/number/max.js +5 -4
  91. package/lib/asserts/number/max.js.map +1 -1
  92. package/lib/asserts/number/max.mjs +4 -3
  93. package/lib/asserts/number/maxExcluded.d.mts +2 -1
  94. package/lib/asserts/number/maxExcluded.d.ts +2 -1
  95. package/lib/asserts/number/maxExcluded.js +5 -4
  96. package/lib/asserts/number/maxExcluded.js.map +1 -1
  97. package/lib/asserts/number/maxExcluded.mjs +4 -3
  98. package/lib/asserts/number/min.d.mts +2 -1
  99. package/lib/asserts/number/min.d.ts +2 -1
  100. package/lib/asserts/number/min.js +5 -4
  101. package/lib/asserts/number/min.js.map +1 -1
  102. package/lib/asserts/number/min.mjs +4 -3
  103. package/lib/asserts/number/minExcluded.d.mts +2 -1
  104. package/lib/asserts/number/minExcluded.d.ts +2 -1
  105. package/lib/asserts/number/minExcluded.js +5 -4
  106. package/lib/asserts/number/minExcluded.js.map +1 -1
  107. package/lib/asserts/number/minExcluded.mjs +4 -3
  108. package/lib/asserts/number/negative.d.mts +2 -1
  109. package/lib/asserts/number/negative.d.ts +2 -1
  110. package/lib/asserts/number/negative.js +5 -4
  111. package/lib/asserts/number/negative.js.map +1 -1
  112. package/lib/asserts/number/negative.mjs +4 -3
  113. package/lib/asserts/number/positive.d.mts +2 -1
  114. package/lib/asserts/number/positive.d.ts +2 -1
  115. package/lib/asserts/number/positive.js +5 -4
  116. package/lib/asserts/number/positive.js.map +1 -1
  117. package/lib/asserts/number/positive.mjs +4 -3
  118. package/lib/asserts/object/extend.d.mts +29 -0
  119. package/lib/asserts/object/extend.d.ts +29 -0
  120. package/lib/asserts/object/extend.js +14 -0
  121. package/lib/asserts/object/extend.js.map +1 -0
  122. package/lib/asserts/object/extend.mjs +14 -0
  123. package/lib/asserts/object/extend.mjs.map +1 -0
  124. package/lib/asserts/object/index.d.mts +3 -2
  125. package/lib/asserts/object/index.d.ts +3 -2
  126. package/lib/asserts/object/index.js +8 -6
  127. package/lib/asserts/object/index.js.map +1 -1
  128. package/lib/asserts/object/index.mjs +7 -5
  129. package/lib/asserts/object/maxKeys.d.mts +2 -1
  130. package/lib/asserts/object/maxKeys.d.ts +2 -1
  131. package/lib/asserts/object/maxKeys.js +5 -4
  132. package/lib/asserts/object/maxKeys.js.map +1 -1
  133. package/lib/asserts/object/maxKeys.mjs +4 -3
  134. package/lib/asserts/object/omit.d.mts +27 -0
  135. package/lib/asserts/object/omit.d.ts +27 -0
  136. package/lib/asserts/object/omit.js +14 -0
  137. package/lib/asserts/object/omit.js.map +1 -0
  138. package/lib/asserts/object/omit.mjs +14 -0
  139. package/lib/asserts/object/omit.mjs.map +1 -0
  140. package/lib/asserts/object/partial.d.mts +34 -0
  141. package/lib/asserts/object/partial.d.ts +34 -0
  142. package/lib/asserts/object/partial.js +14 -0
  143. package/lib/asserts/object/partial.js.map +1 -0
  144. package/lib/asserts/object/partial.mjs +14 -0
  145. package/lib/asserts/object/partial.mjs.map +1 -0
  146. package/lib/asserts/object/pick.d.mts +32 -0
  147. package/lib/asserts/object/pick.d.ts +32 -0
  148. package/lib/asserts/object/pick.js +17 -0
  149. package/lib/asserts/object/pick.js.map +1 -0
  150. package/lib/asserts/object/pick.mjs +17 -0
  151. package/lib/asserts/object/pick.mjs.map +1 -0
  152. package/lib/asserts/object/required.d.mts +39 -0
  153. package/lib/asserts/object/required.d.ts +39 -0
  154. package/lib/asserts/object/required.js +14 -0
  155. package/lib/asserts/object/required.js.map +1 -0
  156. package/lib/asserts/object/required.mjs +14 -0
  157. package/lib/asserts/object/required.mjs.map +1 -0
  158. package/lib/asserts/record/index.d.mts +28 -0
  159. package/lib/asserts/record/index.d.ts +28 -0
  160. package/lib/asserts/record/index.js +12 -0
  161. package/lib/asserts/record/index.js.map +1 -0
  162. package/lib/asserts/record/index.mjs +12 -0
  163. package/lib/asserts/record/index.mjs.map +1 -0
  164. package/lib/asserts/string/atLeastOneDigit.d.mts +2 -1
  165. package/lib/asserts/string/atLeastOneDigit.d.ts +2 -1
  166. package/lib/asserts/string/atLeastOneDigit.js +4 -4
  167. package/lib/asserts/string/atLeastOneDigit.mjs +3 -3
  168. package/lib/asserts/string/atLeastOneLowerChar.d.mts +2 -1
  169. package/lib/asserts/string/atLeastOneLowerChar.d.ts +2 -1
  170. package/lib/asserts/string/atLeastOneLowerChar.js +4 -4
  171. package/lib/asserts/string/atLeastOneLowerChar.mjs +3 -3
  172. package/lib/asserts/string/atLeastOneSpecialChar.d.mts +2 -1
  173. package/lib/asserts/string/atLeastOneSpecialChar.d.ts +2 -1
  174. package/lib/asserts/string/atLeastOneSpecialChar.js +4 -4
  175. package/lib/asserts/string/atLeastOneSpecialChar.mjs +3 -3
  176. package/lib/asserts/string/atLeastOneUpperChar.d.mts +2 -1
  177. package/lib/asserts/string/atLeastOneUpperChar.d.ts +2 -1
  178. package/lib/asserts/string/atLeastOneUpperChar.js +4 -4
  179. package/lib/asserts/string/atLeastOneUpperChar.mjs +3 -3
  180. package/lib/asserts/string/contains.d.mts +2 -1
  181. package/lib/asserts/string/contains.d.ts +2 -1
  182. package/lib/asserts/string/contains.js +4 -4
  183. package/lib/asserts/string/contains.mjs +3 -3
  184. package/lib/asserts/string/email.d.mts +2 -1
  185. package/lib/asserts/string/email.d.ts +2 -1
  186. package/lib/asserts/string/email.js +5 -4
  187. package/lib/asserts/string/email.js.map +1 -1
  188. package/lib/asserts/string/email.mjs +4 -3
  189. package/lib/asserts/string/endsWith.d.mts +2 -1
  190. package/lib/asserts/string/endsWith.d.ts +2 -1
  191. package/lib/asserts/string/endsWith.js +4 -4
  192. package/lib/asserts/string/endsWith.mjs +3 -3
  193. package/lib/asserts/string/index.d.mts +8 -3
  194. package/lib/asserts/string/index.d.ts +8 -3
  195. package/lib/asserts/string/index.js +10 -9
  196. package/lib/asserts/string/index.js.map +1 -1
  197. package/lib/asserts/string/index.mjs +9 -8
  198. package/lib/asserts/string/isValidDate.d.mts +2 -1
  199. package/lib/asserts/string/isValidDate.d.ts +2 -1
  200. package/lib/asserts/string/isValidDate.js +5 -4
  201. package/lib/asserts/string/isValidDate.js.map +1 -1
  202. package/lib/asserts/string/isValidDate.mjs +4 -3
  203. package/lib/asserts/string/isValidDateTime.d.mts +2 -1
  204. package/lib/asserts/string/isValidDateTime.d.ts +2 -1
  205. package/lib/asserts/string/isValidDateTime.js +5 -4
  206. package/lib/asserts/string/isValidDateTime.js.map +1 -1
  207. package/lib/asserts/string/isValidDateTime.mjs +4 -3
  208. package/lib/asserts/string/isValidTime.d.mts +2 -1
  209. package/lib/asserts/string/isValidTime.d.ts +2 -1
  210. package/lib/asserts/string/isValidTime.js +5 -4
  211. package/lib/asserts/string/isValidTime.js.map +1 -1
  212. package/lib/asserts/string/isValidTime.mjs +4 -3
  213. package/lib/asserts/string/lowerCase.d.mts +2 -1
  214. package/lib/asserts/string/lowerCase.d.ts +2 -1
  215. package/lib/asserts/string/lowerCase.js +4 -4
  216. package/lib/asserts/string/lowerCase.mjs +3 -3
  217. package/lib/asserts/string/maxLength.d.mts +2 -1
  218. package/lib/asserts/string/maxLength.d.ts +2 -1
  219. package/lib/asserts/string/maxLength.js +5 -4
  220. package/lib/asserts/string/maxLength.js.map +1 -1
  221. package/lib/asserts/string/maxLength.mjs +4 -3
  222. package/lib/asserts/string/minLength.d.mts +2 -1
  223. package/lib/asserts/string/minLength.d.ts +2 -1
  224. package/lib/asserts/string/minLength.js +5 -4
  225. package/lib/asserts/string/minLength.js.map +1 -1
  226. package/lib/asserts/string/minLength.mjs +4 -3
  227. package/lib/asserts/string/regExp.d.mts +2 -1
  228. package/lib/asserts/string/regExp.d.ts +2 -1
  229. package/lib/asserts/string/regExp.js +5 -4
  230. package/lib/asserts/string/regExp.js.map +1 -1
  231. package/lib/asserts/string/regExp.mjs +4 -3
  232. package/lib/asserts/string/startsWith.d.mts +2 -1
  233. package/lib/asserts/string/startsWith.d.ts +2 -1
  234. package/lib/asserts/string/startsWith.js +4 -4
  235. package/lib/asserts/string/startsWith.mjs +3 -3
  236. package/lib/asserts/string/upperCase.d.mts +2 -1
  237. package/lib/asserts/string/upperCase.d.ts +2 -1
  238. package/lib/asserts/string/upperCase.js +4 -4
  239. package/lib/asserts/string/upperCase.mjs +3 -3
  240. package/lib/asserts/string/uuid.d.mts +2 -1
  241. package/lib/asserts/string/uuid.d.ts +2 -1
  242. package/lib/asserts/string/uuid.js +5 -4
  243. package/lib/asserts/string/uuid.js.map +1 -1
  244. package/lib/asserts/string/uuid.mjs +4 -3
  245. package/lib/asserts/string/uuidV1.d.mts +2 -1
  246. package/lib/asserts/string/uuidV1.d.ts +2 -1
  247. package/lib/asserts/string/uuidV1.js +4 -4
  248. package/lib/asserts/string/uuidV1.mjs +3 -3
  249. package/lib/asserts/string/uuidV2.d.mts +2 -1
  250. package/lib/asserts/string/uuidV2.d.ts +2 -1
  251. package/lib/asserts/string/uuidV2.js +4 -4
  252. package/lib/asserts/string/uuidV2.mjs +3 -3
  253. package/lib/asserts/string/uuidV3.d.mts +2 -1
  254. package/lib/asserts/string/uuidV3.d.ts +2 -1
  255. package/lib/asserts/string/uuidV3.js +4 -4
  256. package/lib/asserts/string/uuidV3.mjs +3 -3
  257. package/lib/asserts/string/uuidV4.d.mts +2 -1
  258. package/lib/asserts/string/uuidV4.d.ts +2 -1
  259. package/lib/asserts/string/uuidV4.js +4 -4
  260. package/lib/asserts/string/uuidV4.mjs +3 -3
  261. package/lib/asserts/string/uuidV5.d.mts +2 -1
  262. package/lib/asserts/string/uuidV5.d.ts +2 -1
  263. package/lib/asserts/string/uuidV5.js +4 -4
  264. package/lib/asserts/string/uuidV5.mjs +3 -3
  265. package/lib/asserts/string/validUrl.d.mts +2 -1
  266. package/lib/asserts/string/validUrl.d.ts +2 -1
  267. package/lib/asserts/string/validUrl.js +5 -4
  268. package/lib/asserts/string/validUrl.js.map +1 -1
  269. package/lib/asserts/string/validUrl.mjs +4 -3
  270. package/lib/asserts/tuple/index.d.mts +28 -0
  271. package/lib/asserts/tuple/index.d.ts +28 -0
  272. package/lib/asserts/tuple/index.js +12 -0
  273. package/lib/asserts/tuple/index.js.map +1 -0
  274. package/lib/asserts/tuple/index.mjs +12 -0
  275. package/lib/asserts/tuple/index.mjs.map +1 -0
  276. package/lib/asserts/union/index.d.mts +29 -0
  277. package/lib/asserts/union/index.d.ts +29 -0
  278. package/lib/asserts/union/index.js +12 -0
  279. package/lib/asserts/union/index.js.map +1 -0
  280. package/lib/asserts/union/index.mjs +12 -0
  281. package/lib/asserts/union/index.mjs.map +1 -0
  282. package/lib/{chunk-Y5MNJGFX.js → chunk-2AYQ7GRP.js} +9 -6
  283. package/lib/chunk-2AYQ7GRP.js.map +1 -0
  284. package/lib/{chunk-OMSHZITC.js → chunk-2KLV3CHA.js} +3 -3
  285. package/lib/{chunk-OMSHZITC.js.map → chunk-2KLV3CHA.js.map} +1 -1
  286. package/lib/{chunk-MHWPSQB3.js → chunk-2X6V3ODY.js} +3 -3
  287. package/lib/{chunk-MHWPSQB3.js.map → chunk-2X6V3ODY.js.map} +1 -1
  288. package/lib/{chunk-QIFA6S5U.mjs → chunk-346TIMNH.mjs} +2 -2
  289. package/lib/{chunk-QIFA6S5U.mjs.map → chunk-346TIMNH.mjs.map} +1 -1
  290. package/lib/{chunk-PAV4SQQL.js → chunk-3D6TPN7F.js} +3 -3
  291. package/lib/{chunk-PAV4SQQL.js.map → chunk-3D6TPN7F.js.map} +1 -1
  292. package/lib/{chunk-4UPXP4I3.js → chunk-3OAUE5VW.js} +8 -5
  293. package/lib/chunk-3OAUE5VW.js.map +1 -0
  294. package/lib/chunk-3PTVMZY7.js +22 -0
  295. package/lib/chunk-3PTVMZY7.js.map +1 -0
  296. package/lib/{chunk-QEG24G7E.mjs → chunk-3T5QKF7X.mjs} +2 -2
  297. package/lib/{chunk-QEG24G7E.mjs.map → chunk-3T5QKF7X.mjs.map} +1 -1
  298. package/lib/{chunk-FI737YZJ.js → chunk-45K4AUO3.js} +9 -6
  299. package/lib/chunk-45K4AUO3.js.map +1 -0
  300. package/lib/{chunk-PNSDUVRE.mjs → chunk-4AZOGLHD.mjs} +2 -2
  301. package/lib/{chunk-PNSDUVRE.mjs.map → chunk-4AZOGLHD.mjs.map} +1 -1
  302. package/lib/{chunk-HWVM4SYU.mjs → chunk-54F462SS.mjs} +7 -4
  303. package/lib/chunk-54F462SS.mjs.map +1 -0
  304. package/lib/{chunk-S4FWDTEW.mjs → chunk-55P4YTMX.mjs} +2 -2
  305. package/lib/{chunk-S4FWDTEW.mjs.map → chunk-55P4YTMX.mjs.map} +1 -1
  306. package/lib/chunk-5PIGAEGL.mjs +22 -0
  307. package/lib/chunk-5PIGAEGL.mjs.map +1 -0
  308. package/lib/{chunk-ZGUF5ZDP.mjs → chunk-5U5CYDRB.mjs} +2 -2
  309. package/lib/{chunk-ZGUF5ZDP.mjs.map → chunk-5U5CYDRB.mjs.map} +1 -1
  310. package/lib/chunk-5VZDHJKM.mjs +68 -0
  311. package/lib/chunk-5VZDHJKM.mjs.map +1 -0
  312. package/lib/{chunk-V7C77FML.mjs → chunk-5WLWZKC6.mjs} +7 -4
  313. package/lib/chunk-5WLWZKC6.mjs.map +1 -0
  314. package/lib/{chunk-GFWZQ4XW.mjs → chunk-5WV7FMW7.mjs} +8 -5
  315. package/lib/chunk-5WV7FMW7.mjs.map +1 -0
  316. package/lib/{chunk-OE3L7EKN.mjs → chunk-65X7NTUS.mjs} +18 -9
  317. package/lib/chunk-65X7NTUS.mjs.map +1 -0
  318. package/lib/chunk-6LUSV3SS.js +595 -0
  319. package/lib/chunk-6LUSV3SS.js.map +1 -0
  320. package/lib/{chunk-BRFUFNU4.js → chunk-7A4RN5UD.js} +9 -6
  321. package/lib/chunk-7A4RN5UD.js.map +1 -0
  322. package/lib/{chunk-ENZ5WDUQ.js → chunk-7CNZKYPM.js} +8 -5
  323. package/lib/chunk-7CNZKYPM.js.map +1 -0
  324. package/lib/{chunk-NS4GXUCA.mjs → chunk-7F4P72SG.mjs} +2 -2
  325. package/lib/{chunk-NS4GXUCA.mjs.map → chunk-7F4P72SG.mjs.map} +1 -1
  326. package/lib/chunk-A36G62K5.mjs +49 -0
  327. package/lib/chunk-A36G62K5.mjs.map +1 -0
  328. package/lib/{chunk-24LO7MNY.js → chunk-A5OEVSSV.js} +8 -5
  329. package/lib/chunk-A5OEVSSV.js.map +1 -0
  330. package/lib/{chunk-KRCOKWAB.mjs → chunk-ABSZMCDX.mjs} +8 -5
  331. package/lib/chunk-ABSZMCDX.mjs.map +1 -0
  332. package/lib/{chunk-PVQALO2H.js → chunk-ALXDH7GS.js} +3 -3
  333. package/lib/{chunk-PVQALO2H.js.map → chunk-ALXDH7GS.js.map} +1 -1
  334. package/lib/chunk-AO6DKPJZ.js +49 -0
  335. package/lib/chunk-AO6DKPJZ.js.map +1 -0
  336. package/lib/{chunk-TQDMUHTA.mjs → chunk-AYJCGPXI.mjs} +2 -2
  337. package/lib/{chunk-TQDMUHTA.mjs.map → chunk-AYJCGPXI.mjs.map} +1 -1
  338. package/lib/{chunk-OSFIPFQ3.mjs → chunk-AYSJLD4S.mjs} +5 -5
  339. package/lib/{chunk-OSFIPFQ3.mjs.map → chunk-AYSJLD4S.mjs.map} +1 -1
  340. package/lib/{chunk-6WKSLMJG.mjs → chunk-B2R5S6OH.mjs} +6 -6
  341. package/lib/chunk-B3IWQRZF.mjs +22 -0
  342. package/lib/chunk-B3IWQRZF.mjs.map +1 -0
  343. package/lib/{chunk-DCPRPCZ3.js → chunk-B4WB3UB7.js} +3 -3
  344. package/lib/{chunk-DCPRPCZ3.js.map → chunk-B4WB3UB7.js.map} +1 -1
  345. package/lib/chunk-BZ6R6RWE.mjs +19 -0
  346. package/lib/chunk-BZ6R6RWE.mjs.map +1 -0
  347. package/lib/{chunk-MCQHWS3E.mjs → chunk-C6ICGQEX.mjs} +7 -4
  348. package/lib/chunk-C6ICGQEX.mjs.map +1 -0
  349. package/lib/{chunk-2ANPCB4O.mjs → chunk-C76DLZFD.mjs} +2 -2
  350. package/lib/{chunk-2ANPCB4O.mjs.map → chunk-C76DLZFD.mjs.map} +1 -1
  351. package/lib/{chunk-OZ3BTSSQ.mjs → chunk-CJCIOMS7.mjs} +19 -17
  352. package/lib/chunk-CJCIOMS7.mjs.map +1 -0
  353. package/lib/chunk-CLRHVTVY.js +50 -0
  354. package/lib/chunk-CLRHVTVY.js.map +1 -0
  355. package/lib/{chunk-QMIH3A4D.js → chunk-CWYS6MUA.js} +3 -3
  356. package/lib/{chunk-QMIH3A4D.js.map → chunk-CWYS6MUA.js.map} +1 -1
  357. package/lib/{chunk-W3U7RYLP.mjs → chunk-D42AL6CN.mjs} +2 -2
  358. package/lib/{chunk-W3U7RYLP.mjs.map → chunk-D42AL6CN.mjs.map} +1 -1
  359. package/lib/{chunk-YDTQASAY.mjs → chunk-D4YY45O2.mjs} +8 -5
  360. package/lib/chunk-D4YY45O2.mjs.map +1 -0
  361. package/lib/{chunk-WLPDAJB3.js → chunk-DKGRAVID.js} +29 -11
  362. package/lib/chunk-DKGRAVID.js.map +1 -0
  363. package/lib/{chunk-TZBAW5OO.mjs → chunk-DLEDKNPD.mjs} +2 -2
  364. package/lib/{chunk-TZBAW5OO.mjs.map → chunk-DLEDKNPD.mjs.map} +1 -1
  365. package/lib/{chunk-NBR3QGKW.js → chunk-DPXTSNEX.js} +5 -5
  366. package/lib/{chunk-NBR3QGKW.js.map → chunk-DPXTSNEX.js.map} +1 -1
  367. package/lib/{chunk-6JPYR2TS.js → chunk-ECLNZ233.js} +9 -6
  368. package/lib/chunk-ECLNZ233.js.map +1 -0
  369. package/lib/chunk-EEKYR5IA.js +19 -0
  370. package/lib/chunk-EEKYR5IA.js.map +1 -0
  371. package/lib/{chunk-TCDQA2NU.js → chunk-EJCCIGXH.js} +8 -8
  372. package/lib/{chunk-TCDQA2NU.js.map → chunk-EJCCIGXH.js.map} +1 -1
  373. package/lib/{chunk-6LPQRAFN.js → chunk-EN745GWN.js} +10 -7
  374. package/lib/chunk-EN745GWN.js.map +1 -0
  375. package/lib/{chunk-OFZMO7PB.mjs → chunk-ETBJ4NF4.mjs} +7 -4
  376. package/lib/chunk-ETBJ4NF4.mjs.map +1 -0
  377. package/lib/chunk-EVM26M2C.js +66 -0
  378. package/lib/chunk-EVM26M2C.js.map +1 -0
  379. package/lib/{chunk-23QTSXPQ.js → chunk-FJEBPEGR.js} +8 -5
  380. package/lib/chunk-FJEBPEGR.js.map +1 -0
  381. package/lib/chunk-FTHEF6SB.js +14 -0
  382. package/lib/{chunk-XDVSL5B6.js.map → chunk-FTHEF6SB.js.map} +1 -1
  383. package/lib/chunk-G2VC3SQB.js +22 -0
  384. package/lib/chunk-G2VC3SQB.js.map +1 -0
  385. package/lib/{chunk-NOJB5GBZ.mjs → chunk-G6YZVGWC.mjs} +8 -5
  386. package/lib/chunk-G6YZVGWC.mjs.map +1 -0
  387. package/lib/{chunk-Z2HZXSDA.js → chunk-GSLVYDXO.js} +3 -3
  388. package/lib/{chunk-Z2HZXSDA.js.map → chunk-GSLVYDXO.js.map} +1 -1
  389. package/lib/{chunk-H4OW6OUF.js → chunk-GTGXSQKC.js} +3 -3
  390. package/lib/{chunk-H4OW6OUF.js.map → chunk-GTGXSQKC.js.map} +1 -1
  391. package/lib/chunk-GYLCPX6O.js +68 -0
  392. package/lib/chunk-GYLCPX6O.js.map +1 -0
  393. package/lib/{chunk-Z3NPFUIA.mjs → chunk-H3FXZTYS.mjs} +2 -2
  394. package/lib/{chunk-Z3NPFUIA.mjs.map → chunk-H3FXZTYS.mjs.map} +1 -1
  395. package/lib/{chunk-T2A3XXQZ.mjs → chunk-HKDDJSN2.mjs} +8 -5
  396. package/lib/chunk-HKDDJSN2.mjs.map +1 -0
  397. package/lib/{chunk-THU5VBSO.mjs → chunk-IIL6D2UL.mjs} +2 -2
  398. package/lib/{chunk-AJHBPMZT.mjs → chunk-IWNVHB2K.mjs} +8 -5
  399. package/lib/chunk-IWNVHB2K.mjs.map +1 -0
  400. package/lib/{chunk-2ESDKTV4.js → chunk-JF7KZZ7R.js} +9 -6
  401. package/lib/chunk-JF7KZZ7R.js.map +1 -0
  402. package/lib/chunk-JHONMWCE.js +27 -0
  403. package/lib/chunk-JHONMWCE.js.map +1 -0
  404. package/lib/{chunk-DED5KDLM.js → chunk-JLEQOYDW.js} +15 -13
  405. package/lib/chunk-JLEQOYDW.js.map +1 -0
  406. package/lib/{chunk-HD37VXPZ.mjs → chunk-JND3VAPR.mjs} +2 -2
  407. package/lib/{chunk-HD37VXPZ.mjs.map → chunk-JND3VAPR.mjs.map} +1 -1
  408. package/lib/chunk-K4YXIN2V.mjs +33 -0
  409. package/lib/chunk-K4YXIN2V.mjs.map +1 -0
  410. package/lib/{chunk-NY2TPU6O.mjs → chunk-K6QYFFMX.mjs} +8 -5
  411. package/lib/chunk-K6QYFFMX.mjs.map +1 -0
  412. package/lib/{chunk-M3HYPZLE.mjs → chunk-KAFZGQ2W.mjs} +10 -8
  413. package/lib/chunk-KAFZGQ2W.mjs.map +1 -0
  414. package/lib/{chunk-DFYP4GKE.js → chunk-KDPYWGMJ.js} +8 -5
  415. package/lib/chunk-KDPYWGMJ.js.map +1 -0
  416. package/lib/chunk-KGNT5T35.mjs +70 -0
  417. package/lib/chunk-KGNT5T35.mjs.map +1 -0
  418. package/lib/{chunk-R25HSJPH.js → chunk-KIVIWBIY.js} +3 -3
  419. package/lib/{chunk-R25HSJPH.js.map → chunk-KIVIWBIY.js.map} +1 -1
  420. package/lib/{chunk-ZNQHNLKW.js → chunk-KZBW5WCK.js} +8 -5
  421. package/lib/chunk-KZBW5WCK.js.map +1 -0
  422. package/lib/{chunk-VVXKATDH.js → chunk-L36PQXUB.js} +8 -5
  423. package/lib/chunk-L36PQXUB.js.map +1 -0
  424. package/lib/chunk-L7YFDMZU.js +78 -0
  425. package/lib/chunk-L7YFDMZU.js.map +1 -0
  426. package/lib/chunk-LDZFOOWN.mjs +595 -0
  427. package/lib/chunk-LDZFOOWN.mjs.map +1 -0
  428. package/lib/{chunk-AXKX5BGH.js → chunk-LHEU4XAC.js} +2 -2
  429. package/lib/chunk-LHEU4XAC.js.map +1 -0
  430. package/lib/chunk-LNBZ7SJR.js +26 -0
  431. package/lib/chunk-LNBZ7SJR.js.map +1 -0
  432. package/lib/{chunk-AQCV7PB4.mjs → chunk-M7EMQU7U.mjs} +5 -5
  433. package/lib/{chunk-AQCV7PB4.mjs.map → chunk-M7EMQU7U.mjs.map} +1 -1
  434. package/lib/{chunk-GGWJJFXY.mjs → chunk-MOHROZTD.mjs} +2 -2
  435. package/lib/{chunk-GGWJJFXY.mjs.map → chunk-MOHROZTD.mjs.map} +1 -1
  436. package/lib/{chunk-SBO6OQIX.mjs → chunk-MQGE7GIK.mjs} +8 -5
  437. package/lib/chunk-MQGE7GIK.mjs.map +1 -0
  438. package/lib/{chunk-H2M4FCRZ.mjs → chunk-NC7E2FQR.mjs} +2 -2
  439. package/lib/{chunk-H2M4FCRZ.mjs.map → chunk-NC7E2FQR.mjs.map} +1 -1
  440. package/lib/chunk-NM3VRT77.mjs +120 -0
  441. package/lib/chunk-NM3VRT77.mjs.map +1 -0
  442. package/lib/{chunk-OHUOBIHX.mjs → chunk-NM4TCTZM.mjs} +28 -10
  443. package/lib/chunk-NM4TCTZM.mjs.map +1 -0
  444. package/lib/chunk-NXS5ULAJ.mjs +22 -0
  445. package/lib/chunk-NXS5ULAJ.mjs.map +1 -0
  446. package/lib/{chunk-2D3HCTJV.js → chunk-NZOANK7A.js} +3 -3
  447. package/lib/{chunk-2D3HCTJV.js.map → chunk-NZOANK7A.js.map} +1 -1
  448. package/lib/{chunk-ZTCXXAKD.mjs → chunk-O2WD4JBG.mjs} +8 -2
  449. package/lib/chunk-O2WD4JBG.mjs.map +1 -0
  450. package/lib/chunk-O4FVL7CA.js +33 -0
  451. package/lib/chunk-O4FVL7CA.js.map +1 -0
  452. package/lib/{chunk-WYM2TIVW.mjs → chunk-O646PJXY.mjs} +3 -3
  453. package/lib/{chunk-ARIYSQMH.js → chunk-OHJ2EB4T.js} +3 -3
  454. package/lib/{chunk-ARIYSQMH.js.map → chunk-OHJ2EB4T.js.map} +1 -1
  455. package/lib/{chunk-TLPVFRWR.js → chunk-OPA6AXSH.js} +3 -3
  456. package/lib/{chunk-TLPVFRWR.js.map → chunk-OPA6AXSH.js.map} +1 -1
  457. package/lib/chunk-OQB5UGWG.mjs +24 -0
  458. package/lib/chunk-OQB5UGWG.mjs.map +1 -0
  459. package/lib/{chunk-3W2COCXV.js → chunk-ORQBVFHY.js} +3 -3
  460. package/lib/{chunk-3W2COCXV.js.map → chunk-ORQBVFHY.js.map} +1 -1
  461. package/lib/{chunk-C44KAKMR.js → chunk-OW7RK5YW.js} +3 -3
  462. package/lib/{chunk-C44KAKMR.js.map → chunk-OW7RK5YW.js.map} +1 -1
  463. package/lib/{chunk-22254THF.mjs → chunk-OY5DJBRV.mjs} +2 -2
  464. package/lib/{chunk-22254THF.mjs.map → chunk-OY5DJBRV.mjs.map} +1 -1
  465. package/lib/chunk-P2SQQBVB.js +22 -0
  466. package/lib/chunk-P2SQQBVB.js.map +1 -0
  467. package/lib/chunk-P6CI5ITJ.js +22 -0
  468. package/lib/chunk-P6CI5ITJ.js.map +1 -0
  469. package/lib/{chunk-2IPGGARK.mjs → chunk-P6M6QZU5.mjs} +7 -4
  470. package/lib/chunk-P6M6QZU5.mjs.map +1 -0
  471. package/lib/{chunk-Y54K6TQO.js → chunk-PFADKWMO.js} +3 -3
  472. package/lib/{chunk-Y54K6TQO.js.map → chunk-PFADKWMO.js.map} +1 -1
  473. package/lib/chunk-POPLWPM4.mjs +19 -0
  474. package/lib/chunk-POPLWPM4.mjs.map +1 -0
  475. package/lib/{chunk-VOFKYSJD.js → chunk-POQZCV3D.js} +3 -3
  476. package/lib/{chunk-VOFKYSJD.js.map → chunk-POQZCV3D.js.map} +1 -1
  477. package/lib/{chunk-M2GOQ7TZ.mjs → chunk-QM4MJTTD.mjs} +7 -4
  478. package/lib/chunk-QM4MJTTD.mjs.map +1 -0
  479. package/lib/{chunk-WJGXVKZY.js → chunk-QNA4O6AU.js} +3 -3
  480. package/lib/{chunk-WJGXVKZY.js.map → chunk-QNA4O6AU.js.map} +1 -1
  481. package/lib/{chunk-ZDXO3TGZ.mjs → chunk-RCD6EO4Q.mjs} +7 -4
  482. package/lib/chunk-RCD6EO4Q.mjs.map +1 -0
  483. package/lib/{chunk-ZEGRYDE5.mjs → chunk-RDJK3X4J.mjs} +8 -5
  484. package/lib/chunk-RDJK3X4J.mjs.map +1 -0
  485. package/lib/{chunk-4N5J426R.mjs → chunk-RXU74KSN.mjs} +2 -2
  486. package/lib/{chunk-4N5J426R.mjs.map → chunk-RXU74KSN.mjs.map} +1 -1
  487. package/lib/{chunk-S5D5AFDF.js → chunk-S6N4N4FT.js} +9 -6
  488. package/lib/chunk-S6N4N4FT.js.map +1 -0
  489. package/lib/{chunk-SFIX77W5.js → chunk-SGWF66HS.js} +3 -3
  490. package/lib/{chunk-SFIX77W5.js.map → chunk-SGWF66HS.js.map} +1 -1
  491. package/lib/{chunk-OU5BTUDV.mjs → chunk-SKMDZ4S6.mjs} +2 -2
  492. package/lib/{chunk-OU5BTUDV.mjs.map → chunk-SKMDZ4S6.mjs.map} +1 -1
  493. package/lib/chunk-SVRCKC65.js +120 -0
  494. package/lib/chunk-SVRCKC65.js.map +1 -0
  495. package/lib/{chunk-OQYS7JVF.js → chunk-SY2V2V54.js} +6 -6
  496. package/lib/{chunk-OQYS7JVF.js.map → chunk-SY2V2V54.js.map} +1 -1
  497. package/lib/{chunk-YMPRYKNY.js → chunk-SZO4SUUG.js} +9 -6
  498. package/lib/chunk-SZO4SUUG.js.map +1 -0
  499. package/lib/chunk-TCHVA6VG.js +24 -0
  500. package/lib/chunk-TCHVA6VG.js.map +1 -0
  501. package/lib/{chunk-C2VSTWID.js → chunk-TJ7IQSHU.js} +9 -6
  502. package/lib/chunk-TJ7IQSHU.js.map +1 -0
  503. package/lib/chunk-TLLR2DXI.js +70 -0
  504. package/lib/chunk-TLLR2DXI.js.map +1 -0
  505. package/lib/{chunk-7JL66G7G.mjs → chunk-TPSWNY5K.mjs} +2 -2
  506. package/lib/{chunk-7JL66G7G.mjs.map → chunk-TPSWNY5K.mjs.map} +1 -1
  507. package/lib/chunk-UCHEFFWR.js +79 -0
  508. package/lib/chunk-UCHEFFWR.js.map +1 -0
  509. package/lib/{chunk-HPIF2CMT.js → chunk-UIJIIIOA.js} +9 -6
  510. package/lib/chunk-UIJIIIOA.js.map +1 -0
  511. package/lib/chunk-UMS4M7FU.mjs +22 -0
  512. package/lib/chunk-UMS4M7FU.mjs.map +1 -0
  513. package/lib/{chunk-N3EHGKZV.mjs → chunk-UN5S46LE.mjs} +7 -4
  514. package/lib/chunk-UN5S46LE.mjs.map +1 -0
  515. package/lib/{chunk-NFD7D5GZ.mjs → chunk-UWONIZJZ.mjs} +26 -19
  516. package/lib/chunk-UWONIZJZ.mjs.map +1 -0
  517. package/lib/chunk-UYAF7QRD.mjs +22 -0
  518. package/lib/chunk-UYAF7QRD.mjs.map +1 -0
  519. package/lib/chunk-VERUOTB3.mjs +10 -0
  520. package/lib/chunk-VERUOTB3.mjs.map +1 -0
  521. package/lib/{chunk-62EKGBXF.js → chunk-VGOAXY26.js} +8 -5
  522. package/lib/chunk-VGOAXY26.js.map +1 -0
  523. package/lib/chunk-VKSBOWCE.mjs +50 -0
  524. package/lib/chunk-VKSBOWCE.mjs.map +1 -0
  525. package/lib/chunk-VT2JBMWQ.mjs +27 -0
  526. package/lib/chunk-VT2JBMWQ.mjs.map +1 -0
  527. package/lib/{chunk-LXZTBF7F.js → chunk-VWHKNZLG.js} +3 -3
  528. package/lib/{chunk-LXZTBF7F.js.map → chunk-VWHKNZLG.js.map} +1 -1
  529. package/lib/{chunk-TLRVQWCI.mjs → chunk-WL7BV4XV.mjs} +9 -6
  530. package/lib/chunk-WL7BV4XV.mjs.map +1 -0
  531. package/lib/chunk-WOPNDC4R.js +10 -0
  532. package/lib/chunk-WOPNDC4R.js.map +1 -0
  533. package/lib/chunk-X6SI76NQ.js +22 -0
  534. package/lib/chunk-X6SI76NQ.js.map +1 -0
  535. package/lib/{chunk-UHMICS34.mjs → chunk-YETYTLAD.mjs} +2 -2
  536. package/lib/{chunk-UHMICS34.mjs.map → chunk-YETYTLAD.mjs.map} +1 -1
  537. package/lib/chunk-YJUYGFG2.mjs +26 -0
  538. package/lib/chunk-YJUYGFG2.mjs.map +1 -0
  539. package/lib/{chunk-UYQFYQQG.mjs → chunk-YJZXJKM4.mjs} +30 -20
  540. package/lib/chunk-YJZXJKM4.mjs.map +1 -0
  541. package/lib/chunk-YOF36UOS.js +19 -0
  542. package/lib/chunk-YOF36UOS.js.map +1 -0
  543. package/lib/{chunk-4ZKU4RJL.mjs → chunk-YQP44G45.mjs} +2 -2
  544. package/lib/{chunk-4ZKU4RJL.mjs.map → chunk-YQP44G45.mjs.map} +1 -1
  545. package/lib/{chunk-22VHHJSS.js → chunk-Z7LBOQRQ.js} +6 -6
  546. package/lib/{chunk-22VHHJSS.js.map → chunk-Z7LBOQRQ.js.map} +1 -1
  547. package/lib/{chunk-IDDU6B6T.js → chunk-ZIBHO6FI.js} +3 -3
  548. package/lib/{chunk-IDDU6B6T.js.map → chunk-ZIBHO6FI.js.map} +1 -1
  549. package/lib/{chunk-TJQ5NVL4.js → chunk-ZJGY6EOE.js} +19 -10
  550. package/lib/chunk-ZJGY6EOE.js.map +1 -0
  551. package/lib/{chunk-V2J4TQR5.mjs → chunk-ZQKVVWD5.mjs} +2 -2
  552. package/lib/{chunk-V2J4TQR5.mjs.map → chunk-ZQKVVWD5.mjs.map} +1 -1
  553. package/lib/{chunk-FIDPCCCW.js → chunk-ZWFSAKQK.js} +8 -2
  554. package/lib/chunk-ZWFSAKQK.js.map +1 -0
  555. package/lib/codeGen.d.mts +1 -0
  556. package/lib/codeGen.d.ts +1 -0
  557. package/lib/codeGen.js +3 -3
  558. package/lib/codeGen.mjs +2 -2
  559. package/lib/commonTypes.d.mts +34 -1
  560. package/lib/commonTypes.d.ts +34 -1
  561. package/lib/core.d.mts +153 -23
  562. package/lib/core.d.ts +153 -23
  563. package/lib/core.js +9 -5
  564. package/lib/core.js.map +1 -1
  565. package/lib/core.mjs +10 -6
  566. package/lib/exceptions.d.mts +5 -1
  567. package/lib/exceptions.d.ts +5 -1
  568. package/lib/exceptions.js +2 -2
  569. package/lib/exceptions.mjs +1 -1
  570. package/lib/formatErrors.d.mts +40 -0
  571. package/lib/formatErrors.d.ts +40 -0
  572. package/lib/formatErrors.js +9 -0
  573. package/lib/formatErrors.js.map +1 -0
  574. package/lib/formatErrors.mjs +9 -0
  575. package/lib/formatErrors.mjs.map +1 -0
  576. package/lib/helpers/constants.js +2 -2
  577. package/lib/helpers/constants.mjs +1 -1
  578. package/lib/helpers/jsonSchemaConstraint.d.mts +18 -0
  579. package/lib/helpers/jsonSchemaConstraint.d.ts +18 -0
  580. package/lib/helpers/jsonSchemaConstraint.js +7 -0
  581. package/lib/helpers/jsonSchemaConstraint.js.map +1 -0
  582. package/lib/helpers/jsonSchemaConstraint.mjs +7 -0
  583. package/lib/helpers/jsonSchemaConstraint.mjs.map +1 -0
  584. package/lib/helpers/quoteStringLiteral.d.mts +3 -0
  585. package/lib/helpers/quoteStringLiteral.d.ts +3 -0
  586. package/lib/helpers/quoteStringLiteral.js +7 -0
  587. package/lib/helpers/quoteStringLiteral.js.map +1 -0
  588. package/lib/helpers/quoteStringLiteral.mjs +7 -0
  589. package/lib/helpers/quoteStringLiteral.mjs.map +1 -0
  590. package/lib/helpers/setStrictType.d.mts +1 -0
  591. package/lib/helpers/setStrictType.d.ts +1 -0
  592. package/lib/helpers/setStrictType.js +3 -3
  593. package/lib/helpers/setStrictType.mjs +2 -2
  594. package/lib/index.d.mts +16 -2
  595. package/lib/index.d.ts +16 -2
  596. package/lib/index.js +115 -55
  597. package/lib/index.js.map +1 -1
  598. package/lib/index.mjs +135 -75
  599. package/lib/standardSchema.d.mts +44 -0
  600. package/lib/standardSchema.d.ts +44 -0
  601. package/lib/standardSchema.js +1 -0
  602. package/lib/standardSchema.js.map +1 -0
  603. package/lib/standardSchema.mjs +1 -0
  604. package/lib/standardSchema.mjs.map +1 -0
  605. package/lib/toJSONSchema.d.mts +44 -0
  606. package/lib/toJSONSchema.d.ts +44 -0
  607. package/lib/toJSONSchema.js +12 -0
  608. package/lib/toJSONSchema.js.map +1 -0
  609. package/lib/toJSONSchema.mjs +12 -0
  610. package/lib/toJSONSchema.mjs.map +1 -0
  611. package/lib/translationMap.d.mts +7 -0
  612. package/lib/translationMap.d.ts +7 -0
  613. package/lib/translationMap.js +3 -3
  614. package/lib/translationMap.mjs +2 -2
  615. package/package.json +183 -46
  616. package/lib/chunk-23QTSXPQ.js.map +0 -1
  617. package/lib/chunk-24LO7MNY.js.map +0 -1
  618. package/lib/chunk-2ESDKTV4.js.map +0 -1
  619. package/lib/chunk-2HGS4STD.js +0 -48
  620. package/lib/chunk-2HGS4STD.js.map +0 -1
  621. package/lib/chunk-2IPGGARK.mjs.map +0 -1
  622. package/lib/chunk-4UPXP4I3.js.map +0 -1
  623. package/lib/chunk-5NYVRFG3.mjs +0 -48
  624. package/lib/chunk-5NYVRFG3.mjs.map +0 -1
  625. package/lib/chunk-62EKGBXF.js.map +0 -1
  626. package/lib/chunk-6JPYR2TS.js.map +0 -1
  627. package/lib/chunk-6LPQRAFN.js.map +0 -1
  628. package/lib/chunk-AJHBPMZT.mjs.map +0 -1
  629. package/lib/chunk-AXKX5BGH.js.map +0 -1
  630. package/lib/chunk-BRFUFNU4.js.map +0 -1
  631. package/lib/chunk-C2VSTWID.js.map +0 -1
  632. package/lib/chunk-D6G32F2K.js +0 -69
  633. package/lib/chunk-D6G32F2K.js.map +0 -1
  634. package/lib/chunk-DED5KDLM.js.map +0 -1
  635. package/lib/chunk-DFYP4GKE.js.map +0 -1
  636. package/lib/chunk-ENZ5WDUQ.js.map +0 -1
  637. package/lib/chunk-FI737YZJ.js.map +0 -1
  638. package/lib/chunk-FIDPCCCW.js.map +0 -1
  639. package/lib/chunk-GFWZQ4XW.mjs.map +0 -1
  640. package/lib/chunk-HPIF2CMT.js.map +0 -1
  641. package/lib/chunk-HUWO5UKU.js +0 -64
  642. package/lib/chunk-HUWO5UKU.js.map +0 -1
  643. package/lib/chunk-HWVM4SYU.mjs.map +0 -1
  644. package/lib/chunk-KRCOKWAB.mjs.map +0 -1
  645. package/lib/chunk-M2GOQ7TZ.mjs.map +0 -1
  646. package/lib/chunk-M3HYPZLE.mjs.map +0 -1
  647. package/lib/chunk-MCQHWS3E.mjs.map +0 -1
  648. package/lib/chunk-N3EHGKZV.mjs.map +0 -1
  649. package/lib/chunk-NFD7D5GZ.mjs.map +0 -1
  650. package/lib/chunk-NOJB5GBZ.mjs.map +0 -1
  651. package/lib/chunk-NY2TPU6O.mjs.map +0 -1
  652. package/lib/chunk-OE3L7EKN.mjs.map +0 -1
  653. package/lib/chunk-OFZMO7PB.mjs.map +0 -1
  654. package/lib/chunk-OHUOBIHX.mjs.map +0 -1
  655. package/lib/chunk-OZ3BTSSQ.mjs.map +0 -1
  656. package/lib/chunk-QIPGUTIG.mjs +0 -302
  657. package/lib/chunk-QIPGUTIG.mjs.map +0 -1
  658. package/lib/chunk-S5D5AFDF.js.map +0 -1
  659. package/lib/chunk-SBO6OQIX.mjs.map +0 -1
  660. package/lib/chunk-T2A3XXQZ.mjs.map +0 -1
  661. package/lib/chunk-TJQ5NVL4.js.map +0 -1
  662. package/lib/chunk-TLRVQWCI.mjs.map +0 -1
  663. package/lib/chunk-UYQFYQQG.mjs.map +0 -1
  664. package/lib/chunk-V7C77FML.mjs.map +0 -1
  665. package/lib/chunk-VN4GLOEN.js +0 -302
  666. package/lib/chunk-VN4GLOEN.js.map +0 -1
  667. package/lib/chunk-VVXKATDH.js.map +0 -1
  668. package/lib/chunk-WLPDAJB3.js.map +0 -1
  669. package/lib/chunk-XBE75VFX.js +0 -13
  670. package/lib/chunk-XBE75VFX.js.map +0 -1
  671. package/lib/chunk-XDVSL5B6.js +0 -14
  672. package/lib/chunk-XIOV4SHZ.mjs +0 -13
  673. package/lib/chunk-XIOV4SHZ.mjs.map +0 -1
  674. package/lib/chunk-Y5MNJGFX.js.map +0 -1
  675. package/lib/chunk-YDTQASAY.mjs.map +0 -1
  676. package/lib/chunk-YMPRYKNY.js.map +0 -1
  677. package/lib/chunk-Z4XOKGU3.js +0 -71
  678. package/lib/chunk-Z4XOKGU3.js.map +0 -1
  679. package/lib/chunk-ZDXO3TGZ.mjs.map +0 -1
  680. package/lib/chunk-ZEGRYDE5.mjs.map +0 -1
  681. package/lib/chunk-ZNQHNLKW.js.map +0 -1
  682. package/lib/chunk-ZTCXXAKD.mjs.map +0 -1
  683. /package/lib/{chunk-6WKSLMJG.mjs.map → chunk-B2R5S6OH.mjs.map} +0 -0
  684. /package/lib/{chunk-THU5VBSO.mjs.map → chunk-IIL6D2UL.mjs.map} +0 -0
  685. /package/lib/{chunk-WYM2TIVW.mjs.map → chunk-O646PJXY.mjs.map} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/asserts/number/positive.ts"],"sourcesContent":["import { _constrain } from '../../helpers/jsonSchemaConstraint';\nimport { setToDefaultLocale } from '../../translationMap';\nimport type { ExceptionContext, RequiredValidation } from '../../core';\n\nconst positiveErrorMessage = 'The received value is not a positive number';\nconst positiveErrorKey = 'n:positive';\n\n/**\n * @description Asserts that a number value is positive (greater than zero).\n * @returns {RequiredValidation} A validation function that takes a received number and an exception context.\n * @throws {ValidationError} if the received value is not positive.\n * @example\n * const schema = number().custom(positive());\n * parseOrFail(schema, 10); // Valid\n * parseOrFail(schema, 0); // Throws an error: 'The received value is not a positive number'\n * parseOrFail(schema, -5); // Throws an error: 'The received value is not a positive number'\n *\n * @translation Error Translation Key = 'n:positive'\n */\nexport const positive = (): RequiredValidation<number> =>\n _constrain({ exclusiveMinimum: 0 }, (received: number, ctx: ExceptionContext) => {\n if (received <= 0) ctx.addIssue('positive', received, positiveErrorKey);\n });\n\npositive.key = positiveErrorKey;\npositive.message = positiveErrorMessage;\nsetToDefaultLocale(positive);\n"],"mappings":";;;;;;;;AAIA,IAAM,uBAAuB;AAC7B,IAAM,mBAAmB;AAclB,IAAM,WAAW,MACtB,WAAW,EAAE,kBAAkB,EAAE,GAAG,CAAC,UAAkB,QAA0B;AAC/E,MAAI,YAAY,EAAG,KAAI,SAAS,YAAY,UAAU,gBAAgB;AACxE,CAAC;AAEH,SAAS,MAAM;AACf,SAAS,UAAU;AACnB,mBAAmB,QAAQ;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  setToDefaultLocale
3
- } from "./chunk-OE3L7EKN.mjs";
3
+ } from "./chunk-65X7NTUS.mjs";
4
4
 
5
5
  // src/asserts/string/atLeastOneUpperChar.ts
6
6
  var atLeastOneUpperCharErrorMessage = "The received value does not contain at least one uppercase character";
@@ -17,4 +17,4 @@ setToDefaultLocale(atLeastOneUpperChar);
17
17
  export {
18
18
  atLeastOneUpperChar
19
19
  };
20
- //# sourceMappingURL=chunk-4N5J426R.mjs.map
20
+ //# sourceMappingURL=chunk-RXU74KSN.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/asserts/string/atLeastOneUpperChar.ts"],"sourcesContent":["import type { ExceptionContext, RequiredValidation } from '../../core';\nimport { setToDefaultLocale } from '../../translationMap';\n\nconst atLeastOneUpperCharErrorMessage = 'The received value does not contain at least one uppercase character';\nconst atLeastOneUpperCharErrorKey = 's:atLeastOneUpperChar';\n\n/**\n * @description Asserts that a string value contains at least one uppercase character.\n * @returns {RequiredValidation} A validation function that takes a received string and an exception context.\n * @throws {ValidationError} if the received value does not contain at least one uppercase character.\n * @example\n * const schema = string().custom(atLeastOneUpperChar());\n * parseOrFail(schema, 'abcDEF'); // Valid\n * parseOrFail(schema, 'abcdef'); // Throws an error: 'The received value does not contain at least one uppercase character'\n *\n * @translation Error Translation Key = 's:atLeastOneUpperChar'\n */\nexport const atLeastOneUpperChar = (): RequiredValidation => (received: string, ctx: ExceptionContext) => {\n const upperCharRegExp = /[A-Z]/;\n if (!upperCharRegExp.test(received))\n ctx.addIssue('at least one uppercase character', received, atLeastOneUpperCharErrorKey);\n};\n\natLeastOneUpperChar.key = atLeastOneUpperCharErrorKey;\natLeastOneUpperChar.message = atLeastOneUpperCharErrorMessage;\nsetToDefaultLocale(atLeastOneUpperChar);\n"],"mappings":";;;;;AAGA,IAAM,kCAAkC;AACxC,IAAM,8BAA8B;AAa7B,IAAM,sBAAsB,MAA0B,CAAC,UAAkB,QAA0B;AACxG,QAAM,kBAAkB;AACxB,MAAI,CAAC,gBAAgB,KAAK,QAAQ;AAChC,QAAI,SAAS,oCAAoC,UAAU,2BAA2B;AAC1F;AAEA,oBAAoB,MAAM;AAC1B,oBAAoB,UAAU;AAC9B,mBAAmB,mBAAmB;","names":[]}
1
+ {"version":3,"sources":["../src/asserts/string/atLeastOneUpperChar.ts"],"sourcesContent":["import type { ExceptionContext, RequiredValidation } from '../../core';\nimport { setToDefaultLocale } from '../../translationMap';\n\nconst atLeastOneUpperCharErrorMessage = 'The received value does not contain at least one uppercase character';\nconst atLeastOneUpperCharErrorKey = 's:atLeastOneUpperChar';\n\n/**\n * @description Asserts that a string value contains at least one uppercase character.\n * @returns {RequiredValidation} A validation function that takes a received string and an exception context.\n * @throws {ValidationError} if the received value does not contain at least one uppercase character.\n * @example\n * const schema = string().custom(atLeastOneUpperChar());\n * parseOrFail(schema, 'abcDEF'); // Valid\n * parseOrFail(schema, 'abcdef'); // Throws an error: 'The received value does not contain at least one uppercase character'\n *\n * @translation Error Translation Key = 's:atLeastOneUpperChar'\n */\nexport const atLeastOneUpperChar = (): RequiredValidation<string> => (received: string, ctx: ExceptionContext) => {\n const upperCharRegExp = /[A-Z]/;\n if (!upperCharRegExp.test(received))\n ctx.addIssue('at least one uppercase character', received, atLeastOneUpperCharErrorKey);\n};\n\natLeastOneUpperChar.key = atLeastOneUpperCharErrorKey;\natLeastOneUpperChar.message = atLeastOneUpperCharErrorMessage;\nsetToDefaultLocale(atLeastOneUpperChar);\n"],"mappings":";;;;;AAGA,IAAM,kCAAkC;AACxC,IAAM,8BAA8B;AAa7B,IAAM,sBAAsB,MAAkC,CAAC,UAAkB,QAA0B;AAChH,QAAM,kBAAkB;AACxB,MAAI,CAAC,gBAAgB,KAAK,QAAQ;AAChC,QAAI,SAAS,oCAAoC,UAAU,2BAA2B;AAC1F;AAEA,oBAAoB,MAAM;AAC1B,oBAAoB,UAAU;AAC9B,mBAAmB,mBAAmB;","names":[]}
@@ -1,18 +1,21 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkTJQ5NVL4js = require('./chunk-TJQ5NVL4.js');
3
+ var _chunkWOPNDC4Rjs = require('./chunk-WOPNDC4R.js');
4
+
5
+
6
+ var _chunkZJGY6EOEjs = require('./chunk-ZJGY6EOE.js');
4
7
 
5
8
  // src/asserts/string/regExp.ts
6
9
  var regExpErrorMessage = "The received value does not match the required text pattern";
7
10
  var regExpErrorKey = "s:regExp";
8
- var regExp = (expected) => (received, ctx) => {
9
- if (!expected.test(received)) ctx.addIssue(expected, received, regExpErrorMessage);
10
- };
11
+ var regExp = (expected) => _chunkWOPNDC4Rjs._constrain.call(void 0, { pattern: expected.source }, (received, ctx) => {
12
+ if (!expected.test(received)) ctx.addIssue(expected, received, regExpErrorKey);
13
+ });
11
14
  regExp.key = regExpErrorKey;
12
15
  regExp.message = regExpErrorMessage;
13
- _chunkTJQ5NVL4js.setToDefaultLocale.call(void 0, regExp);
16
+ _chunkZJGY6EOEjs.setToDefaultLocale.call(void 0, regExp);
14
17
 
15
18
 
16
19
 
17
20
  exports.regExp = regExp;
18
- //# sourceMappingURL=chunk-S5D5AFDF.js.map
21
+ //# sourceMappingURL=chunk-S6N4N4FT.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/runner/work/bguard/bguard/lib/chunk-S6N4N4FT.js","../src/asserts/string/regExp.ts"],"names":[],"mappings":"AAAA;AACE;AACF,sDAA4B;AAC5B;AACE;AACF,sDAA4B;AAC5B;AACA;ACHA,IAAM,mBAAA,EAAqB,6DAAA;AAC3B,IAAM,eAAA,EAAiB,UAAA;AAchB,IAAM,OAAA,EAAS,CAAC,QAAA,EAAA,GACrB,yCAAA,EAAa,OAAA,EAAS,QAAA,CAAS,OAAO,CAAA,EAAG,CAAC,QAAA,EAAkB,GAAA,EAAA,GAA0B;AACpF,EAAA,GAAA,CAAI,CAAC,QAAA,CAAS,IAAA,CAAK,QAAQ,CAAA,EAAG,GAAA,CAAI,QAAA,CAAS,QAAA,EAAU,QAAA,EAAU,cAAc,CAAA;AAC/E,CAAC,CAAA;AAEH,MAAA,CAAO,IAAA,EAAM,cAAA;AACb,MAAA,CAAO,QAAA,EAAU,kBAAA;AACjB,iDAAA,MAAyB,CAAA;ADVzB;AACA;AACE;AACF,wBAAC","file":"/home/runner/work/bguard/bguard/lib/chunk-S6N4N4FT.js","sourcesContent":[null,"import type { ExceptionContext, RequiredValidation } from '../../core';\nimport { _constrain } from '../../helpers/jsonSchemaConstraint';\nimport { setToDefaultLocale } from '../../translationMap';\n\nconst regExpErrorMessage = 'The received value does not match the required text pattern';\nconst regExpErrorKey = 's:regExp';\n\n/**\n * @description Asserts that a string value matches a specified regular expression pattern.\n * @param {RegExp} expected The regular expression pattern that the string value should match.\n * @returns {RequiredValidation} A validation function that takes a received string and an exception context.\n * @throws {ValidationError} if the received value does not match the expected pattern.\n * @example\n * const schema = string().custom(regExp(/^[A-Za-z0-9]+$/)); // Validates against alphanumeric pattern\n * parseOrFail(schema, 'valid123'); // Valid\n * parseOrFail(schema, 'invalid!@#'); // Throws an error: 'The received value does not match the required text pattern'\n *\n * @translation Error Translation Key = 's:regExp'\n */\nexport const regExp = (expected: RegExp): RequiredValidation<string> =>\n _constrain({ pattern: expected.source }, (received: string, ctx: ExceptionContext) => {\n if (!expected.test(received)) ctx.addIssue(expected, received, regExpErrorKey);\n });\n\nregExp.key = regExpErrorKey;\nregExp.message = regExpErrorMessage;\nsetToDefaultLocale(regExp);\n"]}
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkTJQ5NVL4js = require('./chunk-TJQ5NVL4.js');
3
+ var _chunkZJGY6EOEjs = require('./chunk-ZJGY6EOE.js');
4
4
 
5
5
  // src/asserts/string/uuidV5.ts
6
6
  var uuidV5ErrorMessage = "The received value is not a valid UUID v5";
@@ -13,9 +13,9 @@ var uuidV5 = () => (received, ctx) => {
13
13
  };
14
14
  uuidV5.key = uuidV5ErrorKey;
15
15
  uuidV5.message = uuidV5ErrorMessage;
16
- _chunkTJQ5NVL4js.setToDefaultLocale.call(void 0, uuidV5);
16
+ _chunkZJGY6EOEjs.setToDefaultLocale.call(void 0, uuidV5);
17
17
 
18
18
 
19
19
 
20
20
  exports.uuidV5 = uuidV5;
21
- //# sourceMappingURL=chunk-SFIX77W5.js.map
21
+ //# sourceMappingURL=chunk-SGWF66HS.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/bguard/bguard/lib/chunk-SFIX77W5.js","../src/asserts/string/uuidV5.ts"],"names":[],"mappings":"AAAA;AACE;AACF,sDAA4B;AAC5B;AACA;ACDA,IAAM,mBAAA,EAAqB,2CAAA;AAC3B,IAAM,eAAA,EAAiB,UAAA;AAEvB,IAAM,cAAA,EAAgB,wEAAA;AAcf,IAAM,OAAA,EAAS,CAAA,EAAA,GAA0B,CAAC,QAAA,EAAkB,GAAA,EAAA,GAA0B;AAC3F,EAAA,GAAA,CAAI,CAAC,aAAA,CAAc,IAAA,CAAK,QAAQ,CAAA,EAAG;AACjC,IAAA,GAAA,CAAI,QAAA,CAAS,SAAA,EAAW,QAAA,EAAU,cAAc,CAAA;AAAA,EAClD;AACF,CAAA;AAEA,MAAA,CAAO,IAAA,EAAM,cAAA;AACb,MAAA,CAAO,QAAA,EAAU,kBAAA;AACjB,iDAAA,MAAyB,CAAA;ADZzB;AACA;AACE;AACF,wBAAC","file":"/home/runner/work/bguard/bguard/lib/chunk-SFIX77W5.js","sourcesContent":[null,"import type { ExceptionContext, RequiredValidation } from '../../core';\nimport { setToDefaultLocale } from '../../translationMap';\n\nconst uuidV5ErrorMessage = 'The received value is not a valid UUID v5';\nconst uuidV5ErrorKey = 's:uuidV5';\n\nconst uuidV5Pattern = /^[0-9a-f]{8}-[0-9a-f]{4}-5[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;\n\n/**\n * @description Asserts that a string value matches the UUID v5 format.\n * @returns {RequiredValidation} A validation function that takes a received string and an exception context.\n * @throws {ValidationError} if the received value is not a valid UUID v5.\n * @example\n * const schema = string().custom(uuidV5());\n * parseOrFail(schema, '550e8400-e29b-51d4-a716-446655440000'); // Valid\n * parseOrFail(schema, '550e8400-e29b-41d4-a716-446655440000'); // Throws an error: 'The received value is not a valid UUID v5'\n * parseOrFail(schema, 'invalid-uuid'); // Throws an error: 'The received value is not a valid UUID v5'\n *\n * @translation Error Translation Key = 's:uuidV5'\n */\nexport const uuidV5 = (): RequiredValidation => (received: string, ctx: ExceptionContext) => {\n if (!uuidV5Pattern.test(received)) {\n ctx.addIssue('uuid v5', received, uuidV5ErrorKey);\n }\n};\n\nuuidV5.key = uuidV5ErrorKey;\nuuidV5.message = uuidV5ErrorMessage;\nsetToDefaultLocale(uuidV5);\n"]}
1
+ {"version":3,"sources":["/home/runner/work/bguard/bguard/lib/chunk-SGWF66HS.js","../src/asserts/string/uuidV5.ts"],"names":[],"mappings":"AAAA;AACE;AACF,sDAA4B;AAC5B;AACA;ACDA,IAAM,mBAAA,EAAqB,2CAAA;AAC3B,IAAM,eAAA,EAAiB,UAAA;AAEvB,IAAM,cAAA,EAAgB,wEAAA;AAcf,IAAM,OAAA,EAAS,CAAA,EAAA,GAAkC,CAAC,QAAA,EAAkB,GAAA,EAAA,GAA0B;AACnG,EAAA,GAAA,CAAI,CAAC,aAAA,CAAc,IAAA,CAAK,QAAQ,CAAA,EAAG;AACjC,IAAA,GAAA,CAAI,QAAA,CAAS,SAAA,EAAW,QAAA,EAAU,cAAc,CAAA;AAAA,EAClD;AACF,CAAA;AAEA,MAAA,CAAO,IAAA,EAAM,cAAA;AACb,MAAA,CAAO,QAAA,EAAU,kBAAA;AACjB,iDAAA,MAAyB,CAAA;ADZzB;AACA;AACE;AACF,wBAAC","file":"/home/runner/work/bguard/bguard/lib/chunk-SGWF66HS.js","sourcesContent":[null,"import type { ExceptionContext, RequiredValidation } from '../../core';\nimport { setToDefaultLocale } from '../../translationMap';\n\nconst uuidV5ErrorMessage = 'The received value is not a valid UUID v5';\nconst uuidV5ErrorKey = 's:uuidV5';\n\nconst uuidV5Pattern = /^[0-9a-f]{8}-[0-9a-f]{4}-5[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;\n\n/**\n * @description Asserts that a string value matches the UUID v5 format.\n * @returns {RequiredValidation} A validation function that takes a received string and an exception context.\n * @throws {ValidationError} if the received value is not a valid UUID v5.\n * @example\n * const schema = string().custom(uuidV5());\n * parseOrFail(schema, '550e8400-e29b-51d4-a716-446655440000'); // Valid\n * parseOrFail(schema, '550e8400-e29b-41d4-a716-446655440000'); // Throws an error: 'The received value is not a valid UUID v5'\n * parseOrFail(schema, 'invalid-uuid'); // Throws an error: 'The received value is not a valid UUID v5'\n *\n * @translation Error Translation Key = 's:uuidV5'\n */\nexport const uuidV5 = (): RequiredValidation<string> => (received: string, ctx: ExceptionContext) => {\n if (!uuidV5Pattern.test(received)) {\n ctx.addIssue('uuid v5', received, uuidV5ErrorKey);\n }\n};\n\nuuidV5.key = uuidV5ErrorKey;\nuuidV5.message = uuidV5ErrorMessage;\nsetToDefaultLocale(uuidV5);\n"]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  setToDefaultLocale
3
- } from "./chunk-OE3L7EKN.mjs";
3
+ } from "./chunk-65X7NTUS.mjs";
4
4
 
5
5
  // src/asserts/string/atLeastOneSpecialChar.ts
6
6
  var atLeastOneSpecialCharErrorMessage = "The received value does not contain at least one special character";
@@ -20,4 +20,4 @@ setToDefaultLocale(atLeastOneSpecialChar);
20
20
  export {
21
21
  atLeastOneSpecialChar
22
22
  };
23
- //# sourceMappingURL=chunk-OU5BTUDV.mjs.map
23
+ //# sourceMappingURL=chunk-SKMDZ4S6.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/asserts/string/atLeastOneSpecialChar.ts"],"sourcesContent":["import type { ExceptionContext, RequiredValidation } from '../../core';\nimport { setToDefaultLocale } from '../../translationMap';\n\nconst atLeastOneSpecialCharErrorMessage = 'The received value does not contain at least one special character';\nconst atLeastOneSpecialCharErrorKey = 's:atLeastOneSpecialChar';\n\n/**\n * @description Asserts that a string value contains at least one special character.\n * @param {string} [allowedSpecialChars=*] The string containing allowed special characters. Defaults to '*@$!#%&()^~{}'.\n * @returns {RequiredValidation} A validation function that takes a received string and an exception context.\n * @throws {ValidationError} if the received value does not contain at least one of the allowed special characters.\n * @example\n * const schema = string().custom(atLeastOneSpecialChar()); // Default special characters\n * parseOrFail(schema, 'abc!def'); // Valid\n * parseOrFail(schema, 'abcdef'); // Throws an error: 'The received value does not contain at least one special character'\n *\n * const customSchema = string().custom(atLeastOneSpecialChar('@$')); // Custom special characters\n * parseOrFail(customSchema, 'abc@def'); // Valid\n * parseOrFail(customSchema, 'abcdef'); // Throws an error: 'The received value does not contain at least one special character'\n *\n * @translation Error Translation Key = 's:atLeastOneSpecialChar'\n */\nexport const atLeastOneSpecialChar = (allowedSpecialChars?: string): RequiredValidation => {\n const specialCharRegExp = new RegExp(\n `[${(allowedSpecialChars ?? '*@$!#%&()^~{}').replace(/[-/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&')}]`,\n );\n return (received: string, ctx: ExceptionContext) => {\n if (!specialCharRegExp.test(received)) ctx.addIssue('special character', received, atLeastOneSpecialCharErrorKey);\n };\n};\n\natLeastOneSpecialChar.key = atLeastOneSpecialCharErrorKey;\natLeastOneSpecialChar.message = atLeastOneSpecialCharErrorMessage;\nsetToDefaultLocale(atLeastOneSpecialChar);\n"],"mappings":";;;;;AAGA,IAAM,oCAAoC;AAC1C,IAAM,gCAAgC;AAkB/B,IAAM,wBAAwB,CAAC,wBAAqD;AACzF,QAAM,oBAAoB,IAAI;AAAA,IAC5B,KAAK,uBAAuB,iBAAiB,QAAQ,yBAAyB,MAAM,CAAC;AAAA,EACvF;AACA,SAAO,CAAC,UAAkB,QAA0B;AAClD,QAAI,CAAC,kBAAkB,KAAK,QAAQ,EAAG,KAAI,SAAS,qBAAqB,UAAU,6BAA6B;AAAA,EAClH;AACF;AAEA,sBAAsB,MAAM;AAC5B,sBAAsB,UAAU;AAChC,mBAAmB,qBAAqB;","names":[]}
1
+ {"version":3,"sources":["../src/asserts/string/atLeastOneSpecialChar.ts"],"sourcesContent":["import type { ExceptionContext, RequiredValidation } from '../../core';\nimport { setToDefaultLocale } from '../../translationMap';\n\nconst atLeastOneSpecialCharErrorMessage = 'The received value does not contain at least one special character';\nconst atLeastOneSpecialCharErrorKey = 's:atLeastOneSpecialChar';\n\n/**\n * @description Asserts that a string value contains at least one special character.\n * @param {string} [allowedSpecialChars=*] The string containing allowed special characters. Defaults to '*@$!#%&()^~{}'.\n * @returns {RequiredValidation} A validation function that takes a received string and an exception context.\n * @throws {ValidationError} if the received value does not contain at least one of the allowed special characters.\n * @example\n * const schema = string().custom(atLeastOneSpecialChar()); // Default special characters\n * parseOrFail(schema, 'abc!def'); // Valid\n * parseOrFail(schema, 'abcdef'); // Throws an error: 'The received value does not contain at least one special character'\n *\n * const customSchema = string().custom(atLeastOneSpecialChar('@$')); // Custom special characters\n * parseOrFail(customSchema, 'abc@def'); // Valid\n * parseOrFail(customSchema, 'abcdef'); // Throws an error: 'The received value does not contain at least one special character'\n *\n * @translation Error Translation Key = 's:atLeastOneSpecialChar'\n */\nexport const atLeastOneSpecialChar = (allowedSpecialChars?: string): RequiredValidation<string> => {\n const specialCharRegExp = new RegExp(\n `[${(allowedSpecialChars ?? '*@$!#%&()^~{}').replace(/[-/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&')}]`,\n );\n return (received: string, ctx: ExceptionContext) => {\n if (!specialCharRegExp.test(received)) ctx.addIssue('special character', received, atLeastOneSpecialCharErrorKey);\n };\n};\n\natLeastOneSpecialChar.key = atLeastOneSpecialCharErrorKey;\natLeastOneSpecialChar.message = atLeastOneSpecialCharErrorMessage;\nsetToDefaultLocale(atLeastOneSpecialChar);\n"],"mappings":";;;;;AAGA,IAAM,oCAAoC;AAC1C,IAAM,gCAAgC;AAkB/B,IAAM,wBAAwB,CAAC,wBAA6D;AACjG,QAAM,oBAAoB,IAAI;AAAA,IAC5B,KAAK,uBAAuB,iBAAiB,QAAQ,yBAAyB,MAAM,CAAC;AAAA,EACvF;AACA,SAAO,CAAC,UAAkB,QAA0B;AAClD,QAAI,CAAC,kBAAkB,KAAK,QAAQ,EAAG,KAAI,SAAS,qBAAqB,UAAU,6BAA6B;AAAA,EAClH;AACF;AAEA,sBAAsB,MAAM;AAC5B,sBAAsB,UAAU;AAChC,mBAAmB,qBAAqB;","names":[]}
@@ -0,0 +1,120 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
+
3
+ var _chunk6LUSV3SSjs = require('./chunk-6LUSV3SS.js');
4
+
5
+
6
+ var _chunkLHEU4XACjs = require('./chunk-LHEU4XAC.js');
7
+
8
+
9
+ var _chunkZWFSAKQKjs = require('./chunk-ZWFSAKQK.js');
10
+
11
+ // src/toJSONSchema.ts
12
+ var typeNames = {
13
+ string: "string",
14
+ number: "number",
15
+ boolean: "boolean",
16
+ object: "object"
17
+ };
18
+ function constraintsOf(schemaData) {
19
+ const constraints = {};
20
+ for (const validation of schemaData.requiredValidations) {
21
+ const carried = validation.jsonSchema;
22
+ if (carried) Object.assign(constraints, carried);
23
+ }
24
+ return constraints;
25
+ }
26
+ function literalOf(schemaData) {
27
+ if (!schemaData.strictType) return void 0;
28
+ const unquote = (value) => typeof value === "string" && value.startsWith("'") && value.endsWith("'") ? value.slice(1, -1).replace(/\\'/g, "'").replace(/\\\\/g, "\\") : value;
29
+ if (Array.isArray(schemaData.strictTypeValue)) return { enum: schemaData.strictTypeValue.map(unquote) };
30
+ return { const: unquote(schemaData.strictTypeValue) };
31
+ }
32
+ function baseOf(schemaData, context) {
33
+ if (schemaData.lazy) {
34
+ const { typeName, getSchema } = schemaData.lazy;
35
+ if (context.inProgress.has(typeName)) return { $ref: `#/$defs/${typeName}` };
36
+ schemaData.lazy.resolved ??= getSchema();
37
+ if (!(schemaData.lazy.resolved instanceof _chunk6LUSV3SSjs.CommonSchema))
38
+ throw new (0, _chunkZWFSAKQKjs.BuildSchemaError)("Invalid schema returned from lazy method");
39
+ context.inProgress.add(typeName);
40
+ context.definitions[typeName] = generate(schemaData.lazy.resolved, context);
41
+ context.inProgress.delete(typeName);
42
+ return { $ref: `#/$defs/${typeName}` };
43
+ }
44
+ if (schemaData.union) return { anyOf: schemaData.union.map((member) => generate(member, context)) };
45
+ if (schemaData.tuple)
46
+ return {
47
+ type: "array",
48
+ // Draft 2020-12 spells positional schemas `prefixItems`, and forbidding extras is what makes it a
49
+ // tuple rather than an array that happens to start a certain way.
50
+ prefixItems: schemaData.tuple.map((position) => generate(position, context)),
51
+ items: false,
52
+ minItems: schemaData.tuple.length,
53
+ maxItems: schemaData.tuple.length
54
+ };
55
+ if (schemaData.record) {
56
+ const keyLiteral = literalOf(schemaData.record.key[_chunkLHEU4XACjs.ctxSymbol]);
57
+ const valueSchema = generate(schemaData.record.value, context);
58
+ if (_optionalChain([keyLiteral, 'optionalAccess', _ => _.enum]))
59
+ return {
60
+ type: "object",
61
+ properties: Object.fromEntries(keyLiteral.enum.map((key) => [String(key), valueSchema])),
62
+ additionalProperties: false
63
+ };
64
+ return { type: "object", additionalProperties: valueSchema };
65
+ }
66
+ if (schemaData.array) return { type: "array", items: generate(schemaData.array, context) };
67
+ if (schemaData.object) {
68
+ const properties = {};
69
+ const required = [];
70
+ for (const [key, valueSchema] of Object.entries(schemaData.object)) {
71
+ const valueSchemaData = valueSchema[_chunkLHEU4XACjs.ctxSymbol];
72
+ properties[key] = generate(valueSchema, context);
73
+ if (!valueSchemaData.isOptional && valueSchemaData.defaultValue === void 0) required.push(key);
74
+ }
75
+ const objectSchema = { type: "object", properties };
76
+ if (required.length) objectSchema.required = required;
77
+ if (!schemaData.allowUnrecognizedObjectProps) objectSchema.additionalProperties = false;
78
+ return objectSchema;
79
+ }
80
+ if (schemaData.date) return { type: "string", format: "date-time" };
81
+ const named = schemaData.type.filter((type) => type !== "undefined");
82
+ if (!named.length) return {};
83
+ const jsonTypes = named.map((type) => {
84
+ const jsonType = typeNames[type];
85
+ if (!jsonType) throw new (0, _chunkZWFSAKQKjs.BuildSchemaError)(`Type '${type}' has no JSON Schema equivalent and cannot be generated`);
86
+ return jsonType;
87
+ });
88
+ return { type: jsonTypes.length === 1 ? jsonTypes[0] : jsonTypes };
89
+ }
90
+ function generate(schema, context) {
91
+ const schemaData = schema[_chunkLHEU4XACjs.ctxSymbol];
92
+ const base = baseOf(schemaData, context);
93
+ const literal = literalOf(schemaData);
94
+ let result = literal ? { ...base, ...literal } : { ...base, ...constraintsOf(schemaData) };
95
+ if (literal && result.type) delete result.type;
96
+ if (schemaData.isNullable) {
97
+ result = result.$ref || result.anyOf ? { anyOf: [result, { type: "null" }] } : mergeNull(result);
98
+ }
99
+ if (schemaData.defaultValue !== void 0) result.default = schemaData.defaultValue;
100
+ if (_optionalChain([schemaData, 'access', _2 => _2.meta, 'optionalAccess', _3 => _3.description])) result.description = schemaData.meta.description;
101
+ return result;
102
+ }
103
+ function mergeNull(schema) {
104
+ if (typeof schema.type === "string") return { ...schema, type: [schema.type, "null"] };
105
+ if (Array.isArray(schema.type)) return { ...schema, type: [...schema.type, "null"] };
106
+ return { anyOf: [schema, { type: "null" }] };
107
+ }
108
+ function toJSONSchema(schema, options) {
109
+ const context = { definitions: {}, inProgress: /* @__PURE__ */ new Set() };
110
+ const generated = generate(schema, context);
111
+ const dialect = _optionalChain([options, 'optionalAccess', _4 => _4.dialect]) === void 0 ? "https://json-schema.org/draft/2020-12/schema" : options.dialect;
112
+ const document = dialect ? { $schema: dialect, ...generated } : generated;
113
+ if (Object.keys(context.definitions).length) document.$defs = context.definitions;
114
+ return document;
115
+ }
116
+
117
+
118
+
119
+ exports.toJSONSchema = toJSONSchema;
120
+ //# sourceMappingURL=chunk-SVRCKC65.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/runner/work/bguard/bguard/lib/chunk-SVRCKC65.js","../src/toJSONSchema.ts"],"names":[],"mappings":"AAAA;AACE;AACF,sDAA4B;AAC5B;AACE;AACF,sDAA4B;AAC5B;AACE;AACF,sDAA4B;AAC5B;AACA;ACSA,IAAM,UAAA,EAA+C;AAAA,EACnD,MAAA,EAAQ,QAAA;AAAA,EACR,MAAA,EAAQ,QAAA;AAAA,EACR,OAAA,EAAS,SAAA;AAAA,EACT,MAAA,EAAQ;AACV,CAAA;AAcA,SAAS,aAAA,CAAc,UAAA,EAA0C;AAC/D,EAAA,MAAM,YAAA,EAA0B,CAAC,CAAA;AAEjC,EAAA,IAAA,CAAA,MAAW,WAAA,GAAc,UAAA,CAAW,mBAAA,EAAqB;AACvD,IAAA,MAAM,QAAA,EAAW,UAAA,CAAqC,UAAA;AACtD,IAAA,GAAA,CAAI,OAAA,EAAS,MAAA,CAAO,MAAA,CAAO,WAAA,EAAa,OAAO,CAAA;AAAA,EACjD;AAEA,EAAA,OAAO,WAAA;AACT;AAEA,SAAS,SAAA,CAAU,UAAA,EAAsD;AACvE,EAAA,GAAA,CAAI,CAAC,UAAA,CAAW,UAAA,EAAY,OAAO,KAAA,CAAA;AAInC,EAAA,MAAM,QAAA,EAAU,CAAC,KAAA,EAAA,GACf,OAAO,MAAA,IAAU,SAAA,GAAY,KAAA,CAAM,UAAA,CAAW,GAAG,EAAA,GAAK,KAAA,CAAM,QAAA,CAAS,GAAG,EAAA,EACpE,KAAA,CAAM,KAAA,CAAM,CAAA,EAAG,CAAA,CAAE,CAAA,CAAE,OAAA,CAAQ,MAAA,EAAQ,GAAG,CAAA,CAAE,OAAA,CAAQ,OAAA,EAAS,IAAI,EAAA,EAC7D,KAAA;AAEN,EAAA,GAAA,CAAI,KAAA,CAAM,OAAA,CAAQ,UAAA,CAAW,eAAe,CAAA,EAAG,OAAO,EAAE,IAAA,EAAM,UAAA,CAAW,eAAA,CAAgB,GAAA,CAAI,OAAO,EAAE,CAAA;AAEtG,EAAA,OAAO,EAAE,KAAA,EAAO,OAAA,CAAQ,UAAA,CAAW,eAAe,EAAE,CAAA;AACtD;AAEA,SAAS,MAAA,CAAO,UAAA,EAA8B,OAAA,EAA8B;AAC1E,EAAA,GAAA,CAAI,UAAA,CAAW,IAAA,EAAM;AACnB,IAAA,MAAM,EAAE,QAAA,EAAU,UAAU,EAAA,EAAI,UAAA,CAAW,IAAA;AAG3C,IAAA,GAAA,CAAI,OAAA,CAAQ,UAAA,CAAW,GAAA,CAAI,QAAQ,CAAA,EAAG,OAAO,EAAE,IAAA,EAAM,CAAA,QAAA,EAAW,QAAQ,CAAA,EAAA;AAEjC,IAAA;AACG,IAAA;AAC6B,MAAA;AAExC,IAAA;AACoC,IAAA;AACjC,IAAA;AAEG,IAAA;AACvC,EAAA;AAEuE,EAAA;AAExD,EAAA;AACN,IAAA;AACC,MAAA;AAAA;AAAA;AAG6D,MAAA;AAC5D,MAAA;AACoB,MAAA;AACA,MAAA;AAC7B,IAAA;AAEqB,EAAA;AACwC,IAAA;AACA,IAAA;AAK7C,IAAA;AACP,MAAA;AACC,QAAA;AAC6E,QAAA;AAC7D,QAAA;AACxB,MAAA;AAEyD,IAAA;AAC7D,EAAA;AAEyE,EAAA;AAElD,EAAA;AAC2B,IAAA;AACpB,IAAA;AAEwC,IAAA;AACrB,MAAA;AACE,MAAA;AAGqB,MAAA;AACtE,IAAA;AAE8D,IAAA;AACjB,IAAA;AACc,IAAA;AAEpD,IAAA;AACT,EAAA;AAEkE,EAAA;AAEC,EAAA;AACxC,EAAA;AAEW,EAAA;AACL,IAAA;AACwB,IAAA;AAEhD,IAAA;AACR,EAAA;AAEgE,EAAA;AACnE;AAEsE;AACjC,EAAA;AACI,EAAA;AACH,EAAA;AAGuC,EAAA;AACjC,EAAA;AAEf,EAAA;AAEgD,IAAA;AAC3E,EAAA;AAEuE,EAAA;AACA,EAAA;AAEhE,EAAA;AACT;AAGmD;AACsB,EAAA;AACkB,EAAA;AAE9C,EAAA;AAC7C;AA0B8F;AAC1B,EAAA;AACxB,EAAA;AAEO,EAAA;AAC2B,EAAA;AAEN,EAAA;AAE/D,EAAA;AACT;AD/F6E;AACA;AACA;AACA","file":"/home/runner/work/bguard/bguard/lib/chunk-SVRCKC65.js","sourcesContent":[null,"import type { BaseType } from './commonTypes';\nimport { CommonSchema, type ValidatorContext } from './core';\nimport { BuildSchemaError } from './exceptions';\nimport { ctxSymbol } from './helpers/constants';\n\nexport interface JSONSchema {\n [keyword: string]: unknown;\n}\n\nexport interface ToJSONSchemaOptions {\n /**\n * The dialect to declare in `$schema`. Pass `null` to leave it out, which is what you want when the\n * result is embedded in a larger document such as an OpenAPI `components.schemas` entry.\n * @default 'https://json-schema.org/draft/2020-12/schema'\n */\n dialect?: string | null;\n}\n\n/** What a bguard primitive is called in JSON Schema. */\nconst typeNames: Partial<Record<BaseType, string>> = {\n string: 'string',\n number: 'number',\n boolean: 'boolean',\n object: 'object',\n};\n\n/** A validation may carry the JSON Schema keywords it stands for. Those that cannot, do not. */\ninterface ConstrainedValidation {\n jsonSchema?: JSONSchema;\n}\n\ninterface Context {\n /** Named subschemas, filled as lazy schemas are met so a recursive schema can reference itself. */\n definitions: Record<string, JSONSchema>;\n /** Lazy type names currently being generated, so a self-reference emits a `$ref` instead of looping. */\n inProgress: Set<string>;\n}\n\nfunction constraintsOf(schemaData: ValidatorContext): JSONSchema {\n const constraints: JSONSchema = {};\n\n for (const validation of schemaData.requiredValidations) {\n const carried = (validation as ConstrainedValidation).jsonSchema;\n if (carried) Object.assign(constraints, carried);\n }\n\n return constraints;\n}\n\nfunction literalOf(schemaData: ValidatorContext): JSONSchema | undefined {\n if (!schemaData.strictType) return undefined;\n\n // equalTo stores one value, oneOfValues an array. String literals arrive already quoted for codeGen,\n // so the quotes have to come back off for JSON.\n const unquote = (value: unknown) =>\n typeof value === 'string' && value.startsWith(\"'\") && value.endsWith(\"'\")\n ? value.slice(1, -1).replace(/\\\\'/g, \"'\").replace(/\\\\\\\\/g, '\\\\')\n : value;\n\n if (Array.isArray(schemaData.strictTypeValue)) return { enum: schemaData.strictTypeValue.map(unquote) };\n\n return { const: unquote(schemaData.strictTypeValue) };\n}\n\nfunction baseOf(schemaData: ValidatorContext, context: Context): JSONSchema {\n if (schemaData.lazy) {\n const { typeName, getSchema } = schemaData.lazy;\n\n // A self-reference resolves to a pointer, which is what stops generation from recursing forever.\n if (context.inProgress.has(typeName)) return { $ref: `#/$defs/${typeName}` };\n\n schemaData.lazy.resolved ??= getSchema();\n if (!(schemaData.lazy.resolved instanceof CommonSchema))\n throw new BuildSchemaError('Invalid schema returned from lazy method');\n\n context.inProgress.add(typeName);\n context.definitions[typeName] = generate(schemaData.lazy.resolved, context);\n context.inProgress.delete(typeName);\n\n return { $ref: `#/$defs/${typeName}` };\n }\n\n if (schemaData.union) return { anyOf: schemaData.union.map((member) => generate(member, context)) };\n\n if (schemaData.tuple)\n return {\n type: 'array',\n // Draft 2020-12 spells positional schemas `prefixItems`, and forbidding extras is what makes it a\n // tuple rather than an array that happens to start a certain way.\n prefixItems: schemaData.tuple.map((position) => generate(position, context)),\n items: false,\n minItems: schemaData.tuple.length,\n maxItems: schemaData.tuple.length,\n };\n\n if (schemaData.record) {\n const keyLiteral = literalOf(schemaData.record.key[ctxSymbol]);\n const valueSchema = generate(schemaData.record.value, context);\n\n // A restricted key set becomes named properties. There is no `required`, because validation checks\n // the keys that are present rather than demanding the whole set — the same reason InferType says\n // Partial.\n if (keyLiteral?.enum)\n return {\n type: 'object',\n properties: Object.fromEntries((keyLiteral.enum as unknown[]).map((key) => [String(key), valueSchema])),\n additionalProperties: false,\n };\n\n return { type: 'object', additionalProperties: valueSchema };\n }\n\n if (schemaData.array) return { type: 'array', items: generate(schemaData.array, context) };\n\n if (schemaData.object) {\n const properties: Record<string, JSONSchema> = {};\n const required: string[] = [];\n\n for (const [key, valueSchema] of Object.entries(schemaData.object)) {\n const valueSchemaData = valueSchema[ctxSymbol];\n properties[key] = generate(valueSchema, context);\n\n // A default supplies the value, so the caller need not send it — the same rule InferInput follows.\n if (!valueSchemaData.isOptional && valueSchemaData.defaultValue === undefined) required.push(key);\n }\n\n const objectSchema: JSONSchema = { type: 'object', properties };\n if (required.length) objectSchema.required = required;\n if (!schemaData.allowUnrecognizedObjectProps) objectSchema.additionalProperties = false;\n\n return objectSchema;\n }\n\n if (schemaData.date) return { type: 'string', format: 'date-time' };\n\n const named = schemaData.type.filter((type) => type !== 'undefined');\n if (!named.length) return {};\n\n const jsonTypes = named.map((type) => {\n const jsonType = typeNames[type];\n if (!jsonType) throw new BuildSchemaError(`Type '${type}' has no JSON Schema equivalent and cannot be generated`);\n\n return jsonType;\n });\n\n return { type: jsonTypes.length === 1 ? jsonTypes[0] : jsonTypes };\n}\n\nfunction generate(schema: CommonSchema, context: Context): JSONSchema {\n const schemaData = schema[ctxSymbol];\n const base = baseOf(schemaData, context);\n const literal = literalOf(schemaData);\n\n // A literal already says everything about the value, so the type is redundant beside it.\n let result: JSONSchema = literal ? { ...base, ...literal } : { ...base, ...constraintsOf(schemaData) };\n if (literal && result.type) delete result.type;\n\n if (schemaData.isNullable) {\n // `$ref` and `anyOf` cannot take a sibling type, so nullability has to wrap rather than merge.\n result = result.$ref || result.anyOf ? { anyOf: [result, { type: 'null' }] } : mergeNull(result);\n }\n\n if (schemaData.defaultValue !== undefined) result.default = schemaData.defaultValue;\n if (schemaData.meta?.description) result.description = schemaData.meta.description;\n\n return result;\n}\n\n/** Adds null to a plain type, which reads better than wrapping a single type in `anyOf`. */\nfunction mergeNull(schema: JSONSchema): JSONSchema {\n if (typeof schema.type === 'string') return { ...schema, type: [schema.type, 'null'] };\n if (Array.isArray(schema.type)) return { ...schema, type: [...(schema.type as string[]), 'null'] };\n\n return { anyOf: [schema, { type: 'null' }] };\n}\n\n/**\n * Renders a schema as a JSON Schema document, for OpenAPI, form generators and tool definitions.\n *\n * What is represented: types, object properties and which of them are required, arrays, tuples,\n * records, unions, literals and enums, nullability, defaults, `description()`, and recursive schemas\n * via `$defs` and `$ref`. Assertions that map onto a JSON Schema keyword — string lengths and patterns,\n * numeric bounds, array lengths — are included; those with no equivalent are not, because JSON Schema\n * has no way to express them.\n *\n * `bigint` and `symbol` have no JSON Schema counterpart and raise a `BuildSchemaError` rather than\n * being quietly emitted as something they are not. A `date()` becomes `{ type: 'string', format:\n * 'date-time' }`, since JSON has no date type.\n *\n * @example\n * const schema = object({ name: string().custom(minLength(2)), age: number().optional() });\n * toJSONSchema(schema);\n * // {\n * // $schema: 'https://json-schema.org/draft/2020-12/schema',\n * // type: 'object',\n * // properties: { name: { type: 'string', minLength: 2 }, age: { type: 'number' } },\n * // required: ['name'],\n * // additionalProperties: false,\n * // }\n */\nexport function toJSONSchema(schema: CommonSchema, options?: ToJSONSchemaOptions): JSONSchema {\n const context: Context = { definitions: {}, inProgress: new Set() };\n const generated = generate(schema, context);\n\n const dialect = options?.dialect === undefined ? 'https://json-schema.org/draft/2020-12/schema' : options.dialect;\n const document: JSONSchema = dialect ? { $schema: dialect, ...generated } : generated;\n\n if (Object.keys(context.definitions).length) document.$defs = context.definitions;\n\n return document;\n}\n"]}
@@ -1,28 +1,28 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkVBTWYDEMjs = require('./chunk-VBTWYDEM.js');
3
+ var _chunkZJGY6EOEjs = require('./chunk-ZJGY6EOE.js');
4
4
 
5
5
 
6
- var _chunkTJQ5NVL4js = require('./chunk-TJQ5NVL4.js');
6
+ var _chunkVBTWYDEMjs = require('./chunk-VBTWYDEM.js');
7
7
 
8
8
 
9
- var _chunkFIDPCCCWjs = require('./chunk-FIDPCCCW.js');
9
+ var _chunkZWFSAKQKjs = require('./chunk-ZWFSAKQK.js');
10
10
 
11
11
  // src/asserts/date/dateMax.ts
12
12
  var dateMaxErrorMessage = "The received value is greater than expected";
13
13
  var dateMaxErrorKey = "dt:max";
14
14
  var dateMax = (expected) => {
15
15
  const transformedExpected = typeof expected === "string" ? new Date(expected) : expected;
16
- if (!_chunkVBTWYDEMjs.isValidDateInner.call(void 0, transformedExpected)) throw new (0, _chunkFIDPCCCWjs.BuildSchemaError)("Invalid date in Date assertion");
16
+ if (!_chunkVBTWYDEMjs.isValidDateInner.call(void 0, transformedExpected)) throw new (0, _chunkZWFSAKQKjs.BuildSchemaError)("Invalid date in Date assertion");
17
17
  return (received, ctx) => {
18
18
  if (transformedExpected < received) ctx.addIssue(transformedExpected, received, dateMaxErrorKey);
19
19
  };
20
20
  };
21
21
  dateMax.key = dateMaxErrorKey;
22
22
  dateMax.message = dateMaxErrorMessage;
23
- _chunkTJQ5NVL4js.setToDefaultLocale.call(void 0, dateMax);
23
+ _chunkZJGY6EOEjs.setToDefaultLocale.call(void 0, dateMax);
24
24
 
25
25
 
26
26
 
27
27
  exports.dateMax = dateMax;
28
- //# sourceMappingURL=chunk-OQYS7JVF.js.map
28
+ //# sourceMappingURL=chunk-SY2V2V54.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/bguard/bguard/lib/chunk-OQYS7JVF.js","../src/asserts/date/dateMax.ts"],"names":[],"mappings":"AAAA;AACE;AACF,sDAA4B;AAC5B;AACE;AACF,sDAA4B;AAC5B;AACE;AACF,sDAA4B;AAC5B;AACA;ACLA,IAAM,oBAAA,EAAsB,6CAAA;AAC5B,IAAM,gBAAA,EAAkB,QAAA;AAcjB,IAAM,QAAA,EAAU,CAAC,QAAA,EAAA,GAAgD;AACtE,EAAA,MAAM,oBAAA,EAAsB,OAAO,SAAA,IAAa,SAAA,EAAW,IAAI,IAAA,CAAK,QAAQ,EAAA,EAAI,QAAA;AAChF,EAAA,GAAA,CAAI,CAAC,+CAAA,mBAAoC,CAAA,EAAG,MAAM,IAAI,sCAAA,CAAiB,gCAAgC,CAAA;AACvG,EAAA,OAAO,CAAC,QAAA,EAAgB,GAAA,EAAA,GAA0B;AAChD,IAAA,GAAA,CAAI,oBAAA,EAAsB,QAAA,EAAU,GAAA,CAAI,QAAA,CAAS,mBAAA,EAAqB,QAAA,EAAU,eAAe,CAAA;AAAA,EACjG,CAAA;AACF,CAAA;AAEA,OAAA,CAAQ,IAAA,EAAM,eAAA;AACd,OAAA,CAAQ,QAAA,EAAU,mBAAA;AAClB,iDAAA,OAA0B,CAAA;ADP1B;AACA;AACE;AACF,0BAAC","file":"/home/runner/work/bguard/bguard/lib/chunk-OQYS7JVF.js","sourcesContent":[null,"import { setToDefaultLocale } from '../../translationMap';\nimport { BuildSchemaError } from '../../exceptions';\nimport type { ExceptionContext, RequiredValidation } from '../../core';\nimport { isValidDateInner } from '../../helpers/isValidDateInner';\n\nconst dateMaxErrorMessage = 'The received value is greater than expected';\nconst dateMaxErrorKey = 'dt:max';\n/**\n * @description Asserts that a date value is not greater than a specified maximum value.\n * @param {Date | string} expected The maximum allowable value.\n * @returns {RequiredValidation} A validation function that takes a received Date or string and an exception context.\n * @throws {ValidationError} if the received value is greater than the expected maximum value.\n * @example\n * const schema = date().custom(dateMax('2024-12-31'));\n * parseOrFail(schema, new Date('2024-12-30')); // Valid\n * parseOrFail(schema, new Date('2024-12-31')); // Valid\n * parseOrFail(schema, new Date('2025-01-01')); // Throws an error: 'The received value is greater than expected'\n *\n * @translation Error Translation Key = 'dt:max'\n */\nexport const dateMax = (expected: Date | string): RequiredValidation => {\n const transformedExpected = typeof expected === 'string' ? new Date(expected) : expected;\n if (!isValidDateInner(transformedExpected)) throw new BuildSchemaError('Invalid date in Date assertion');\n return (received: Date, ctx: ExceptionContext) => {\n if (transformedExpected < received) ctx.addIssue(transformedExpected, received, dateMaxErrorKey);\n };\n};\n\ndateMax.key = dateMaxErrorKey;\ndateMax.message = dateMaxErrorMessage;\nsetToDefaultLocale(dateMax);\n"]}
1
+ {"version":3,"sources":["/home/runner/work/bguard/bguard/lib/chunk-SY2V2V54.js","../src/asserts/date/dateMax.ts"],"names":[],"mappings":"AAAA;AACE;AACF,sDAA4B;AAC5B;AACE;AACF,sDAA4B;AAC5B;AACE;AACF,sDAA4B;AAC5B;AACA;ACLA,IAAM,oBAAA,EAAsB,6CAAA;AAC5B,IAAM,gBAAA,EAAkB,QAAA;AAcjB,IAAM,QAAA,EAAU,CAAC,QAAA,EAAA,GAAsD;AAC5E,EAAA,MAAM,oBAAA,EAAsB,OAAO,SAAA,IAAa,SAAA,EAAW,IAAI,IAAA,CAAK,QAAQ,EAAA,EAAI,QAAA;AAChF,EAAA,GAAA,CAAI,CAAC,+CAAA,mBAAoC,CAAA,EAAG,MAAM,IAAI,sCAAA,CAAiB,gCAAgC,CAAA;AACvG,EAAA,OAAO,CAAC,QAAA,EAAgB,GAAA,EAAA,GAA0B;AAChD,IAAA,GAAA,CAAI,oBAAA,EAAsB,QAAA,EAAU,GAAA,CAAI,QAAA,CAAS,mBAAA,EAAqB,QAAA,EAAU,eAAe,CAAA;AAAA,EACjG,CAAA;AACF,CAAA;AAEA,OAAA,CAAQ,IAAA,EAAM,eAAA;AACd,OAAA,CAAQ,QAAA,EAAU,mBAAA;AAClB,iDAAA,OAA0B,CAAA;ADP1B;AACA;AACE;AACF,0BAAC","file":"/home/runner/work/bguard/bguard/lib/chunk-SY2V2V54.js","sourcesContent":[null,"import { setToDefaultLocale } from '../../translationMap';\nimport { BuildSchemaError } from '../../exceptions';\nimport type { ExceptionContext, RequiredValidation } from '../../core';\nimport { isValidDateInner } from '../../helpers/isValidDateInner';\n\nconst dateMaxErrorMessage = 'The received value is greater than expected';\nconst dateMaxErrorKey = 'dt:max';\n/**\n * @description Asserts that a date value is not greater than a specified maximum value.\n * @param {Date | string} expected The maximum allowable value.\n * @returns {RequiredValidation} A validation function that takes a received Date or string and an exception context.\n * @throws {ValidationError} if the received value is greater than the expected maximum value.\n * @example\n * const schema = date().custom(dateMax('2024-12-31'));\n * parseOrFail(schema, new Date('2024-12-30')); // Valid\n * parseOrFail(schema, new Date('2024-12-31')); // Valid\n * parseOrFail(schema, new Date('2025-01-01')); // Throws an error: 'The received value is greater than expected'\n *\n * @translation Error Translation Key = 'dt:max'\n */\nexport const dateMax = (expected: Date | string): RequiredValidation<Date> => {\n const transformedExpected = typeof expected === 'string' ? new Date(expected) : expected;\n if (!isValidDateInner(transformedExpected)) throw new BuildSchemaError('Invalid date in Date assertion');\n return (received: Date, ctx: ExceptionContext) => {\n if (transformedExpected < received) ctx.addIssue(transformedExpected, received, dateMaxErrorKey);\n };\n};\n\ndateMax.key = dateMaxErrorKey;\ndateMax.message = dateMaxErrorMessage;\nsetToDefaultLocale(dateMax);\n"]}
@@ -1,18 +1,21 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkTJQ5NVL4js = require('./chunk-TJQ5NVL4.js');
3
+ var _chunkWOPNDC4Rjs = require('./chunk-WOPNDC4R.js');
4
+
5
+
6
+ var _chunkZJGY6EOEjs = require('./chunk-ZJGY6EOE.js');
4
7
 
5
8
  // src/asserts/array/maxArrayLength.ts
6
9
  var maxArrayLengthErrorMessage = "The received value length is greater than expected";
7
10
  var maxArrayLengthErrorKey = "a:maxArrayLength";
8
- var maxArrayLength = (expected) => (received, ctx) => {
9
- if (received.length > expected) ctx.addIssue(expected, received, maxArrayLengthErrorMessage);
10
- };
11
+ var maxArrayLength = (expected) => _chunkWOPNDC4Rjs._constrain.call(void 0, { maxItems: expected }, (received, ctx) => {
12
+ if (received.length > expected) ctx.addIssue(expected, received, maxArrayLengthErrorKey);
13
+ });
11
14
  maxArrayLength.key = maxArrayLengthErrorKey;
12
15
  maxArrayLength.message = maxArrayLengthErrorMessage;
13
- _chunkTJQ5NVL4js.setToDefaultLocale.call(void 0, maxArrayLength);
16
+ _chunkZJGY6EOEjs.setToDefaultLocale.call(void 0, maxArrayLength);
14
17
 
15
18
 
16
19
 
17
20
  exports.maxArrayLength = maxArrayLength;
18
- //# sourceMappingURL=chunk-YMPRYKNY.js.map
21
+ //# sourceMappingURL=chunk-SZO4SUUG.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/runner/work/bguard/bguard/lib/chunk-SZO4SUUG.js","../src/asserts/array/maxArrayLength.ts"],"names":[],"mappings":"AAAA;AACE;AACF,sDAA4B;AAC5B;AACE;AACF,sDAA4B;AAC5B;AACA;ACHA,IAAM,2BAAA,EAA6B,oDAAA;AACnC,IAAM,uBAAA,EAAyB,kBAAA;AAexB,IAAM,eAAA,EAAiB,CAAC,QAAA,EAAA,GAC7B,yCAAA,EAAa,QAAA,EAAU,SAAS,CAAA,EAAG,CAAC,QAAA,EAAqB,GAAA,EAAA,GAA0B;AACjF,EAAA,GAAA,CAAI,QAAA,CAAS,OAAA,EAAS,QAAA,EAAU,GAAA,CAAI,QAAA,CAAS,QAAA,EAAU,QAAA,EAAU,sBAAsB,CAAA;AACzF,CAAC,CAAA;AAEH,cAAA,CAAe,IAAA,EAAM,sBAAA;AACrB,cAAA,CAAe,QAAA,EAAU,0BAAA;AACzB,iDAAA,cAAiC,CAAA;ADXjC;AACA;AACE;AACF,wCAAC","file":"/home/runner/work/bguard/bguard/lib/chunk-SZO4SUUG.js","sourcesContent":[null,"import type { ExceptionContext, RequiredValidation } from '../../core';\nimport { _constrain } from '../../helpers/jsonSchemaConstraint';\nimport { setToDefaultLocale } from '../../translationMap';\n\nconst maxArrayLengthErrorMessage = 'The received value length is greater than expected';\nconst maxArrayLengthErrorKey = 'a:maxArrayLength';\n\n/**\n * @description Asserts that the length of an array is not greater than a specified maximum length.\n * @param {number} expected The maximum allowed length for the array.\n * @returns {RequiredValidation} A validation function that takes a received array and an exception context.\n * @throws {ValidationError} if the length of the received value is greater than the expected length.\n * @example\n * const schema = array(string()).custom(maxArrayLength(3));\n * parseOrFail(schema, ['adequate', 'array']); // Valid\n * parseOrFail(schema, ['adequate', 'array', 'length']); // Valid\n * parseOrFail(schema, ['adequate', 'array', 'length', 'test']); // Throws an error: 'The received value length is greater than expected'\n *\n * @translation Error Translation Key = 'a:maxArrayLength'\n */\nexport const maxArrayLength = (expected: number): RequiredValidation<unknown[]> =>\n _constrain({ maxItems: expected }, (received: unknown[], ctx: ExceptionContext) => {\n if (received.length > expected) ctx.addIssue(expected, received, maxArrayLengthErrorKey);\n });\n\nmaxArrayLength.key = maxArrayLengthErrorKey;\nmaxArrayLength.message = maxArrayLengthErrorMessage;\nsetToDefaultLocale(maxArrayLength);\n"]}
@@ -0,0 +1,24 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+ var _chunkAO6DKPJZjs = require('./chunk-AO6DKPJZ.js');
5
+
6
+
7
+ var _chunkLHEU4XACjs = require('./chunk-LHEU4XAC.js');
8
+
9
+ // src/asserts/object/required.ts
10
+ function required(schema) {
11
+ const shape = _chunkAO6DKPJZjs._shapeOf.call(void 0, schema, "required");
12
+ const tightened = {};
13
+ for (const [key, valueSchema] of Object.entries(shape)) {
14
+ const tightenedSchema = valueSchema.clone();
15
+ delete tightenedSchema[_chunkLHEU4XACjs.ctxSymbol].isOptional;
16
+ tightened[key] = tightenedSchema;
17
+ }
18
+ return _chunkAO6DKPJZjs._objectFrom.call(void 0, schema, tightened);
19
+ }
20
+
21
+
22
+
23
+ exports.required = required;
24
+ //# sourceMappingURL=chunk-TCHVA6VG.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/runner/work/bguard/bguard/lib/chunk-TCHVA6VG.js","../src/asserts/object/required.ts"],"names":[],"mappings":"AAAA;AACE;AACA;AACF,sDAA4B;AAC5B;AACE;AACF,sDAA4B;AAC5B;AACA;AC0BO,SAAS,QAAA,CACd,MAAA,EAC4C;AAC5C,EAAA,MAAM,MAAA,EAAQ,uCAAA,MAAS,EAAQ,UAAU,CAAA;AACzC,EAAA,MAAM,UAAA,EAAmC,CAAC,CAAA;AAE1C,EAAA,IAAA,CAAA,MAAW,CAAC,GAAA,EAAK,WAAW,EAAA,GAAK,MAAA,CAAO,OAAA,CAAQ,KAAK,CAAA,EAAG;AAEtD,IAAA,MAAM,gBAAA,EAAkB,WAAA,CAAY,KAAA,CAAM,CAAA;AAC1C,IAAA,OAAO,eAAA,CAAgB,0BAAS,CAAA,CAAE,UAAA;AAClC,IAAA,SAAA,CAAU,GAAG,EAAA,EAAI,eAAA;AAAA,EACnB;AAEA,EAAA,OAAO,0CAAA,MAAY,EAAQ,SAAS,CAAA;AACtC;AD7BA;AACA;AACE;AACF,4BAAC","file":"/home/runner/work/bguard/bguard/lib/chunk-TCHVA6VG.js","sourcesContent":[null,"import { WithObject } from '../../commonTypes';\nimport { CommonSchema, ObjectShapeSchemaType } from '../../core';\nimport { ctxSymbol } from '../../helpers/constants';\nimport { ObjectSchema } from './index';\nimport { _objectFrom, _shapeOf } from './pick';\n\n/**\n * Named rather than written inline in both the signature and the cast: the two spellings of the same\n * mapped type are not provably identical to the compiler once `~standard` puts a deferred\n * `InferType<this>` inside them.\n *\n * Removing the brand rather than trying to recover the type it wraps, because an intersection cannot\n * be taken apart again. What matters to `InferType` is that the result no longer carries the marker.\n */\ntype RequiredShape<T extends ObjectShapeSchemaType> = { [K in keyof T]: Omit<T[K], 'validation_undefined'> };\n\n/**\n * @description Creates a new object schema in which every property is required, the counterpart to\n * `partial`.\n *\n * A property that carried a default keeps it, so it may still be omitted — a default is what makes a\n * property supply its own value rather than optional.\n *\n * @template T\n * @param {WithObject<CommonSchema, T>} schema - The object schema to tighten.\n * @returns A new object schema with every property required.\n * @example\n * const patchSchema = partial(object({ id: string(), name: string() }));\n * const fullSchema = required(patchSchema);\n * parseOrFail(fullSchema, { id: '1', name: 'a' }); // Validates successfully\n * parseOrFail(fullSchema, {}); // Throws a validation error\n *\n * @instance Of CommonSchema\n */\nexport function required<T extends ObjectShapeSchemaType>(\n schema: WithObject<CommonSchema, T>,\n): WithObject<ObjectSchema, RequiredShape<T>> {\n const shape = _shapeOf(schema, 'required');\n const tightened: ObjectShapeSchemaType = {};\n\n for (const [key, valueSchema] of Object.entries(shape)) {\n // A copy, so the property schema the source holds keeps whatever it had.\n const tightenedSchema = valueSchema.clone();\n delete tightenedSchema[ctxSymbol].isOptional;\n tightened[key] = tightenedSchema;\n }\n\n return _objectFrom(schema, tightened) as unknown as WithObject<ObjectSchema, RequiredShape<T>>;\n}\n"]}
@@ -1,18 +1,21 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkTJQ5NVL4js = require('./chunk-TJQ5NVL4.js');
3
+ var _chunkWOPNDC4Rjs = require('./chunk-WOPNDC4R.js');
4
+
5
+
6
+ var _chunkZJGY6EOEjs = require('./chunk-ZJGY6EOE.js');
4
7
 
5
8
  // src/asserts/array/minArrayLength.ts
6
9
  var minArrayLengthErrorMessage = "The received value length is less than expected";
7
10
  var minArrayLengthErrorKey = "a:minArrayLength";
8
- var minArrayLength = (expected) => (received, ctx) => {
9
- if (received.length < expected) ctx.addIssue(expected, received, minArrayLengthErrorMessage);
10
- };
11
+ var minArrayLength = (expected) => _chunkWOPNDC4Rjs._constrain.call(void 0, { minItems: expected }, (received, ctx) => {
12
+ if (received.length < expected) ctx.addIssue(expected, received, minArrayLengthErrorKey);
13
+ });
11
14
  minArrayLength.key = minArrayLengthErrorKey;
12
15
  minArrayLength.message = minArrayLengthErrorMessage;
13
- _chunkTJQ5NVL4js.setToDefaultLocale.call(void 0, minArrayLength);
16
+ _chunkZJGY6EOEjs.setToDefaultLocale.call(void 0, minArrayLength);
14
17
 
15
18
 
16
19
 
17
20
  exports.minArrayLength = minArrayLength;
18
- //# sourceMappingURL=chunk-C2VSTWID.js.map
21
+ //# sourceMappingURL=chunk-TJ7IQSHU.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/runner/work/bguard/bguard/lib/chunk-TJ7IQSHU.js","../src/asserts/array/minArrayLength.ts"],"names":[],"mappings":"AAAA;AACE;AACF,sDAA4B;AAC5B;AACE;AACF,sDAA4B;AAC5B;AACA;ACHA,IAAM,2BAAA,EAA6B,iDAAA;AACnC,IAAM,uBAAA,EAAyB,kBAAA;AAexB,IAAM,eAAA,EAAiB,CAAC,QAAA,EAAA,GAC7B,yCAAA,EAAa,QAAA,EAAU,SAAS,CAAA,EAAG,CAAC,QAAA,EAAqB,GAAA,EAAA,GAA0B;AACjF,EAAA,GAAA,CAAI,QAAA,CAAS,OAAA,EAAS,QAAA,EAAU,GAAA,CAAI,QAAA,CAAS,QAAA,EAAU,QAAA,EAAU,sBAAsB,CAAA;AACzF,CAAC,CAAA;AAEH,cAAA,CAAe,IAAA,EAAM,sBAAA;AACrB,cAAA,CAAe,QAAA,EAAU,0BAAA;AACzB,iDAAA,cAAiC,CAAA;ADXjC;AACA;AACE;AACF,wCAAC","file":"/home/runner/work/bguard/bguard/lib/chunk-TJ7IQSHU.js","sourcesContent":[null,"import type { ExceptionContext, RequiredValidation } from '../../core';\nimport { _constrain } from '../../helpers/jsonSchemaConstraint';\nimport { setToDefaultLocale } from '../../translationMap';\n\nconst minArrayLengthErrorMessage = 'The received value length is less than expected';\nconst minArrayLengthErrorKey = 'a:minArrayLength';\n\n/**\n * @description Asserts that the length of na array is not less than a specified minimum length.\n * @param {number} expected The minimum required length for the array.\n * @returns {RequiredValidation} A validation function that takes a received array and an exception context.\n * @throws {ValidationError} if the length of the received value is less than the expected length.\n * @example\n * const schema = array(string()).custom(minArrayLength(3));\n * parseOrFail(schema, ['short', 'array']); // Throws an error: 'The received value length is less than expected'\n * parseOrFail(schema, ['adequate', 'array', 'length']); // Valid\n * parseOrFail(schema, ['adequate', 'array', 'length', 'test']); // Valid\n *\n * @translation Error Translation Key = 'a:minArrayLength'\n */\nexport const minArrayLength = (expected: number): RequiredValidation<unknown[]> =>\n _constrain({ minItems: expected }, (received: unknown[], ctx: ExceptionContext) => {\n if (received.length < expected) ctx.addIssue(expected, received, minArrayLengthErrorKey);\n });\n\nminArrayLength.key = minArrayLengthErrorKey;\nminArrayLength.message = minArrayLengthErrorMessage;\nsetToDefaultLocale(minArrayLength);\n"]}
@@ -0,0 +1,70 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunkUCHEFFWRjs = require('./chunk-UCHEFFWR.js');
4
+
5
+
6
+ var _chunkEVM26M2Cjs = require('./chunk-EVM26M2C.js');
7
+
8
+
9
+ var _chunkDPXTSNEXjs = require('./chunk-DPXTSNEX.js');
10
+
11
+
12
+ var _chunkL7YFDMZUjs = require('./chunk-L7YFDMZU.js');
13
+
14
+
15
+ var _chunkGYLCPX6Ojs = require('./chunk-GYLCPX6O.js');
16
+
17
+ // src/asserts/coerce/index.ts
18
+ var coerce = {
19
+ /** Anything that is not already a string is passed through `String`. */
20
+ string: () => _chunkUCHEFFWRjs.string.call(void 0, ).transformBeforeValidation(
21
+ (received) => received === null || typeof received === "string" ? received : String(received)
22
+ ),
23
+ /**
24
+ * Anything that is not already a number is passed through `Number`. A value `Number` cannot read
25
+ * becomes `NaN`, which `number()` rejects, so `'abc'` fails validation rather than passing as a
26
+ * number.
27
+ */
28
+ number: () => _chunkEVM26M2Cjs.number.call(void 0, ).transformBeforeValidation(
29
+ (received) => received === null || typeof received === "number" ? received : Number(received)
30
+ ),
31
+ /**
32
+ * Only the values that unambiguously mean a boolean are converted: the strings `'true'` and
33
+ * `'false'` in any case, and the numbers `1` and `0`. Everything else is left for validation to
34
+ * reject.
35
+ *
36
+ * Deliberately narrower than passing the value through `Boolean`, which would accept every input
37
+ * and quietly read `'false'` as `true`.
38
+ */
39
+ boolean: () => _chunkGYLCPX6Ojs.boolean.call(void 0, ).transformBeforeValidation((received) => {
40
+ if (typeof received === "string") {
41
+ const lowered = received.toLowerCase();
42
+ if (lowered === "true") return true;
43
+ if (lowered === "false") return false;
44
+ }
45
+ if (received === 1) return true;
46
+ if (received === 0) return false;
47
+ return received;
48
+ }),
49
+ /** `BigInt` throws on a value it cannot read, so the original is kept for validation to reject. */
50
+ bigint: () => _chunkL7YFDMZUjs.bigint.call(void 0, ).transformBeforeValidation((received) => {
51
+ if (received === null || typeof received === "bigint") return received;
52
+ try {
53
+ return BigInt(received);
54
+ } catch (e) {
55
+ return received;
56
+ }
57
+ }),
58
+ /**
59
+ * Anything that is not already a Date is passed through `new Date`. An unreadable value becomes an
60
+ * invalid Date, which `date()` rejects.
61
+ */
62
+ date: () => _chunkDPXTSNEXjs.date.call(void 0, ).transformBeforeValidation(
63
+ (received) => received === null || received instanceof Date ? received : new Date(received)
64
+ )
65
+ };
66
+
67
+
68
+
69
+ exports.coerce = coerce;
70
+ //# sourceMappingURL=chunk-TLLR2DXI.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/runner/work/bguard/bguard/lib/chunk-TLLR2DXI.js","../src/asserts/coerce/index.ts"],"names":[],"mappings":"AAAA;AACE;AACF,sDAA4B;AAC5B;AACE;AACF,sDAA4B;AAC5B;AACE;AACF,sDAA4B;AAC5B;AACE;AACF,sDAA4B;AAC5B;AACE;AACF,sDAA4B;AAC5B;AACA;ACWO,IAAM,OAAA,EAAS;AAAA;AAAA,EAEpB,MAAA,EAAQ,CAAA,EAAA,GACN,qCAAA,CAAO,CAAE,yBAAA;AAAA,IAAmC,CAAC,QAAA,EAAA,GAC3C,SAAA,IAAa,KAAA,GAAQ,OAAO,SAAA,IAAa,SAAA,EAAY,SAAA,EAAsB,MAAA,CAAO,QAAQ;AAAA,EAC5F,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOF,MAAA,EAAQ,CAAA,EAAA,GACN,qCAAA,CAAO,CAAE,yBAAA;AAAA,IAAmC,CAAC,QAAA,EAAA,GAC3C,SAAA,IAAa,KAAA,GAAQ,OAAO,SAAA,IAAa,SAAA,EAAY,SAAA,EAAsB,MAAA,CAAO,QAAQ;AAAA,EAC5F,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUF,OAAA,EAAS,CAAA,EAAA,GACP,sCAAA,CAAQ,CAAE,yBAAA,CAAmC,CAAC,QAAA,EAAA,GAAa;AACzD,IAAA,GAAA,CAAI,OAAO,SAAA,IAAa,QAAA,EAAU;AAChC,MAAA,MAAM,QAAA,EAAU,QAAA,CAAS,WAAA,CAAY,CAAA;AACrC,MAAA,GAAA,CAAI,QAAA,IAAY,MAAA,EAAQ,OAAO,IAAA;AAC/B,MAAA,GAAA,CAAI,QAAA,IAAY,OAAA,EAAS,OAAO,KAAA;AAAA,IAClC;AAEA,IAAA,GAAA,CAAI,SAAA,IAAa,CAAA,EAAG,OAAO,IAAA;AAC3B,IAAA,GAAA,CAAI,SAAA,IAAa,CAAA,EAAG,OAAO,KAAA;AAE3B,IAAA,OAAO,QAAA;AAAA,EACT,CAAC,CAAA;AAAA;AAAA,EAGH,MAAA,EAAQ,CAAA,EAAA,GACN,qCAAA,CAAO,CAAE,yBAAA,CAAmC,CAAC,QAAA,EAAA,GAAa;AACxD,IAAA,GAAA,CAAI,SAAA,IAAa,KAAA,GAAQ,OAAO,SAAA,IAAa,QAAA,EAAU,OAAO,QAAA;AAE9D,IAAA,IAAI;AACF,MAAA,OAAO,MAAA,CAAO,QAA2B,CAAA;AAAA,IAC3C,EAAA,UAAQ;AACN,MAAA,OAAO,QAAA;AAAA,IACT;AAAA,EACF,CAAC,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMH,IAAA,EAAM,CAAA,EAAA,GACJ,mCAAA,CAAK,CAAE,yBAAA;AAAA,IAAmC,CAAC,QAAA,EAAA,GACzC,SAAA,IAAa,KAAA,GAAQ,SAAA,WAAoB,KAAA,EAAQ,SAAA,EAAoB,IAAI,IAAA,CAAK,QAAkB;AAAA,EAClG;AACJ,CAAA;ADrBA;AACA;AACE;AACF,wBAAC","file":"/home/runner/work/bguard/bguard/lib/chunk-TLLR2DXI.js","sourcesContent":[null,"import { WithBGuardType, WithInput } from '../../commonTypes';\nimport { CommonSchema } from '../../core';\nimport { bigint } from '../bigint/index';\nimport { boolean } from '../boolean/index';\nimport { date } from '../date/index';\nimport { number } from '../number/index';\nimport { string } from '../string/index';\n\n/**\n * A coercing transform must never throw: it runs before validation, and throwing would replace a\n * clear validation error with an unexplained failure. Anything it cannot convert is passed through\n * unchanged so that validation reports the type problem itself.\n */\ntype Coerced<S, In> = WithInput<S, In>;\n\n/**\n * Converts the received value before validating it, for input that does not arrive already typed —\n * query strings, form data, environment variables.\n *\n * Each of these accepts `unknown` and reports that in its inferred input type, while the output type\n * is unchanged. `null` is left alone, so `nullable()` still decides whether it is allowed rather than\n * being turned into the string `'null'` or the number `0`.\n *\n * @example\n * const querySchema = object({ page: coerce.number().default(1), q: coerce.string() });\n * parseOrFail(querySchema, { page: '3', q: 'shoes' }); // { page: 3, q: 'shoes' }\n */\nexport const coerce = {\n /** Anything that is not already a string is passed through `String`. */\n string: (): Coerced<WithBGuardType<CommonSchema, string>, unknown> =>\n string().transformBeforeValidation<unknown>((received) =>\n received === null || typeof received === 'string' ? (received as string) : String(received),\n ) as unknown as Coerced<WithBGuardType<CommonSchema, string>, unknown>,\n\n /**\n * Anything that is not already a number is passed through `Number`. A value `Number` cannot read\n * becomes `NaN`, which `number()` rejects, so `'abc'` fails validation rather than passing as a\n * number.\n */\n number: (): Coerced<WithBGuardType<CommonSchema, number>, unknown> =>\n number().transformBeforeValidation<unknown>((received) =>\n received === null || typeof received === 'number' ? (received as number) : Number(received),\n ) as unknown as Coerced<WithBGuardType<CommonSchema, number>, unknown>,\n\n /**\n * Only the values that unambiguously mean a boolean are converted: the strings `'true'` and\n * `'false'` in any case, and the numbers `1` and `0`. Everything else is left for validation to\n * reject.\n *\n * Deliberately narrower than passing the value through `Boolean`, which would accept every input\n * and quietly read `'false'` as `true`.\n */\n boolean: (): Coerced<WithBGuardType<CommonSchema, boolean>, unknown> =>\n boolean().transformBeforeValidation<unknown>((received) => {\n if (typeof received === 'string') {\n const lowered = received.toLowerCase();\n if (lowered === 'true') return true;\n if (lowered === 'false') return false;\n }\n\n if (received === 1) return true;\n if (received === 0) return false;\n\n return received as boolean;\n }) as unknown as Coerced<WithBGuardType<CommonSchema, boolean>, unknown>,\n\n /** `BigInt` throws on a value it cannot read, so the original is kept for validation to reject. */\n bigint: (): Coerced<WithBGuardType<CommonSchema, bigint>, unknown> =>\n bigint().transformBeforeValidation<unknown>((received) => {\n if (received === null || typeof received === 'bigint') return received as bigint;\n\n try {\n return BigInt(received as string | number);\n } catch {\n return received as bigint;\n }\n }) as unknown as Coerced<WithBGuardType<CommonSchema, bigint>, unknown>,\n\n /**\n * Anything that is not already a Date is passed through `new Date`. An unreadable value becomes an\n * invalid Date, which `date()` rejects.\n */\n date: (): Coerced<WithBGuardType<CommonSchema, Date>, unknown> =>\n date().transformBeforeValidation<unknown>((received) =>\n received === null || received instanceof Date ? (received as Date) : new Date(received as string),\n ) as unknown as Coerced<WithBGuardType<CommonSchema, Date>, unknown>,\n};\n"]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  setToDefaultLocale
3
- } from "./chunk-OE3L7EKN.mjs";
3
+ } from "./chunk-65X7NTUS.mjs";
4
4
 
5
5
  // src/asserts/string/endsWith.ts
6
6
  var endsWithErrorMessage = "The received value does not end with the required substring";
@@ -17,4 +17,4 @@ setToDefaultLocale(endsWith);
17
17
  export {
18
18
  endsWith
19
19
  };
20
- //# sourceMappingURL=chunk-7JL66G7G.mjs.map
20
+ //# sourceMappingURL=chunk-TPSWNY5K.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/asserts/string/endsWith.ts"],"sourcesContent":["import type { ExceptionContext, RequiredValidation } from '../../core';\nimport { setToDefaultLocale } from '../../translationMap';\n\nconst endsWithErrorMessage = 'The received value does not end with the required substring';\nconst endsWithErrorKey = 's:endsWith';\n\n/**\n * @description Asserts that a string value ends with a specified substring.\n * @param {string} substring The substring that the string value must end with.\n * @returns {RequiredValidation} A validation function that takes a received string and an exception context.\n * @throws {ValidationError} if the received value does not end with the required substring.\n * @example\n * const schema = string().custom(endsWith('bar'));\n * parseOrFail(schema, 'foobar'); // Valid\n * parseOrFail(schema, 'foofoo'); // Throws an error: 'The received value does not end with the required substring'\n *\n * @translation Error Translation Key = 's:endsWith'\n */\nexport const endsWith =\n (substring: string): RequiredValidation =>\n (received: string, ctx: ExceptionContext) => {\n if (!received.endsWith(substring)) {\n ctx.addIssue(`ends with '${substring}'`, received, endsWithErrorKey);\n }\n };\n\nendsWith.key = endsWithErrorKey;\nendsWith.message = endsWithErrorMessage;\nsetToDefaultLocale(endsWith);\n"],"mappings":";;;;;AAGA,IAAM,uBAAuB;AAC7B,IAAM,mBAAmB;AAclB,IAAM,WACX,CAAC,cACD,CAAC,UAAkB,QAA0B;AAC3C,MAAI,CAAC,SAAS,SAAS,SAAS,GAAG;AACjC,QAAI,SAAS,cAAc,SAAS,KAAK,UAAU,gBAAgB;AAAA,EACrE;AACF;AAEF,SAAS,MAAM;AACf,SAAS,UAAU;AACnB,mBAAmB,QAAQ;","names":[]}
1
+ {"version":3,"sources":["../src/asserts/string/endsWith.ts"],"sourcesContent":["import type { ExceptionContext, RequiredValidation } from '../../core';\nimport { setToDefaultLocale } from '../../translationMap';\n\nconst endsWithErrorMessage = 'The received value does not end with the required substring';\nconst endsWithErrorKey = 's:endsWith';\n\n/**\n * @description Asserts that a string value ends with a specified substring.\n * @param {string} substring The substring that the string value must end with.\n * @returns {RequiredValidation} A validation function that takes a received string and an exception context.\n * @throws {ValidationError} if the received value does not end with the required substring.\n * @example\n * const schema = string().custom(endsWith('bar'));\n * parseOrFail(schema, 'foobar'); // Valid\n * parseOrFail(schema, 'foofoo'); // Throws an error: 'The received value does not end with the required substring'\n *\n * @translation Error Translation Key = 's:endsWith'\n */\nexport const endsWith =\n (substring: string): RequiredValidation<string> =>\n (received: string, ctx: ExceptionContext) => {\n if (!received.endsWith(substring)) {\n ctx.addIssue(`ends with '${substring}'`, received, endsWithErrorKey);\n }\n };\n\nendsWith.key = endsWithErrorKey;\nendsWith.message = endsWithErrorMessage;\nsetToDefaultLocale(endsWith);\n"],"mappings":";;;;;AAGA,IAAM,uBAAuB;AAC7B,IAAM,mBAAmB;AAclB,IAAM,WACX,CAAC,cACD,CAAC,UAAkB,QAA0B;AAC3C,MAAI,CAAC,SAAS,SAAS,SAAS,GAAG;AACjC,QAAI,SAAS,cAAc,SAAS,KAAK,UAAU,gBAAgB;AAAA,EACrE;AACF;AAEF,SAAS,MAAM;AACf,SAAS,UAAU;AACnB,mBAAmB,QAAQ;","names":[]}