bguard 0.4.0 → 0.5.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 (436) hide show
  1. package/README.md +92 -80
  2. package/lib/{CommonSchema-wi9MOXGF.d.mts → CommonSchema-BIfYCtcQ.d.mts} +2 -2
  3. package/lib/{CommonSchema-DOh3bsL-.d.ts → CommonSchema-DIDMH9R7.d.ts} +2 -2
  4. package/lib/ExceptionContext.d.mts +16 -0
  5. package/lib/ExceptionContext.d.ts +16 -0
  6. package/lib/ExceptionContext.js +11 -0
  7. package/lib/ExceptionContext.js.map +1 -0
  8. package/lib/ExceptionContext.mjs +11 -0
  9. package/lib/ExceptionContext.mjs.map +1 -0
  10. package/lib/asserts/array/index.d.mts +2 -1
  11. package/lib/asserts/array/index.d.ts +2 -1
  12. package/lib/asserts/array/index.js +7 -7
  13. package/lib/asserts/array/index.mjs +6 -6
  14. package/lib/asserts/array/maxArrayLength.d.mts +2 -1
  15. package/lib/asserts/array/maxArrayLength.d.ts +2 -1
  16. package/lib/asserts/array/maxArrayLength.js +4 -6
  17. package/lib/asserts/array/maxArrayLength.js.map +1 -1
  18. package/lib/asserts/array/maxArrayLength.mjs +3 -5
  19. package/lib/asserts/array/maxArrayLength.mjs.map +1 -1
  20. package/lib/asserts/array/minArrayLength.d.mts +2 -1
  21. package/lib/asserts/array/minArrayLength.d.ts +2 -1
  22. package/lib/asserts/array/minArrayLength.js +4 -6
  23. package/lib/asserts/array/minArrayLength.js.map +1 -1
  24. package/lib/asserts/array/minArrayLength.mjs +3 -5
  25. package/lib/asserts/array/minArrayLength.mjs.map +1 -1
  26. package/lib/asserts/bigint/bigintMax.d.mts +2 -1
  27. package/lib/asserts/bigint/bigintMax.d.ts +2 -1
  28. package/lib/asserts/bigint/bigintMax.js +4 -6
  29. package/lib/asserts/bigint/bigintMax.js.map +1 -1
  30. package/lib/asserts/bigint/bigintMax.mjs +3 -5
  31. package/lib/asserts/bigint/bigintMax.mjs.map +1 -1
  32. package/lib/asserts/bigint/bigintMaxExcluded.d.mts +2 -1
  33. package/lib/asserts/bigint/bigintMaxExcluded.d.ts +2 -1
  34. package/lib/asserts/bigint/bigintMaxExcluded.js +4 -6
  35. package/lib/asserts/bigint/bigintMaxExcluded.js.map +1 -1
  36. package/lib/asserts/bigint/bigintMaxExcluded.mjs +3 -5
  37. package/lib/asserts/bigint/bigintMaxExcluded.mjs.map +1 -1
  38. package/lib/asserts/bigint/bigintMin.d.mts +2 -1
  39. package/lib/asserts/bigint/bigintMin.d.ts +2 -1
  40. package/lib/asserts/bigint/bigintMin.js +4 -6
  41. package/lib/asserts/bigint/bigintMin.js.map +1 -1
  42. package/lib/asserts/bigint/bigintMin.mjs +3 -5
  43. package/lib/asserts/bigint/bigintMin.mjs.map +1 -1
  44. package/lib/asserts/bigint/bigintMinExcluded.d.mts +2 -1
  45. package/lib/asserts/bigint/bigintMinExcluded.d.ts +2 -1
  46. package/lib/asserts/bigint/bigintMinExcluded.js +4 -6
  47. package/lib/asserts/bigint/bigintMinExcluded.js.map +1 -1
  48. package/lib/asserts/bigint/bigintMinExcluded.mjs +3 -5
  49. package/lib/asserts/bigint/bigintMinExcluded.mjs.map +1 -1
  50. package/lib/asserts/bigint/index.d.mts +2 -1
  51. package/lib/asserts/bigint/index.d.ts +2 -1
  52. package/lib/asserts/bigint/index.js +10 -10
  53. package/lib/asserts/bigint/index.mjs +9 -9
  54. package/lib/asserts/boolean/index.d.mts +2 -1
  55. package/lib/asserts/boolean/index.d.ts +2 -1
  56. package/lib/asserts/boolean/index.js +8 -8
  57. package/lib/asserts/boolean/index.mjs +7 -7
  58. package/lib/asserts/date/dateMax.d.mts +2 -1
  59. package/lib/asserts/date/dateMax.d.ts +2 -1
  60. package/lib/asserts/date/dateMax.js +6 -7
  61. package/lib/asserts/date/dateMax.js.map +1 -1
  62. package/lib/asserts/date/dateMax.mjs +6 -7
  63. package/lib/asserts/date/dateMax.mjs.map +1 -1
  64. package/lib/asserts/date/dateMin.d.mts +2 -1
  65. package/lib/asserts/date/dateMin.d.ts +2 -1
  66. package/lib/asserts/date/dateMin.js +6 -7
  67. package/lib/asserts/date/dateMin.js.map +1 -1
  68. package/lib/asserts/date/dateMin.mjs +6 -7
  69. package/lib/asserts/date/dateMin.mjs.map +1 -1
  70. package/lib/asserts/date/index.d.mts +2 -1
  71. package/lib/asserts/date/index.d.ts +2 -1
  72. package/lib/asserts/date/index.js +7 -7
  73. package/lib/asserts/date/index.mjs +6 -6
  74. package/lib/asserts/mix/equalTo.d.mts +2 -1
  75. package/lib/asserts/mix/equalTo.d.ts +2 -1
  76. package/lib/asserts/mix/equalTo.js +4 -4
  77. package/lib/asserts/mix/equalTo.mjs +3 -3
  78. package/lib/asserts/mix/index.d.mts +2 -1
  79. package/lib/asserts/mix/index.d.ts +2 -1
  80. package/lib/asserts/mix/index.js +6 -6
  81. package/lib/asserts/mix/index.mjs +5 -5
  82. package/lib/asserts/mix/oneOfValues.d.mts +2 -1
  83. package/lib/asserts/mix/oneOfValues.d.ts +2 -1
  84. package/lib/asserts/mix/oneOfValues.js +4 -4
  85. package/lib/asserts/mix/oneOfValues.mjs +3 -3
  86. package/lib/asserts/number/index.d.mts +2 -1
  87. package/lib/asserts/number/index.d.ts +2 -1
  88. package/lib/asserts/number/index.js +10 -10
  89. package/lib/asserts/number/index.mjs +9 -9
  90. package/lib/asserts/number/max.d.mts +2 -1
  91. package/lib/asserts/number/max.d.ts +2 -1
  92. package/lib/asserts/number/max.js +4 -6
  93. package/lib/asserts/number/max.js.map +1 -1
  94. package/lib/asserts/number/max.mjs +3 -5
  95. package/lib/asserts/number/max.mjs.map +1 -1
  96. package/lib/asserts/number/maxExcluded.d.mts +2 -1
  97. package/lib/asserts/number/maxExcluded.d.ts +2 -1
  98. package/lib/asserts/number/maxExcluded.js +4 -6
  99. package/lib/asserts/number/maxExcluded.js.map +1 -1
  100. package/lib/asserts/number/maxExcluded.mjs +3 -5
  101. package/lib/asserts/number/maxExcluded.mjs.map +1 -1
  102. package/lib/asserts/number/min.d.mts +2 -1
  103. package/lib/asserts/number/min.d.ts +2 -1
  104. package/lib/asserts/number/min.js +4 -6
  105. package/lib/asserts/number/min.js.map +1 -1
  106. package/lib/asserts/number/min.mjs +3 -5
  107. package/lib/asserts/number/min.mjs.map +1 -1
  108. package/lib/asserts/number/minExcluded.d.mts +2 -1
  109. package/lib/asserts/number/minExcluded.d.ts +2 -1
  110. package/lib/asserts/number/minExcluded.js +4 -6
  111. package/lib/asserts/number/minExcluded.js.map +1 -1
  112. package/lib/asserts/number/minExcluded.mjs +3 -5
  113. package/lib/asserts/number/minExcluded.mjs.map +1 -1
  114. package/lib/asserts/number/negative.d.mts +2 -1
  115. package/lib/asserts/number/negative.d.ts +2 -1
  116. package/lib/asserts/number/negative.js +4 -6
  117. package/lib/asserts/number/negative.js.map +1 -1
  118. package/lib/asserts/number/negative.mjs +3 -5
  119. package/lib/asserts/number/negative.mjs.map +1 -1
  120. package/lib/asserts/number/positive.d.mts +2 -1
  121. package/lib/asserts/number/positive.d.ts +2 -1
  122. package/lib/asserts/number/positive.js +4 -6
  123. package/lib/asserts/number/positive.js.map +1 -1
  124. package/lib/asserts/number/positive.mjs +3 -5
  125. package/lib/asserts/number/positive.mjs.map +1 -1
  126. package/lib/asserts/object/index.d.mts +2 -1
  127. package/lib/asserts/object/index.d.ts +2 -1
  128. package/lib/asserts/object/index.js +7 -7
  129. package/lib/asserts/object/index.mjs +6 -6
  130. package/lib/asserts/object/maxKeys.d.mts +2 -1
  131. package/lib/asserts/object/maxKeys.d.ts +2 -1
  132. package/lib/asserts/object/maxKeys.js +4 -6
  133. package/lib/asserts/object/maxKeys.js.map +1 -1
  134. package/lib/asserts/object/maxKeys.mjs +3 -5
  135. package/lib/asserts/object/maxKeys.mjs.map +1 -1
  136. package/lib/asserts/string/atLeastOneDigit.d.mts +2 -1
  137. package/lib/asserts/string/atLeastOneDigit.d.ts +2 -1
  138. package/lib/asserts/string/atLeastOneDigit.js +4 -6
  139. package/lib/asserts/string/atLeastOneDigit.js.map +1 -1
  140. package/lib/asserts/string/atLeastOneDigit.mjs +3 -5
  141. package/lib/asserts/string/atLeastOneDigit.mjs.map +1 -1
  142. package/lib/asserts/string/atLeastOneLowerChar.d.mts +2 -1
  143. package/lib/asserts/string/atLeastOneLowerChar.d.ts +2 -1
  144. package/lib/asserts/string/atLeastOneLowerChar.js +4 -6
  145. package/lib/asserts/string/atLeastOneLowerChar.js.map +1 -1
  146. package/lib/asserts/string/atLeastOneLowerChar.mjs +3 -5
  147. package/lib/asserts/string/atLeastOneLowerChar.mjs.map +1 -1
  148. package/lib/asserts/string/atLeastOneSpecialChar.d.mts +3 -2
  149. package/lib/asserts/string/atLeastOneSpecialChar.d.ts +3 -2
  150. package/lib/asserts/string/atLeastOneSpecialChar.js +5 -8
  151. package/lib/asserts/string/atLeastOneSpecialChar.js.map +1 -1
  152. package/lib/asserts/string/atLeastOneSpecialChar.mjs +4 -7
  153. package/lib/asserts/string/atLeastOneSpecialChar.mjs.map +1 -1
  154. package/lib/asserts/string/atLeastOneUpperChar.d.mts +2 -1
  155. package/lib/asserts/string/atLeastOneUpperChar.d.ts +2 -1
  156. package/lib/asserts/string/atLeastOneUpperChar.js +4 -6
  157. package/lib/asserts/string/atLeastOneUpperChar.js.map +1 -1
  158. package/lib/asserts/string/atLeastOneUpperChar.mjs +3 -5
  159. package/lib/asserts/string/atLeastOneUpperChar.mjs.map +1 -1
  160. package/lib/asserts/string/contains.d.mts +2 -1
  161. package/lib/asserts/string/contains.d.ts +2 -1
  162. package/lib/asserts/string/contains.js +4 -6
  163. package/lib/asserts/string/contains.js.map +1 -1
  164. package/lib/asserts/string/contains.mjs +3 -5
  165. package/lib/asserts/string/contains.mjs.map +1 -1
  166. package/lib/asserts/string/email.d.mts +2 -1
  167. package/lib/asserts/string/email.d.ts +2 -1
  168. package/lib/asserts/string/email.js +4 -6
  169. package/lib/asserts/string/email.js.map +1 -1
  170. package/lib/asserts/string/email.mjs +3 -5
  171. package/lib/asserts/string/email.mjs.map +1 -1
  172. package/lib/asserts/string/endsWith.d.mts +2 -1
  173. package/lib/asserts/string/endsWith.d.ts +2 -1
  174. package/lib/asserts/string/endsWith.js +4 -6
  175. package/lib/asserts/string/endsWith.js.map +1 -1
  176. package/lib/asserts/string/endsWith.mjs +3 -5
  177. package/lib/asserts/string/endsWith.mjs.map +1 -1
  178. package/lib/asserts/string/index.d.mts +2 -1
  179. package/lib/asserts/string/index.d.ts +2 -1
  180. package/lib/asserts/string/index.js +10 -10
  181. package/lib/asserts/string/index.mjs +9 -9
  182. package/lib/asserts/string/isValidDate.d.mts +2 -1
  183. package/lib/asserts/string/isValidDate.d.ts +2 -1
  184. package/lib/asserts/string/isValidDate.js +6 -8
  185. package/lib/asserts/string/isValidDate.js.map +1 -1
  186. package/lib/asserts/string/isValidDate.mjs +5 -7
  187. package/lib/asserts/string/isValidDate.mjs.map +1 -1
  188. package/lib/asserts/string/isValidDateTime.d.mts +2 -1
  189. package/lib/asserts/string/isValidDateTime.d.ts +2 -1
  190. package/lib/asserts/string/isValidDateTime.js +4 -6
  191. package/lib/asserts/string/isValidDateTime.js.map +1 -1
  192. package/lib/asserts/string/isValidDateTime.mjs +3 -5
  193. package/lib/asserts/string/isValidDateTime.mjs.map +1 -1
  194. package/lib/asserts/string/isValidTime.d.mts +2 -1
  195. package/lib/asserts/string/isValidTime.d.ts +2 -1
  196. package/lib/asserts/string/isValidTime.js +5 -7
  197. package/lib/asserts/string/isValidTime.js.map +1 -1
  198. package/lib/asserts/string/isValidTime.mjs +4 -6
  199. package/lib/asserts/string/isValidTime.mjs.map +1 -1
  200. package/lib/asserts/string/lowerCase.d.mts +2 -1
  201. package/lib/asserts/string/lowerCase.d.ts +2 -1
  202. package/lib/asserts/string/lowerCase.js +4 -6
  203. package/lib/asserts/string/lowerCase.js.map +1 -1
  204. package/lib/asserts/string/lowerCase.mjs +3 -5
  205. package/lib/asserts/string/lowerCase.mjs.map +1 -1
  206. package/lib/asserts/string/maxLength.d.mts +2 -1
  207. package/lib/asserts/string/maxLength.d.ts +2 -1
  208. package/lib/asserts/string/maxLength.js +4 -6
  209. package/lib/asserts/string/maxLength.js.map +1 -1
  210. package/lib/asserts/string/maxLength.mjs +3 -5
  211. package/lib/asserts/string/maxLength.mjs.map +1 -1
  212. package/lib/asserts/string/minLength.d.mts +2 -1
  213. package/lib/asserts/string/minLength.d.ts +2 -1
  214. package/lib/asserts/string/minLength.js +4 -6
  215. package/lib/asserts/string/minLength.js.map +1 -1
  216. package/lib/asserts/string/minLength.mjs +3 -5
  217. package/lib/asserts/string/minLength.mjs.map +1 -1
  218. package/lib/asserts/string/regExp.d.mts +2 -1
  219. package/lib/asserts/string/regExp.d.ts +2 -1
  220. package/lib/asserts/string/regExp.js +4 -6
  221. package/lib/asserts/string/regExp.js.map +1 -1
  222. package/lib/asserts/string/regExp.mjs +3 -5
  223. package/lib/asserts/string/regExp.mjs.map +1 -1
  224. package/lib/asserts/string/startsWith.d.mts +2 -1
  225. package/lib/asserts/string/startsWith.d.ts +2 -1
  226. package/lib/asserts/string/startsWith.js +4 -6
  227. package/lib/asserts/string/startsWith.js.map +1 -1
  228. package/lib/asserts/string/startsWith.mjs +3 -5
  229. package/lib/asserts/string/startsWith.mjs.map +1 -1
  230. package/lib/asserts/string/upperCase.d.mts +2 -1
  231. package/lib/asserts/string/upperCase.d.ts +2 -1
  232. package/lib/asserts/string/upperCase.js +4 -6
  233. package/lib/asserts/string/upperCase.js.map +1 -1
  234. package/lib/asserts/string/upperCase.mjs +3 -5
  235. package/lib/asserts/string/upperCase.mjs.map +1 -1
  236. package/lib/asserts/string/uuid.d.mts +2 -1
  237. package/lib/asserts/string/uuid.d.ts +2 -1
  238. package/lib/asserts/string/uuid.js +4 -6
  239. package/lib/asserts/string/uuid.js.map +1 -1
  240. package/lib/asserts/string/uuid.mjs +3 -5
  241. package/lib/asserts/string/uuid.mjs.map +1 -1
  242. package/lib/asserts/string/uuidV1.d.mts +2 -1
  243. package/lib/asserts/string/uuidV1.d.ts +2 -1
  244. package/lib/asserts/string/uuidV1.js +4 -6
  245. package/lib/asserts/string/uuidV1.js.map +1 -1
  246. package/lib/asserts/string/uuidV1.mjs +3 -5
  247. package/lib/asserts/string/uuidV1.mjs.map +1 -1
  248. package/lib/asserts/string/uuidV2.d.mts +2 -1
  249. package/lib/asserts/string/uuidV2.d.ts +2 -1
  250. package/lib/asserts/string/uuidV2.js +4 -6
  251. package/lib/asserts/string/uuidV2.js.map +1 -1
  252. package/lib/asserts/string/uuidV2.mjs +3 -5
  253. package/lib/asserts/string/uuidV2.mjs.map +1 -1
  254. package/lib/asserts/string/uuidV3.d.mts +2 -1
  255. package/lib/asserts/string/uuidV3.d.ts +2 -1
  256. package/lib/asserts/string/uuidV3.js +4 -6
  257. package/lib/asserts/string/uuidV3.js.map +1 -1
  258. package/lib/asserts/string/uuidV3.mjs +3 -5
  259. package/lib/asserts/string/uuidV3.mjs.map +1 -1
  260. package/lib/asserts/string/uuidV4.d.mts +2 -1
  261. package/lib/asserts/string/uuidV4.d.ts +2 -1
  262. package/lib/asserts/string/uuidV4.js +4 -6
  263. package/lib/asserts/string/uuidV4.js.map +1 -1
  264. package/lib/asserts/string/uuidV4.mjs +3 -5
  265. package/lib/asserts/string/uuidV4.mjs.map +1 -1
  266. package/lib/asserts/string/uuidV5.d.mts +2 -1
  267. package/lib/asserts/string/uuidV5.d.ts +2 -1
  268. package/lib/asserts/string/uuidV5.js +4 -6
  269. package/lib/asserts/string/uuidV5.js.map +1 -1
  270. package/lib/asserts/string/uuidV5.mjs +3 -5
  271. package/lib/asserts/string/uuidV5.mjs.map +1 -1
  272. package/lib/asserts/string/validUrl.d.mts +2 -1
  273. package/lib/asserts/string/validUrl.d.ts +2 -1
  274. package/lib/asserts/string/validUrl.js +4 -11
  275. package/lib/asserts/string/validUrl.js.map +1 -1
  276. package/lib/asserts/string/validUrl.mjs +3 -10
  277. package/lib/asserts/string/validUrl.mjs.map +1 -1
  278. package/lib/{chunk-IZ3CBVEE.js → chunk-32MKEBKR.js} +4 -7
  279. package/lib/chunk-32MKEBKR.js.map +1 -0
  280. package/lib/chunk-3ZQ4ORQH.js +14 -0
  281. package/lib/{chunk-QIDWASOC.js.map → chunk-3ZQ4ORQH.js.map} +1 -1
  282. package/lib/{chunk-U4USIJV3.js → chunk-BURPSYZ3.js} +11 -11
  283. package/lib/{chunk-U4USIJV3.js.map → chunk-BURPSYZ3.js.map} +1 -1
  284. package/lib/{chunk-YUMUCQKL.mjs → chunk-CCNK27CX.mjs} +4 -4
  285. package/lib/{chunk-C3EDEQ3W.mjs → chunk-EMOOEIPZ.mjs} +3 -6
  286. package/lib/chunk-EMOOEIPZ.mjs.map +1 -0
  287. package/lib/{chunk-5YYRBKDP.js → chunk-EXVTHIT5.js} +4 -4
  288. package/lib/chunk-EXVTHIT5.js.map +1 -0
  289. package/lib/chunk-FIDPCCCW.js +24 -0
  290. package/lib/chunk-FIDPCCCW.js.map +1 -0
  291. package/lib/{chunk-ECBOZ3BM.js → chunk-FNBYM254.js} +7 -10
  292. package/lib/chunk-FNBYM254.js.map +1 -0
  293. package/lib/chunk-IFQLPXCZ.mjs +111 -0
  294. package/lib/chunk-IFQLPXCZ.mjs.map +1 -0
  295. package/lib/{chunk-SHJVKSEZ.js → chunk-MMWS3SXR.js} +17 -17
  296. package/lib/chunk-MMWS3SXR.js.map +1 -0
  297. package/lib/{chunk-BNCT7NOR.mjs → chunk-MQRXWXHP.mjs} +16 -24
  298. package/lib/chunk-MQRXWXHP.mjs.map +1 -0
  299. package/lib/{chunk-FP5QAEVQ.mjs → chunk-MRRMV2GM.mjs} +6 -6
  300. package/lib/chunk-P4Q22AZA.js +28 -0
  301. package/lib/{chunk-VW4RMQD4.js.map → chunk-P4Q22AZA.js.map} +1 -1
  302. package/lib/{chunk-K7X6DVM2.mjs → chunk-P54CF5QN.mjs} +3 -6
  303. package/lib/chunk-P54CF5QN.mjs.map +1 -0
  304. package/lib/{chunk-X762EUSZ.js → chunk-PE55R4KH.js} +16 -24
  305. package/lib/chunk-PE55R4KH.js.map +1 -0
  306. package/lib/{chunk-2KQASECD.js → chunk-PGEXAFA5.js} +5 -5
  307. package/lib/{chunk-2KQASECD.js.map → chunk-PGEXAFA5.js.map} +1 -1
  308. package/lib/chunk-PQ4GCO3Q.js +111 -0
  309. package/lib/chunk-PQ4GCO3Q.js.map +1 -0
  310. package/lib/{chunk-H32B3NHW.mjs → chunk-QWPHP26D.mjs} +2 -2
  311. package/lib/chunk-QWPHP26D.mjs.map +1 -0
  312. package/lib/{chunk-Z6QU36MM.js → chunk-RAJF6LMF.js} +12 -12
  313. package/lib/{chunk-Z6QU36MM.js.map → chunk-RAJF6LMF.js.map} +1 -1
  314. package/lib/{chunk-UUY7DPHK.js → chunk-RG5NYH2I.js} +12 -12
  315. package/lib/{chunk-UUY7DPHK.js.map → chunk-RG5NYH2I.js.map} +1 -1
  316. package/lib/{chunk-WK4FJ5GD.mjs → chunk-U3DJ354I.mjs} +6 -6
  317. package/lib/{chunk-7NBOVYSP.mjs → chunk-UEYMBPZN.mjs} +4 -4
  318. package/lib/chunk-UEYMBPZN.mjs.map +1 -0
  319. package/lib/{chunk-HP3DRZWK.js → chunk-UTPG4GZB.js} +4 -7
  320. package/lib/chunk-UTPG4GZB.js.map +1 -0
  321. package/lib/{chunk-MHBY5OIQ.mjs → chunk-VIFJBTQO.mjs} +3 -3
  322. package/lib/{chunk-CHUPE6SJ.mjs → chunk-W2SQHSOS.mjs} +6 -6
  323. package/lib/{chunk-LPR3G5T3.mjs → chunk-XG6K6N3A.mjs} +4 -4
  324. package/lib/{chunk-6D5W7SSQ.mjs → chunk-XT5E3MPI.mjs} +4 -7
  325. package/lib/chunk-XT5E3MPI.mjs.map +1 -0
  326. package/lib/{chunk-H6LHV3EA.mjs → chunk-YSCVE4PJ.mjs} +2 -2
  327. package/lib/{chunk-MLNQZ445.js → chunk-ZG373PNB.js} +13 -13
  328. package/lib/{chunk-MLNQZ445.js.map → chunk-ZG373PNB.js.map} +1 -1
  329. package/lib/chunk-ZTCXXAKD.mjs +24 -0
  330. package/lib/chunk-ZTCXXAKD.mjs.map +1 -0
  331. package/lib/codeGen.d.mts +3 -2
  332. package/lib/codeGen.d.ts +3 -2
  333. package/lib/codeGen.js +2 -3
  334. package/lib/codeGen.js.map +1 -1
  335. package/lib/codeGen.mjs +1 -2
  336. package/lib/codeGen.mjs.map +1 -1
  337. package/lib/commonTypes.d.mts +1 -12
  338. package/lib/commonTypes.d.ts +1 -12
  339. package/lib/exceptions.d.mts +2 -3
  340. package/lib/exceptions.d.ts +2 -3
  341. package/lib/exceptions.js +2 -4
  342. package/lib/exceptions.js.map +1 -1
  343. package/lib/exceptions.mjs +3 -5
  344. package/lib/helpers/core.d.mts +3 -2
  345. package/lib/helpers/core.d.ts +3 -2
  346. package/lib/helpers/core.js +2 -3
  347. package/lib/helpers/core.js.map +1 -1
  348. package/lib/helpers/core.mjs +1 -2
  349. package/lib/helpers/setStrictType.d.mts +3 -2
  350. package/lib/helpers/setStrictType.d.ts +3 -2
  351. package/lib/helpers/setStrictType.js +3 -4
  352. package/lib/helpers/setStrictType.js.map +1 -1
  353. package/lib/helpers/setStrictType.mjs +2 -3
  354. package/lib/index.d.mts +3 -2
  355. package/lib/index.d.ts +3 -2
  356. package/lib/index.js +6 -10
  357. package/lib/index.js.map +1 -1
  358. package/lib/index.mjs +7 -11
  359. package/lib/parse.d.mts +2 -1
  360. package/lib/parse.d.ts +2 -1
  361. package/lib/parse.js +5 -5
  362. package/lib/parse.mjs +4 -4
  363. package/lib/parseOrFail.d.mts +2 -1
  364. package/lib/parseOrFail.d.ts +2 -1
  365. package/lib/parseOrFail.js +5 -5
  366. package/lib/parseOrFail.mjs +4 -4
  367. package/lib/schemas/ArraySchema.d.mts +3 -2
  368. package/lib/schemas/ArraySchema.d.ts +3 -2
  369. package/lib/schemas/ArraySchema.js +7 -7
  370. package/lib/schemas/ArraySchema.mjs +6 -6
  371. package/lib/schemas/BigIntSchema.d.mts +2 -1
  372. package/lib/schemas/BigIntSchema.d.ts +2 -1
  373. package/lib/schemas/BigIntSchema.js +10 -10
  374. package/lib/schemas/BigIntSchema.mjs +9 -9
  375. package/lib/schemas/BooleanSchema.d.mts +2 -1
  376. package/lib/schemas/BooleanSchema.d.ts +2 -1
  377. package/lib/schemas/BooleanSchema.js +8 -8
  378. package/lib/schemas/BooleanSchema.mjs +7 -7
  379. package/lib/schemas/CommonSchema.d.mts +2 -1
  380. package/lib/schemas/CommonSchema.d.ts +2 -1
  381. package/lib/schemas/CommonSchema.js +6 -6
  382. package/lib/schemas/CommonSchema.mjs +5 -5
  383. package/lib/schemas/DateSchema.d.mts +3 -2
  384. package/lib/schemas/DateSchema.d.ts +3 -2
  385. package/lib/schemas/DateSchema.js +7 -7
  386. package/lib/schemas/DateSchema.mjs +6 -6
  387. package/lib/schemas/NumberSchema.d.mts +2 -1
  388. package/lib/schemas/NumberSchema.d.ts +2 -1
  389. package/lib/schemas/NumberSchema.js +10 -10
  390. package/lib/schemas/NumberSchema.mjs +9 -9
  391. package/lib/schemas/ObjectSchema.d.mts +3 -2
  392. package/lib/schemas/ObjectSchema.d.ts +3 -2
  393. package/lib/schemas/ObjectSchema.js +7 -7
  394. package/lib/schemas/ObjectSchema.mjs +6 -6
  395. package/lib/schemas/StringSchema.d.mts +2 -1
  396. package/lib/schemas/StringSchema.d.ts +2 -1
  397. package/lib/schemas/StringSchema.js +10 -10
  398. package/lib/schemas/StringSchema.mjs +9 -9
  399. package/lib/translationMap.d.mts +2 -1
  400. package/lib/translationMap.d.ts +2 -1
  401. package/lib/translationMap.js +3 -3
  402. package/lib/translationMap.mjs +2 -2
  403. package/package.json +9 -9
  404. package/lib/chunk-5P6AZJCN.js +0 -45
  405. package/lib/chunk-5P6AZJCN.js.map +0 -1
  406. package/lib/chunk-5WHCMWXK.js +0 -50
  407. package/lib/chunk-5WHCMWXK.js.map +0 -1
  408. package/lib/chunk-5YYRBKDP.js.map +0 -1
  409. package/lib/chunk-6D5W7SSQ.mjs.map +0 -1
  410. package/lib/chunk-7NBOVYSP.mjs.map +0 -1
  411. package/lib/chunk-BNCT7NOR.mjs.map +0 -1
  412. package/lib/chunk-C3EDEQ3W.mjs.map +0 -1
  413. package/lib/chunk-ECBOZ3BM.js.map +0 -1
  414. package/lib/chunk-FGZKNBDP.mjs +0 -45
  415. package/lib/chunk-FGZKNBDP.mjs.map +0 -1
  416. package/lib/chunk-G55SHHAR.js +0 -29
  417. package/lib/chunk-G55SHHAR.js.map +0 -1
  418. package/lib/chunk-H32B3NHW.mjs.map +0 -1
  419. package/lib/chunk-HP3DRZWK.js.map +0 -1
  420. package/lib/chunk-IZ3CBVEE.js.map +0 -1
  421. package/lib/chunk-K7X6DVM2.mjs.map +0 -1
  422. package/lib/chunk-QIDWASOC.js +0 -14
  423. package/lib/chunk-SHJVKSEZ.js.map +0 -1
  424. package/lib/chunk-TRGMD7LA.mjs +0 -29
  425. package/lib/chunk-TRGMD7LA.mjs.map +0 -1
  426. package/lib/chunk-TV5IZY4L.mjs +0 -50
  427. package/lib/chunk-TV5IZY4L.mjs.map +0 -1
  428. package/lib/chunk-VW4RMQD4.js +0 -28
  429. package/lib/chunk-X762EUSZ.js.map +0 -1
  430. /package/lib/{chunk-YUMUCQKL.mjs.map → chunk-CCNK27CX.mjs.map} +0 -0
  431. /package/lib/{chunk-FP5QAEVQ.mjs.map → chunk-MRRMV2GM.mjs.map} +0 -0
  432. /package/lib/{chunk-WK4FJ5GD.mjs.map → chunk-U3DJ354I.mjs.map} +0 -0
  433. /package/lib/{chunk-MHBY5OIQ.mjs.map → chunk-VIFJBTQO.mjs.map} +0 -0
  434. /package/lib/{chunk-CHUPE6SJ.mjs.map → chunk-W2SQHSOS.mjs.map} +0 -0
  435. /package/lib/{chunk-LPR3G5T3.mjs.map → chunk-XG6K6N3A.mjs.map} +0 -0
  436. /package/lib/{chunk-H6LHV3EA.mjs.map → chunk-YSCVE4PJ.mjs.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/bguard/bguard/lib/asserts/string/lowerCase.js","../../../src/asserts/string/lowerCase.ts"],"names":[],"mappings":"AAAA;AACE;AACF,0DAAgC;AAChC;AACE;AACF,0DAAgC;AAChC;AACA;ACHA,IAAM,sBAAA,EAAwB,wCAAA;AAC9B,IAAM,kBAAA,EAAoB,aAAA;AAanB,IAAM,UAAA,EAAY,CAAA,EAAA,GAA0B,CAAC,QAAA,EAAkB,GAAA,EAAA,GAA0B;AAC9F,EAAA,GAAA,CAAI,SAAA,IAAa,QAAA,CAAS,WAAA,CAAY,CAAA,EAAG,6CAAA,YAAe,EAAc,QAAA,EAAU,GAAA,EAAK,iBAAiB,CAAA;AACxG,CAAA;AAEA,SAAA,CAAU,IAAA,EAAM,iBAAA;AAChB,SAAA,CAAU,QAAA,EAAU,qBAAA;AACpB,iDAAA,SAA4B,CAAA;ADR5B;AACE;AACF,8BAAC","file":"/home/runner/work/bguard/bguard/lib/asserts/string/lowerCase.js","sourcesContent":[null,"import { ExceptionContext, RequiredValidation } from '../../commonTypes';\nimport { guardException } from '../../exceptions';\nimport { setToDefaultLocale } from '../../translationMap';\n\nconst lowerCaseErrorMessage = 'The received value is not in lowercase';\nconst lowerCaseErrorKey = 's:lowerCase';\n\n/**\n * @description Asserts that a string value is in lowercase.\n * @returns {RequiredValidation} A validation function that takes a received string and an exception context.\n * @throws {ValidationError} if the received value is not in lowercase.\n * @example\n * const schema = string().custom(lowerCase());\n * parseOrFail(schema, 'valid'); // Valid\n * parseOrFail(schema, 'Invalid'); // Throws an error: 'The received value is not in lowercase'\n *\n * @translation Error Translation Key = 's:lowerCase'\n */\nexport const lowerCase = (): RequiredValidation => (received: string, ctx: ExceptionContext) => {\n if (received !== received.toLowerCase()) guardException('lower case', received, ctx, lowerCaseErrorKey);\n};\n\nlowerCase.key = lowerCaseErrorKey;\nlowerCase.message = lowerCaseErrorMessage;\nsetToDefaultLocale(lowerCase);\n"]}
1
+ {"version":3,"sources":["/home/runner/work/bguard/bguard/lib/asserts/string/lowerCase.js","../../../src/asserts/string/lowerCase.ts"],"names":[],"mappings":"AAAA;AACE;AACF,0DAAgC;AAChC,mCAAgC;AAChC;AACA;ACFA,IAAM,sBAAA,EAAwB,wCAAA;AAC9B,IAAM,kBAAA,EAAoB,aAAA;AAanB,IAAM,UAAA,EAAY,CAAA,EAAA,GAA0B,CAAC,QAAA,EAAkB,GAAA,EAAA,GAA0B;AAC9F,EAAA,GAAA,CAAI,SAAA,IAAa,QAAA,CAAS,WAAA,CAAY,CAAA,EAAG,GAAA,CAAI,QAAA,CAAS,YAAA,EAAc,QAAA,EAAU,iBAAiB,CAAA;AACjG,CAAA;AAEA,SAAA,CAAU,IAAA,EAAM,iBAAA;AAChB,SAAA,CAAU,QAAA,EAAU,qBAAA;AACpB,iDAAA,SAA4B,CAAA;ADT5B;AACE;AACF,8BAAC","file":"/home/runner/work/bguard/bguard/lib/asserts/string/lowerCase.js","sourcesContent":[null,"import { ExceptionContext, RequiredValidation } from '../../ExceptionContext';\nimport { setToDefaultLocale } from '../../translationMap';\n\nconst lowerCaseErrorMessage = 'The received value is not in lowercase';\nconst lowerCaseErrorKey = 's:lowerCase';\n\n/**\n * @description Asserts that a string value is in lowercase.\n * @returns {RequiredValidation} A validation function that takes a received string and an exception context.\n * @throws {ValidationError} if the received value is not in lowercase.\n * @example\n * const schema = string().custom(lowerCase());\n * parseOrFail(schema, 'valid'); // Valid\n * parseOrFail(schema, 'Invalid'); // Throws an error: 'The received value is not in lowercase'\n *\n * @translation Error Translation Key = 's:lowerCase'\n */\nexport const lowerCase = (): RequiredValidation => (received: string, ctx: ExceptionContext) => {\n if (received !== received.toLowerCase()) ctx.addIssue('lower case', received, lowerCaseErrorKey);\n};\n\nlowerCase.key = lowerCaseErrorKey;\nlowerCase.message = lowerCaseErrorMessage;\nsetToDefaultLocale(lowerCase);\n"]}
@@ -1,15 +1,13 @@
1
1
  import {
2
2
  setToDefaultLocale
3
- } from "../../chunk-H32B3NHW.mjs";
4
- import {
5
- guardException
6
- } from "../../chunk-FGZKNBDP.mjs";
3
+ } from "../../chunk-QWPHP26D.mjs";
4
+ import "../../chunk-ZTCXXAKD.mjs";
7
5
 
8
6
  // src/asserts/string/lowerCase.ts
9
7
  var lowerCaseErrorMessage = "The received value is not in lowercase";
10
8
  var lowerCaseErrorKey = "s:lowerCase";
11
9
  var lowerCase = () => (received, ctx) => {
12
- if (received !== received.toLowerCase()) guardException("lower case", received, ctx, lowerCaseErrorKey);
10
+ if (received !== received.toLowerCase()) ctx.addIssue("lower case", received, lowerCaseErrorKey);
13
11
  };
14
12
  lowerCase.key = lowerCaseErrorKey;
15
13
  lowerCase.message = lowerCaseErrorMessage;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/asserts/string/lowerCase.ts"],"sourcesContent":["import { ExceptionContext, RequiredValidation } from '../../commonTypes';\nimport { guardException } from '../../exceptions';\nimport { setToDefaultLocale } from '../../translationMap';\n\nconst lowerCaseErrorMessage = 'The received value is not in lowercase';\nconst lowerCaseErrorKey = 's:lowerCase';\n\n/**\n * @description Asserts that a string value is in lowercase.\n * @returns {RequiredValidation} A validation function that takes a received string and an exception context.\n * @throws {ValidationError} if the received value is not in lowercase.\n * @example\n * const schema = string().custom(lowerCase());\n * parseOrFail(schema, 'valid'); // Valid\n * parseOrFail(schema, 'Invalid'); // Throws an error: 'The received value is not in lowercase'\n *\n * @translation Error Translation Key = 's:lowerCase'\n */\nexport const lowerCase = (): RequiredValidation => (received: string, ctx: ExceptionContext) => {\n if (received !== received.toLowerCase()) guardException('lower case', received, ctx, lowerCaseErrorKey);\n};\n\nlowerCase.key = lowerCaseErrorKey;\nlowerCase.message = lowerCaseErrorMessage;\nsetToDefaultLocale(lowerCase);\n"],"mappings":";;;;;;;;AAIA,IAAM,wBAAwB;AAC9B,IAAM,oBAAoB;AAanB,IAAM,YAAY,MAA0B,CAAC,UAAkB,QAA0B;AAC9F,MAAI,aAAa,SAAS,YAAY,EAAG,gBAAe,cAAc,UAAU,KAAK,iBAAiB;AACxG;AAEA,UAAU,MAAM;AAChB,UAAU,UAAU;AACpB,mBAAmB,SAAS;","names":[]}
1
+ {"version":3,"sources":["../../../src/asserts/string/lowerCase.ts"],"sourcesContent":["import { ExceptionContext, RequiredValidation } from '../../ExceptionContext';\nimport { setToDefaultLocale } from '../../translationMap';\n\nconst lowerCaseErrorMessage = 'The received value is not in lowercase';\nconst lowerCaseErrorKey = 's:lowerCase';\n\n/**\n * @description Asserts that a string value is in lowercase.\n * @returns {RequiredValidation} A validation function that takes a received string and an exception context.\n * @throws {ValidationError} if the received value is not in lowercase.\n * @example\n * const schema = string().custom(lowerCase());\n * parseOrFail(schema, 'valid'); // Valid\n * parseOrFail(schema, 'Invalid'); // Throws an error: 'The received value is not in lowercase'\n *\n * @translation Error Translation Key = 's:lowerCase'\n */\nexport const lowerCase = (): RequiredValidation => (received: string, ctx: ExceptionContext) => {\n if (received !== received.toLowerCase()) ctx.addIssue('lower case', received, lowerCaseErrorKey);\n};\n\nlowerCase.key = lowerCaseErrorKey;\nlowerCase.message = lowerCaseErrorMessage;\nsetToDefaultLocale(lowerCase);\n"],"mappings":";;;;;;AAGA,IAAM,wBAAwB;AAC9B,IAAM,oBAAoB;AAanB,IAAM,YAAY,MAA0B,CAAC,UAAkB,QAA0B;AAC9F,MAAI,aAAa,SAAS,YAAY,EAAG,KAAI,SAAS,cAAc,UAAU,iBAAiB;AACjG;AAEA,UAAU,MAAM;AAChB,UAAU,UAAU;AACpB,mBAAmB,SAAS;","names":[]}
@@ -1,4 +1,5 @@
1
- import { RequiredValidation } from '../../commonTypes.mjs';
1
+ import { RequiredValidation } from '../../ExceptionContext.mjs';
2
+ import '../../commonTypes.mjs';
2
3
 
3
4
  /**
4
5
  * @description Asserts that the length of a string value is not greater than a specified maximum length.
@@ -1,4 +1,5 @@
1
- import { RequiredValidation } from '../../commonTypes.js';
1
+ import { RequiredValidation } from '../../ExceptionContext.js';
2
+ import '../../commonTypes.js';
2
3
 
3
4
  /**
4
5
  * @description Asserts that the length of a string value is not greater than a specified maximum length.
@@ -1,19 +1,17 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunk5YYRBKDPjs = require('../../chunk-5YYRBKDP.js');
4
-
5
-
6
- var _chunk5P6AZJCNjs = require('../../chunk-5P6AZJCN.js');
3
+ var _chunkEXVTHIT5js = require('../../chunk-EXVTHIT5.js');
4
+ require('../../chunk-FIDPCCCW.js');
7
5
 
8
6
  // src/asserts/string/maxLength.ts
9
7
  var maxLengthErrorMessage = "The received value length is greater than expected";
10
8
  var maxLengthErrorKey = "s:maxLength";
11
9
  var maxLength = (expected) => (received, ctx) => {
12
- if (received.length > expected) _chunk5P6AZJCNjs.guardException.call(void 0, expected, received, ctx, maxLengthErrorMessage);
10
+ if (received.length > expected) ctx.addIssue(expected, received, maxLengthErrorMessage);
13
11
  };
14
12
  maxLength.key = maxLengthErrorKey;
15
13
  maxLength.message = maxLengthErrorMessage;
16
- _chunk5YYRBKDPjs.setToDefaultLocale.call(void 0, maxLength);
14
+ _chunkEXVTHIT5js.setToDefaultLocale.call(void 0, maxLength);
17
15
 
18
16
 
19
17
  exports.maxLength = maxLength;
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/bguard/bguard/lib/asserts/string/maxLength.js","../../../src/asserts/string/maxLength.ts"],"names":[],"mappings":"AAAA;AACE;AACF,0DAAgC;AAChC;AACE;AACF,0DAAgC;AAChC;AACA;ACHA,IAAM,sBAAA,EAAwB,oDAAA;AAC9B,IAAM,kBAAA,EAAoB,aAAA;AAcnB,IAAM,UAAA,EACX,CAAC,QAAA,EAAA,GACD,CAAC,QAAA,EAAkB,GAAA,EAAA,GAA0B;AAC3C,EAAA,GAAA,CAAI,QAAA,CAAS,OAAA,EAAS,QAAA,EAAU,6CAAA,QAAe,EAAU,QAAA,EAAU,GAAA,EAAK,qBAAqB,CAAA;AAC/F,CAAA;AAEF,SAAA,CAAU,IAAA,EAAM,iBAAA;AAChB,SAAA,CAAU,QAAA,EAAU,qBAAA;AACpB,iDAAA,SAA4B,CAAA;ADX5B;AACE;AACF,8BAAC","file":"/home/runner/work/bguard/bguard/lib/asserts/string/maxLength.js","sourcesContent":[null,"import { guardException } from '../../exceptions';\nimport { ExceptionContext, RequiredValidation } from '../../commonTypes';\nimport { setToDefaultLocale } from '../../translationMap';\n\nconst maxLengthErrorMessage = 'The received value length is greater than expected';\nconst maxLengthErrorKey = 's:maxLength';\n\n/**\n * @description Asserts that the length of a string value is not greater than a specified maximum length.\n * @param {number} expected The maximum allowed length for the string.\n * @returns {RequiredValidation} A validation function that takes a received string 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 = string().custom(maxLength(10));\n * parseOrFail(schema, 'short'); // Valid\n * parseOrFail(schema, 'this is a very long string'); // Throws an error: 'The received value length is greater than expected'\n *\n * @translation Error Translation Key = 's:maxLength'\n */\nexport const maxLength =\n (expected: number): RequiredValidation =>\n (received: string, ctx: ExceptionContext) => {\n if (received.length > expected) guardException(expected, received, ctx, maxLengthErrorMessage);\n };\n\nmaxLength.key = maxLengthErrorKey;\nmaxLength.message = maxLengthErrorMessage;\nsetToDefaultLocale(maxLength);\n"]}
1
+ {"version":3,"sources":["/home/runner/work/bguard/bguard/lib/asserts/string/maxLength.js","../../../src/asserts/string/maxLength.ts"],"names":[],"mappings":"AAAA;AACE;AACF,0DAAgC;AAChC,mCAAgC;AAChC;AACA;ACFA,IAAM,sBAAA,EAAwB,oDAAA;AAC9B,IAAM,kBAAA,EAAoB,aAAA;AAcnB,IAAM,UAAA,EACX,CAAC,QAAA,EAAA,GACD,CAAC,QAAA,EAAkB,GAAA,EAAA,GAA0B;AAC3C,EAAA,GAAA,CAAI,QAAA,CAAS,OAAA,EAAS,QAAA,EAAU,GAAA,CAAI,QAAA,CAAS,QAAA,EAAU,QAAA,EAAU,qBAAqB,CAAA;AACxF,CAAA;AAEF,SAAA,CAAU,IAAA,EAAM,iBAAA;AAChB,SAAA,CAAU,QAAA,EAAU,qBAAA;AACpB,iDAAA,SAA4B,CAAA;ADZ5B;AACE;AACF,8BAAC","file":"/home/runner/work/bguard/bguard/lib/asserts/string/maxLength.js","sourcesContent":[null,"import { ExceptionContext, RequiredValidation } from '../../ExceptionContext';\nimport { setToDefaultLocale } from '../../translationMap';\n\nconst maxLengthErrorMessage = 'The received value length is greater than expected';\nconst maxLengthErrorKey = 's:maxLength';\n\n/**\n * @description Asserts that the length of a string value is not greater than a specified maximum length.\n * @param {number} expected The maximum allowed length for the string.\n * @returns {RequiredValidation} A validation function that takes a received string 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 = string().custom(maxLength(10));\n * parseOrFail(schema, 'short'); // Valid\n * parseOrFail(schema, 'this is a very long string'); // Throws an error: 'The received value length is greater than expected'\n *\n * @translation Error Translation Key = 's:maxLength'\n */\nexport const maxLength =\n (expected: number): RequiredValidation =>\n (received: string, ctx: ExceptionContext) => {\n if (received.length > expected) ctx.addIssue(expected, received, maxLengthErrorMessage);\n };\n\nmaxLength.key = maxLengthErrorKey;\nmaxLength.message = maxLengthErrorMessage;\nsetToDefaultLocale(maxLength);\n"]}
@@ -1,15 +1,13 @@
1
1
  import {
2
2
  setToDefaultLocale
3
- } from "../../chunk-H32B3NHW.mjs";
4
- import {
5
- guardException
6
- } from "../../chunk-FGZKNBDP.mjs";
3
+ } from "../../chunk-QWPHP26D.mjs";
4
+ import "../../chunk-ZTCXXAKD.mjs";
7
5
 
8
6
  // src/asserts/string/maxLength.ts
9
7
  var maxLengthErrorMessage = "The received value length is greater than expected";
10
8
  var maxLengthErrorKey = "s:maxLength";
11
9
  var maxLength = (expected) => (received, ctx) => {
12
- if (received.length > expected) guardException(expected, received, ctx, maxLengthErrorMessage);
10
+ if (received.length > expected) ctx.addIssue(expected, received, maxLengthErrorMessage);
13
11
  };
14
12
  maxLength.key = maxLengthErrorKey;
15
13
  maxLength.message = maxLengthErrorMessage;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/asserts/string/maxLength.ts"],"sourcesContent":["import { guardException } from '../../exceptions';\nimport { ExceptionContext, RequiredValidation } from '../../commonTypes';\nimport { setToDefaultLocale } from '../../translationMap';\n\nconst maxLengthErrorMessage = 'The received value length is greater than expected';\nconst maxLengthErrorKey = 's:maxLength';\n\n/**\n * @description Asserts that the length of a string value is not greater than a specified maximum length.\n * @param {number} expected The maximum allowed length for the string.\n * @returns {RequiredValidation} A validation function that takes a received string 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 = string().custom(maxLength(10));\n * parseOrFail(schema, 'short'); // Valid\n * parseOrFail(schema, 'this is a very long string'); // Throws an error: 'The received value length is greater than expected'\n *\n * @translation Error Translation Key = 's:maxLength'\n */\nexport const maxLength =\n (expected: number): RequiredValidation =>\n (received: string, ctx: ExceptionContext) => {\n if (received.length > expected) guardException(expected, received, ctx, maxLengthErrorMessage);\n };\n\nmaxLength.key = maxLengthErrorKey;\nmaxLength.message = maxLengthErrorMessage;\nsetToDefaultLocale(maxLength);\n"],"mappings":";;;;;;;;AAIA,IAAM,wBAAwB;AAC9B,IAAM,oBAAoB;AAcnB,IAAM,YACX,CAAC,aACD,CAAC,UAAkB,QAA0B;AAC3C,MAAI,SAAS,SAAS,SAAU,gBAAe,UAAU,UAAU,KAAK,qBAAqB;AAC/F;AAEF,UAAU,MAAM;AAChB,UAAU,UAAU;AACpB,mBAAmB,SAAS;","names":[]}
1
+ {"version":3,"sources":["../../../src/asserts/string/maxLength.ts"],"sourcesContent":["import { ExceptionContext, RequiredValidation } from '../../ExceptionContext';\nimport { setToDefaultLocale } from '../../translationMap';\n\nconst maxLengthErrorMessage = 'The received value length is greater than expected';\nconst maxLengthErrorKey = 's:maxLength';\n\n/**\n * @description Asserts that the length of a string value is not greater than a specified maximum length.\n * @param {number} expected The maximum allowed length for the string.\n * @returns {RequiredValidation} A validation function that takes a received string 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 = string().custom(maxLength(10));\n * parseOrFail(schema, 'short'); // Valid\n * parseOrFail(schema, 'this is a very long string'); // Throws an error: 'The received value length is greater than expected'\n *\n * @translation Error Translation Key = 's:maxLength'\n */\nexport const maxLength =\n (expected: number): RequiredValidation =>\n (received: string, ctx: ExceptionContext) => {\n if (received.length > expected) ctx.addIssue(expected, received, maxLengthErrorMessage);\n };\n\nmaxLength.key = maxLengthErrorKey;\nmaxLength.message = maxLengthErrorMessage;\nsetToDefaultLocale(maxLength);\n"],"mappings":";;;;;;AAGA,IAAM,wBAAwB;AAC9B,IAAM,oBAAoB;AAcnB,IAAM,YACX,CAAC,aACD,CAAC,UAAkB,QAA0B;AAC3C,MAAI,SAAS,SAAS,SAAU,KAAI,SAAS,UAAU,UAAU,qBAAqB;AACxF;AAEF,UAAU,MAAM;AAChB,UAAU,UAAU;AACpB,mBAAmB,SAAS;","names":[]}
@@ -1,4 +1,5 @@
1
- import { RequiredValidation } from '../../commonTypes.mjs';
1
+ import { RequiredValidation } from '../../ExceptionContext.mjs';
2
+ import '../../commonTypes.mjs';
2
3
 
3
4
  /**
4
5
  * @description Asserts that the length of a string value is not less than a specified minimum length.
@@ -1,4 +1,5 @@
1
- import { RequiredValidation } from '../../commonTypes.js';
1
+ import { RequiredValidation } from '../../ExceptionContext.js';
2
+ import '../../commonTypes.js';
2
3
 
3
4
  /**
4
5
  * @description Asserts that the length of a string value is not less than a specified minimum length.
@@ -1,19 +1,17 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunk5YYRBKDPjs = require('../../chunk-5YYRBKDP.js');
4
-
5
-
6
- var _chunk5P6AZJCNjs = require('../../chunk-5P6AZJCN.js');
3
+ var _chunkEXVTHIT5js = require('../../chunk-EXVTHIT5.js');
4
+ require('../../chunk-FIDPCCCW.js');
7
5
 
8
6
  // src/asserts/string/minLength.ts
9
7
  var minLengthErrorMessage = "The received value length is less than expected";
10
8
  var minLengthErrorKey = "s:minLength";
11
9
  var minLength = (expected) => (received, ctx) => {
12
- if (received.length < expected) _chunk5P6AZJCNjs.guardException.call(void 0, expected, received, ctx, minLengthErrorMessage);
10
+ if (received.length < expected) ctx.addIssue(expected, received, minLengthErrorMessage);
13
11
  };
14
12
  minLength.key = minLengthErrorKey;
15
13
  minLength.message = minLengthErrorMessage;
16
- _chunk5YYRBKDPjs.setToDefaultLocale.call(void 0, minLength);
14
+ _chunkEXVTHIT5js.setToDefaultLocale.call(void 0, minLength);
17
15
 
18
16
 
19
17
  exports.minLength = minLength;
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/bguard/bguard/lib/asserts/string/minLength.js","../../../src/asserts/string/minLength.ts"],"names":[],"mappings":"AAAA;AACE;AACF,0DAAgC;AAChC;AACE;AACF,0DAAgC;AAChC;AACA;ACHA,IAAM,sBAAA,EAAwB,iDAAA;AAC9B,IAAM,kBAAA,EAAoB,aAAA;AAcnB,IAAM,UAAA,EACX,CAAC,QAAA,EAAA,GACD,CAAC,QAAA,EAAkB,GAAA,EAAA,GAA0B;AAC3C,EAAA,GAAA,CAAI,QAAA,CAAS,OAAA,EAAS,QAAA,EAAU,6CAAA,QAAe,EAAU,QAAA,EAAU,GAAA,EAAK,qBAAqB,CAAA;AAC/F,CAAA;AAEF,SAAA,CAAU,IAAA,EAAM,iBAAA;AAChB,SAAA,CAAU,QAAA,EAAU,qBAAA;AACpB,iDAAA,SAA4B,CAAA;ADX5B;AACE;AACF,8BAAC","file":"/home/runner/work/bguard/bguard/lib/asserts/string/minLength.js","sourcesContent":[null,"import { guardException } from '../../exceptions';\nimport { ExceptionContext, RequiredValidation } from '../../commonTypes';\nimport { setToDefaultLocale } from '../../translationMap';\n\nconst minLengthErrorMessage = 'The received value length is less than expected';\nconst minLengthErrorKey = 's:minLength';\n\n/**\n * @description Asserts that the length of a string value is not less than a specified minimum length.\n * @param {number} expected The minimum required length for the string.\n * @returns {RequiredValidation} A validation function that takes a received string 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 = string().custom(minLength(5));\n * parseOrFail(schema, 'short'); // Throws an error: 'The received value length is less than expected'\n * parseOrFail(schema, 'adequate'); // Valid\n *\n * @translation Error Translation Key = 's:minLength'\n */\nexport const minLength =\n (expected: number): RequiredValidation =>\n (received: string, ctx: ExceptionContext) => {\n if (received.length < expected) guardException(expected, received, ctx, minLengthErrorMessage);\n };\n\nminLength.key = minLengthErrorKey;\nminLength.message = minLengthErrorMessage;\nsetToDefaultLocale(minLength);\n"]}
1
+ {"version":3,"sources":["/home/runner/work/bguard/bguard/lib/asserts/string/minLength.js","../../../src/asserts/string/minLength.ts"],"names":[],"mappings":"AAAA;AACE;AACF,0DAAgC;AAChC,mCAAgC;AAChC;AACA;ACFA,IAAM,sBAAA,EAAwB,iDAAA;AAC9B,IAAM,kBAAA,EAAoB,aAAA;AAcnB,IAAM,UAAA,EACX,CAAC,QAAA,EAAA,GACD,CAAC,QAAA,EAAkB,GAAA,EAAA,GAA0B;AAC3C,EAAA,GAAA,CAAI,QAAA,CAAS,OAAA,EAAS,QAAA,EAAU,GAAA,CAAI,QAAA,CAAS,QAAA,EAAU,QAAA,EAAU,qBAAqB,CAAA;AACxF,CAAA;AAEF,SAAA,CAAU,IAAA,EAAM,iBAAA;AAChB,SAAA,CAAU,QAAA,EAAU,qBAAA;AACpB,iDAAA,SAA4B,CAAA;ADZ5B;AACE;AACF,8BAAC","file":"/home/runner/work/bguard/bguard/lib/asserts/string/minLength.js","sourcesContent":[null,"import { ExceptionContext, RequiredValidation } from '../../ExceptionContext';\nimport { setToDefaultLocale } from '../../translationMap';\n\nconst minLengthErrorMessage = 'The received value length is less than expected';\nconst minLengthErrorKey = 's:minLength';\n\n/**\n * @description Asserts that the length of a string value is not less than a specified minimum length.\n * @param {number} expected The minimum required length for the string.\n * @returns {RequiredValidation} A validation function that takes a received string 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 = string().custom(minLength(5));\n * parseOrFail(schema, 'short'); // Throws an error: 'The received value length is less than expected'\n * parseOrFail(schema, 'adequate'); // Valid\n *\n * @translation Error Translation Key = 's:minLength'\n */\nexport const minLength =\n (expected: number): RequiredValidation =>\n (received: string, ctx: ExceptionContext) => {\n if (received.length < expected) ctx.addIssue(expected, received, minLengthErrorMessage);\n };\n\nminLength.key = minLengthErrorKey;\nminLength.message = minLengthErrorMessage;\nsetToDefaultLocale(minLength);\n"]}
@@ -1,15 +1,13 @@
1
1
  import {
2
2
  setToDefaultLocale
3
- } from "../../chunk-H32B3NHW.mjs";
4
- import {
5
- guardException
6
- } from "../../chunk-FGZKNBDP.mjs";
3
+ } from "../../chunk-QWPHP26D.mjs";
4
+ import "../../chunk-ZTCXXAKD.mjs";
7
5
 
8
6
  // src/asserts/string/minLength.ts
9
7
  var minLengthErrorMessage = "The received value length is less than expected";
10
8
  var minLengthErrorKey = "s:minLength";
11
9
  var minLength = (expected) => (received, ctx) => {
12
- if (received.length < expected) guardException(expected, received, ctx, minLengthErrorMessage);
10
+ if (received.length < expected) ctx.addIssue(expected, received, minLengthErrorMessage);
13
11
  };
14
12
  minLength.key = minLengthErrorKey;
15
13
  minLength.message = minLengthErrorMessage;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/asserts/string/minLength.ts"],"sourcesContent":["import { guardException } from '../../exceptions';\nimport { ExceptionContext, RequiredValidation } from '../../commonTypes';\nimport { setToDefaultLocale } from '../../translationMap';\n\nconst minLengthErrorMessage = 'The received value length is less than expected';\nconst minLengthErrorKey = 's:minLength';\n\n/**\n * @description Asserts that the length of a string value is not less than a specified minimum length.\n * @param {number} expected The minimum required length for the string.\n * @returns {RequiredValidation} A validation function that takes a received string 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 = string().custom(minLength(5));\n * parseOrFail(schema, 'short'); // Throws an error: 'The received value length is less than expected'\n * parseOrFail(schema, 'adequate'); // Valid\n *\n * @translation Error Translation Key = 's:minLength'\n */\nexport const minLength =\n (expected: number): RequiredValidation =>\n (received: string, ctx: ExceptionContext) => {\n if (received.length < expected) guardException(expected, received, ctx, minLengthErrorMessage);\n };\n\nminLength.key = minLengthErrorKey;\nminLength.message = minLengthErrorMessage;\nsetToDefaultLocale(minLength);\n"],"mappings":";;;;;;;;AAIA,IAAM,wBAAwB;AAC9B,IAAM,oBAAoB;AAcnB,IAAM,YACX,CAAC,aACD,CAAC,UAAkB,QAA0B;AAC3C,MAAI,SAAS,SAAS,SAAU,gBAAe,UAAU,UAAU,KAAK,qBAAqB;AAC/F;AAEF,UAAU,MAAM;AAChB,UAAU,UAAU;AACpB,mBAAmB,SAAS;","names":[]}
1
+ {"version":3,"sources":["../../../src/asserts/string/minLength.ts"],"sourcesContent":["import { ExceptionContext, RequiredValidation } from '../../ExceptionContext';\nimport { setToDefaultLocale } from '../../translationMap';\n\nconst minLengthErrorMessage = 'The received value length is less than expected';\nconst minLengthErrorKey = 's:minLength';\n\n/**\n * @description Asserts that the length of a string value is not less than a specified minimum length.\n * @param {number} expected The minimum required length for the string.\n * @returns {RequiredValidation} A validation function that takes a received string 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 = string().custom(minLength(5));\n * parseOrFail(schema, 'short'); // Throws an error: 'The received value length is less than expected'\n * parseOrFail(schema, 'adequate'); // Valid\n *\n * @translation Error Translation Key = 's:minLength'\n */\nexport const minLength =\n (expected: number): RequiredValidation =>\n (received: string, ctx: ExceptionContext) => {\n if (received.length < expected) ctx.addIssue(expected, received, minLengthErrorMessage);\n };\n\nminLength.key = minLengthErrorKey;\nminLength.message = minLengthErrorMessage;\nsetToDefaultLocale(minLength);\n"],"mappings":";;;;;;AAGA,IAAM,wBAAwB;AAC9B,IAAM,oBAAoB;AAcnB,IAAM,YACX,CAAC,aACD,CAAC,UAAkB,QAA0B;AAC3C,MAAI,SAAS,SAAS,SAAU,KAAI,SAAS,UAAU,UAAU,qBAAqB;AACxF;AAEF,UAAU,MAAM;AAChB,UAAU,UAAU;AACpB,mBAAmB,SAAS;","names":[]}
@@ -1,4 +1,5 @@
1
- import { RequiredValidation } from '../../commonTypes.mjs';
1
+ import { RequiredValidation } from '../../ExceptionContext.mjs';
2
+ import '../../commonTypes.mjs';
2
3
 
3
4
  /**
4
5
  * @description Asserts that a string value matches a specified regular expression pattern.
@@ -1,4 +1,5 @@
1
- import { RequiredValidation } from '../../commonTypes.js';
1
+ import { RequiredValidation } from '../../ExceptionContext.js';
2
+ import '../../commonTypes.js';
2
3
 
3
4
  /**
4
5
  * @description Asserts that a string value matches a specified regular expression pattern.
@@ -1,19 +1,17 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunk5YYRBKDPjs = require('../../chunk-5YYRBKDP.js');
4
-
5
-
6
- var _chunk5P6AZJCNjs = require('../../chunk-5P6AZJCN.js');
3
+ var _chunkEXVTHIT5js = require('../../chunk-EXVTHIT5.js');
4
+ require('../../chunk-FIDPCCCW.js');
7
5
 
8
6
  // src/asserts/string/regExp.ts
9
7
  var regExpErrorMessage = "The received value does not match the required text pattern";
10
8
  var regExpErrorKey = "s:regExp";
11
9
  var regExp = (expected) => (received, ctx) => {
12
- if (!expected.test(received)) _chunk5P6AZJCNjs.guardException.call(void 0, expected, received, ctx, regExpErrorMessage);
10
+ if (!expected.test(received)) ctx.addIssue(expected, received, regExpErrorMessage);
13
11
  };
14
12
  regExp.key = regExpErrorKey;
15
13
  regExp.message = regExpErrorMessage;
16
- _chunk5YYRBKDPjs.setToDefaultLocale.call(void 0, regExp);
14
+ _chunkEXVTHIT5js.setToDefaultLocale.call(void 0, regExp);
17
15
 
18
16
 
19
17
  exports.regExp = regExp;
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/bguard/bguard/lib/asserts/string/regExp.js","../../../src/asserts/string/regExp.ts"],"names":[],"mappings":"AAAA;AACE;AACF,0DAAgC;AAChC;AACE;AACF,0DAAgC;AAChC;AACA;ACHA,IAAM,mBAAA,EAAqB,6DAAA;AAC3B,IAAM,eAAA,EAAiB,UAAA;AAchB,IAAM,OAAA,EACX,CAAC,QAAA,EAAA,GACD,CAAC,QAAA,EAAkB,GAAA,EAAA,GAA0B;AAC3C,EAAA,GAAA,CAAI,CAAC,QAAA,CAAS,IAAA,CAAK,QAAQ,CAAA,EAAG,6CAAA,QAAe,EAAU,QAAA,EAAU,GAAA,EAAK,kBAAkB,CAAA;AAC1F,CAAA;AAEF,MAAA,CAAO,IAAA,EAAM,cAAA;AACb,MAAA,CAAO,QAAA,EAAU,kBAAA;AACjB,iDAAA,MAAyB,CAAA;ADXzB;AACE;AACF,wBAAC","file":"/home/runner/work/bguard/bguard/lib/asserts/string/regExp.js","sourcesContent":[null,"import { ExceptionContext, RequiredValidation } from '../../commonTypes';\nimport { guardException } from '../../exceptions';\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 =\n (expected: RegExp): RequiredValidation =>\n (received: string, ctx: ExceptionContext) => {\n if (!expected.test(received)) guardException(expected, received, ctx, regExpErrorMessage);\n };\n\nregExp.key = regExpErrorKey;\nregExp.message = regExpErrorMessage;\nsetToDefaultLocale(regExp);\n"]}
1
+ {"version":3,"sources":["/home/runner/work/bguard/bguard/lib/asserts/string/regExp.js","../../../src/asserts/string/regExp.ts"],"names":[],"mappings":"AAAA;AACE;AACF,0DAAgC;AAChC,mCAAgC;AAChC;AACA;ACFA,IAAM,mBAAA,EAAqB,6DAAA;AAC3B,IAAM,eAAA,EAAiB,UAAA;AAchB,IAAM,OAAA,EACX,CAAC,QAAA,EAAA,GACD,CAAC,QAAA,EAAkB,GAAA,EAAA,GAA0B;AAC3C,EAAA,GAAA,CAAI,CAAC,QAAA,CAAS,IAAA,CAAK,QAAQ,CAAA,EAAG,GAAA,CAAI,QAAA,CAAS,QAAA,EAAU,QAAA,EAAU,kBAAkB,CAAA;AACnF,CAAA;AAEF,MAAA,CAAO,IAAA,EAAM,cAAA;AACb,MAAA,CAAO,QAAA,EAAU,kBAAA;AACjB,iDAAA,MAAyB,CAAA;ADZzB;AACE;AACF,wBAAC","file":"/home/runner/work/bguard/bguard/lib/asserts/string/regExp.js","sourcesContent":[null,"import { ExceptionContext, RequiredValidation } from '../../ExceptionContext';\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 =\n (expected: RegExp): RequiredValidation =>\n (received: string, ctx: ExceptionContext) => {\n if (!expected.test(received)) ctx.addIssue(expected, received, regExpErrorMessage);\n };\n\nregExp.key = regExpErrorKey;\nregExp.message = regExpErrorMessage;\nsetToDefaultLocale(regExp);\n"]}
@@ -1,15 +1,13 @@
1
1
  import {
2
2
  setToDefaultLocale
3
- } from "../../chunk-H32B3NHW.mjs";
4
- import {
5
- guardException
6
- } from "../../chunk-FGZKNBDP.mjs";
3
+ } from "../../chunk-QWPHP26D.mjs";
4
+ import "../../chunk-ZTCXXAKD.mjs";
7
5
 
8
6
  // src/asserts/string/regExp.ts
9
7
  var regExpErrorMessage = "The received value does not match the required text pattern";
10
8
  var regExpErrorKey = "s:regExp";
11
9
  var regExp = (expected) => (received, ctx) => {
12
- if (!expected.test(received)) guardException(expected, received, ctx, regExpErrorMessage);
10
+ if (!expected.test(received)) ctx.addIssue(expected, received, regExpErrorMessage);
13
11
  };
14
12
  regExp.key = regExpErrorKey;
15
13
  regExp.message = regExpErrorMessage;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/asserts/string/regExp.ts"],"sourcesContent":["import { ExceptionContext, RequiredValidation } from '../../commonTypes';\nimport { guardException } from '../../exceptions';\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 =\n (expected: RegExp): RequiredValidation =>\n (received: string, ctx: ExceptionContext) => {\n if (!expected.test(received)) guardException(expected, received, ctx, regExpErrorMessage);\n };\n\nregExp.key = regExpErrorKey;\nregExp.message = regExpErrorMessage;\nsetToDefaultLocale(regExp);\n"],"mappings":";;;;;;;;AAIA,IAAM,qBAAqB;AAC3B,IAAM,iBAAiB;AAchB,IAAM,SACX,CAAC,aACD,CAAC,UAAkB,QAA0B;AAC3C,MAAI,CAAC,SAAS,KAAK,QAAQ,EAAG,gBAAe,UAAU,UAAU,KAAK,kBAAkB;AAC1F;AAEF,OAAO,MAAM;AACb,OAAO,UAAU;AACjB,mBAAmB,MAAM;","names":[]}
1
+ {"version":3,"sources":["../../../src/asserts/string/regExp.ts"],"sourcesContent":["import { ExceptionContext, RequiredValidation } from '../../ExceptionContext';\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 =\n (expected: RegExp): RequiredValidation =>\n (received: string, ctx: ExceptionContext) => {\n if (!expected.test(received)) ctx.addIssue(expected, received, regExpErrorMessage);\n };\n\nregExp.key = regExpErrorKey;\nregExp.message = regExpErrorMessage;\nsetToDefaultLocale(regExp);\n"],"mappings":";;;;;;AAGA,IAAM,qBAAqB;AAC3B,IAAM,iBAAiB;AAchB,IAAM,SACX,CAAC,aACD,CAAC,UAAkB,QAA0B;AAC3C,MAAI,CAAC,SAAS,KAAK,QAAQ,EAAG,KAAI,SAAS,UAAU,UAAU,kBAAkB;AACnF;AAEF,OAAO,MAAM;AACb,OAAO,UAAU;AACjB,mBAAmB,MAAM;","names":[]}
@@ -1,4 +1,5 @@
1
- import { RequiredValidation } from '../../commonTypes.mjs';
1
+ import { RequiredValidation } from '../../ExceptionContext.mjs';
2
+ import '../../commonTypes.mjs';
2
3
 
3
4
  /**
4
5
  * @description Asserts that a string value starts with a specified substring.
@@ -1,4 +1,5 @@
1
- import { RequiredValidation } from '../../commonTypes.js';
1
+ import { RequiredValidation } from '../../ExceptionContext.js';
2
+ import '../../commonTypes.js';
2
3
 
3
4
  /**
4
5
  * @description Asserts that a string value starts with a specified substring.
@@ -1,21 +1,19 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunk5YYRBKDPjs = require('../../chunk-5YYRBKDP.js');
4
-
5
-
6
- var _chunk5P6AZJCNjs = require('../../chunk-5P6AZJCN.js');
3
+ var _chunkEXVTHIT5js = require('../../chunk-EXVTHIT5.js');
4
+ require('../../chunk-FIDPCCCW.js');
7
5
 
8
6
  // src/asserts/string/startsWith.ts
9
7
  var startsWithErrorMessage = "The received value does not start with the required substring";
10
8
  var startsWithErrorKey = "s:startsWith";
11
9
  var startsWith = (substring) => (received, ctx) => {
12
10
  if (!received.startsWith(substring)) {
13
- _chunk5P6AZJCNjs.guardException.call(void 0, `starts with '${substring}'`, received, ctx, startsWithErrorKey);
11
+ ctx.addIssue(`starts with '${substring}'`, received, startsWithErrorKey);
14
12
  }
15
13
  };
16
14
  startsWith.key = startsWithErrorKey;
17
15
  startsWith.message = startsWithErrorMessage;
18
- _chunk5YYRBKDPjs.setToDefaultLocale.call(void 0, startsWith);
16
+ _chunkEXVTHIT5js.setToDefaultLocale.call(void 0, startsWith);
19
17
 
20
18
 
21
19
  exports.startsWith = startsWith;
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/bguard/bguard/lib/asserts/string/startsWith.js","../../../src/asserts/string/startsWith.ts"],"names":[],"mappings":"AAAA;AACE;AACF,0DAAgC;AAChC;AACE;AACF,0DAAgC;AAChC;AACA;ACHA,IAAM,uBAAA,EAAyB,+DAAA;AAC/B,IAAM,mBAAA,EAAqB,cAAA;AAcpB,IAAM,WAAA,EACX,CAAC,SAAA,EAAA,GACD,CAAC,QAAA,EAAkB,GAAA,EAAA,GAA0B;AAC3C,EAAA,GAAA,CAAI,CAAC,QAAA,CAAS,UAAA,CAAW,SAAS,CAAA,EAAG;AACnC,IAAA,6CAAA,CAAe,aAAA,EAAgB,SAAS,CAAA,CAAA,CAAA,EAAK,QAAA,EAAU,GAAA,EAAK,kBAAkB,CAAA;AAAA,EAChF;AACF,CAAA;AAEF,UAAA,CAAW,IAAA,EAAM,kBAAA;AACjB,UAAA,CAAW,QAAA,EAAU,sBAAA;AACrB,iDAAA,UAA6B,CAAA;ADX7B;AACE;AACF,gCAAC","file":"/home/runner/work/bguard/bguard/lib/asserts/string/startsWith.js","sourcesContent":[null,"import { guardException } from '../../exceptions';\nimport { ExceptionContext, RequiredValidation } from '../../commonTypes';\nimport { setToDefaultLocale } from '../../translationMap';\n\nconst startsWithErrorMessage = 'The received value does not start with the required substring';\nconst startsWithErrorKey = 's:startsWith';\n\n/**\n * @description Asserts that a string value starts with a specified substring.\n * @param {string} substring The substring that the string value must start 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 start with the required substring.\n * @example\n * const schema = string().custom(startsWith('foo'));\n * parseOrFail(schema, 'foobar'); // Valid\n * parseOrFail(schema, 'barfoo'); // Throws an error: 'The received value does not start with the required substring'\n *\n * @translation Error Translation Key = 's:startsWith'\n */\nexport const startsWith =\n (substring: string): RequiredValidation =>\n (received: string, ctx: ExceptionContext) => {\n if (!received.startsWith(substring)) {\n guardException(`starts with '${substring}'`, received, ctx, startsWithErrorKey);\n }\n };\n\nstartsWith.key = startsWithErrorKey;\nstartsWith.message = startsWithErrorMessage;\nsetToDefaultLocale(startsWith);\n"]}
1
+ {"version":3,"sources":["/home/runner/work/bguard/bguard/lib/asserts/string/startsWith.js","../../../src/asserts/string/startsWith.ts"],"names":[],"mappings":"AAAA;AACE;AACF,0DAAgC;AAChC,mCAAgC;AAChC;AACA;ACFA,IAAM,uBAAA,EAAyB,+DAAA;AAC/B,IAAM,mBAAA,EAAqB,cAAA;AAcpB,IAAM,WAAA,EACX,CAAC,SAAA,EAAA,GACD,CAAC,QAAA,EAAkB,GAAA,EAAA,GAA0B;AAC3C,EAAA,GAAA,CAAI,CAAC,QAAA,CAAS,UAAA,CAAW,SAAS,CAAA,EAAG;AACnC,IAAA,GAAA,CAAI,QAAA,CAAS,CAAA,aAAA,EAAgB,SAAS,CAAA,CAAA,CAAA,EAAK,QAAA,EAAU,kBAAkB,CAAA;AAAA,EACzE;AACF,CAAA;AAEF,UAAA,CAAW,IAAA,EAAM,kBAAA;AACjB,UAAA,CAAW,QAAA,EAAU,sBAAA;AACrB,iDAAA,UAA6B,CAAA;ADZ7B;AACE;AACF,gCAAC","file":"/home/runner/work/bguard/bguard/lib/asserts/string/startsWith.js","sourcesContent":[null,"import { ExceptionContext, RequiredValidation } from '../../ExceptionContext';\nimport { setToDefaultLocale } from '../../translationMap';\n\nconst startsWithErrorMessage = 'The received value does not start with the required substring';\nconst startsWithErrorKey = 's:startsWith';\n\n/**\n * @description Asserts that a string value starts with a specified substring.\n * @param {string} substring The substring that the string value must start 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 start with the required substring.\n * @example\n * const schema = string().custom(startsWith('foo'));\n * parseOrFail(schema, 'foobar'); // Valid\n * parseOrFail(schema, 'barfoo'); // Throws an error: 'The received value does not start with the required substring'\n *\n * @translation Error Translation Key = 's:startsWith'\n */\nexport const startsWith =\n (substring: string): RequiredValidation =>\n (received: string, ctx: ExceptionContext) => {\n if (!received.startsWith(substring)) {\n ctx.addIssue(`starts with '${substring}'`, received, startsWithErrorKey);\n }\n };\n\nstartsWith.key = startsWithErrorKey;\nstartsWith.message = startsWithErrorMessage;\nsetToDefaultLocale(startsWith);\n"]}
@@ -1,16 +1,14 @@
1
1
  import {
2
2
  setToDefaultLocale
3
- } from "../../chunk-H32B3NHW.mjs";
4
- import {
5
- guardException
6
- } from "../../chunk-FGZKNBDP.mjs";
3
+ } from "../../chunk-QWPHP26D.mjs";
4
+ import "../../chunk-ZTCXXAKD.mjs";
7
5
 
8
6
  // src/asserts/string/startsWith.ts
9
7
  var startsWithErrorMessage = "The received value does not start with the required substring";
10
8
  var startsWithErrorKey = "s:startsWith";
11
9
  var startsWith = (substring) => (received, ctx) => {
12
10
  if (!received.startsWith(substring)) {
13
- guardException(`starts with '${substring}'`, received, ctx, startsWithErrorKey);
11
+ ctx.addIssue(`starts with '${substring}'`, received, startsWithErrorKey);
14
12
  }
15
13
  };
16
14
  startsWith.key = startsWithErrorKey;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/asserts/string/startsWith.ts"],"sourcesContent":["import { guardException } from '../../exceptions';\nimport { ExceptionContext, RequiredValidation } from '../../commonTypes';\nimport { setToDefaultLocale } from '../../translationMap';\n\nconst startsWithErrorMessage = 'The received value does not start with the required substring';\nconst startsWithErrorKey = 's:startsWith';\n\n/**\n * @description Asserts that a string value starts with a specified substring.\n * @param {string} substring The substring that the string value must start 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 start with the required substring.\n * @example\n * const schema = string().custom(startsWith('foo'));\n * parseOrFail(schema, 'foobar'); // Valid\n * parseOrFail(schema, 'barfoo'); // Throws an error: 'The received value does not start with the required substring'\n *\n * @translation Error Translation Key = 's:startsWith'\n */\nexport const startsWith =\n (substring: string): RequiredValidation =>\n (received: string, ctx: ExceptionContext) => {\n if (!received.startsWith(substring)) {\n guardException(`starts with '${substring}'`, received, ctx, startsWithErrorKey);\n }\n };\n\nstartsWith.key = startsWithErrorKey;\nstartsWith.message = startsWithErrorMessage;\nsetToDefaultLocale(startsWith);\n"],"mappings":";;;;;;;;AAIA,IAAM,yBAAyB;AAC/B,IAAM,qBAAqB;AAcpB,IAAM,aACX,CAAC,cACD,CAAC,UAAkB,QAA0B;AAC3C,MAAI,CAAC,SAAS,WAAW,SAAS,GAAG;AACnC,mBAAe,gBAAgB,SAAS,KAAK,UAAU,KAAK,kBAAkB;AAAA,EAChF;AACF;AAEF,WAAW,MAAM;AACjB,WAAW,UAAU;AACrB,mBAAmB,UAAU;","names":[]}
1
+ {"version":3,"sources":["../../../src/asserts/string/startsWith.ts"],"sourcesContent":["import { ExceptionContext, RequiredValidation } from '../../ExceptionContext';\nimport { setToDefaultLocale } from '../../translationMap';\n\nconst startsWithErrorMessage = 'The received value does not start with the required substring';\nconst startsWithErrorKey = 's:startsWith';\n\n/**\n * @description Asserts that a string value starts with a specified substring.\n * @param {string} substring The substring that the string value must start 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 start with the required substring.\n * @example\n * const schema = string().custom(startsWith('foo'));\n * parseOrFail(schema, 'foobar'); // Valid\n * parseOrFail(schema, 'barfoo'); // Throws an error: 'The received value does not start with the required substring'\n *\n * @translation Error Translation Key = 's:startsWith'\n */\nexport const startsWith =\n (substring: string): RequiredValidation =>\n (received: string, ctx: ExceptionContext) => {\n if (!received.startsWith(substring)) {\n ctx.addIssue(`starts with '${substring}'`, received, startsWithErrorKey);\n }\n };\n\nstartsWith.key = startsWithErrorKey;\nstartsWith.message = startsWithErrorMessage;\nsetToDefaultLocale(startsWith);\n"],"mappings":";;;;;;AAGA,IAAM,yBAAyB;AAC/B,IAAM,qBAAqB;AAcpB,IAAM,aACX,CAAC,cACD,CAAC,UAAkB,QAA0B;AAC3C,MAAI,CAAC,SAAS,WAAW,SAAS,GAAG;AACnC,QAAI,SAAS,gBAAgB,SAAS,KAAK,UAAU,kBAAkB;AAAA,EACzE;AACF;AAEF,WAAW,MAAM;AACjB,WAAW,UAAU;AACrB,mBAAmB,UAAU;","names":[]}
@@ -1,4 +1,5 @@
1
- import { RequiredValidation } from '../../commonTypes.mjs';
1
+ import { RequiredValidation } from '../../ExceptionContext.mjs';
2
+ import '../../commonTypes.mjs';
2
3
 
3
4
  /**
4
5
  * @description Asserts that a string value is entirely in uppercase.
@@ -1,4 +1,5 @@
1
- import { RequiredValidation } from '../../commonTypes.js';
1
+ import { RequiredValidation } from '../../ExceptionContext.js';
2
+ import '../../commonTypes.js';
2
3
 
3
4
  /**
4
5
  * @description Asserts that a string value is entirely in uppercase.
@@ -1,21 +1,19 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunk5YYRBKDPjs = require('../../chunk-5YYRBKDP.js');
4
-
5
-
6
- var _chunk5P6AZJCNjs = require('../../chunk-5P6AZJCN.js');
3
+ var _chunkEXVTHIT5js = require('../../chunk-EXVTHIT5.js');
4
+ require('../../chunk-FIDPCCCW.js');
7
5
 
8
6
  // src/asserts/string/upperCase.ts
9
7
  var upperCaseErrorMessage = "The received value is not in uppercase";
10
8
  var upperCaseErrorKey = "s:upperCase";
11
9
  var upperCase = () => (received, ctx) => {
12
10
  if (received !== received.toUpperCase()) {
13
- _chunk5P6AZJCNjs.guardException.call(void 0, "upper case", received, ctx, upperCaseErrorKey);
11
+ ctx.addIssue("upper case", received, upperCaseErrorKey);
14
12
  }
15
13
  };
16
14
  upperCase.key = upperCaseErrorKey;
17
15
  upperCase.message = upperCaseErrorMessage;
18
- _chunk5YYRBKDPjs.setToDefaultLocale.call(void 0, upperCase);
16
+ _chunkEXVTHIT5js.setToDefaultLocale.call(void 0, upperCase);
19
17
 
20
18
 
21
19
  exports.upperCase = upperCase;
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/bguard/bguard/lib/asserts/string/upperCase.js","../../../src/asserts/string/upperCase.ts"],"names":[],"mappings":"AAAA;AACE;AACF,0DAAgC;AAChC;AACE;AACF,0DAAgC;AAChC;AACA;ACHA,IAAM,sBAAA,EAAwB,wCAAA;AAC9B,IAAM,kBAAA,EAAoB,aAAA;AAcnB,IAAM,UAAA,EAAY,CAAA,EAAA,GAA0B,CAAC,QAAA,EAAkB,GAAA,EAAA,GAA0B;AAC9F,EAAA,GAAA,CAAI,SAAA,IAAa,QAAA,CAAS,WAAA,CAAY,CAAA,EAAG;AACvC,IAAA,6CAAA,YAAe,EAAc,QAAA,EAAU,GAAA,EAAK,iBAAiB,CAAA;AAAA,EAC/D;AACF,CAAA;AAEA,SAAA,CAAU,IAAA,EAAM,iBAAA;AAChB,SAAA,CAAU,QAAA,EAAU,qBAAA;AACpB,iDAAA,SAA4B,CAAA;ADT5B;AACE;AACF,8BAAC","file":"/home/runner/work/bguard/bguard/lib/asserts/string/upperCase.js","sourcesContent":[null,"import { guardException } from '../../exceptions';\nimport { ExceptionContext, RequiredValidation } from '../../commonTypes';\nimport { setToDefaultLocale } from '../../translationMap';\n\nconst upperCaseErrorMessage = 'The received value is not in uppercase';\nconst upperCaseErrorKey = 's:upperCase';\n\n/**\n * @description Asserts that a string value is entirely in uppercase.\n * @returns {RequiredValidation} A validation function that takes a received string and an exception context.\n * @throws {ValidationError} if the received value is not in uppercase.\n * @example\n * const schema = string().custom(upperCase());\n * parseOrFail(schema, 'VALID'); // Valid\n * parseOrFail(schema, 'INVALID'); // Throws an error: 'The received value is not in uppercase'\n * parseOrFail(schema, 'Valid'); // Throws an error: 'The received value is not in uppercase'\n *\n * @translation Error Translation Key = 's:upperCase'\n */\nexport const upperCase = (): RequiredValidation => (received: string, ctx: ExceptionContext) => {\n if (received !== received.toUpperCase()) {\n guardException('upper case', received, ctx, upperCaseErrorKey);\n }\n};\n\nupperCase.key = upperCaseErrorKey;\nupperCase.message = upperCaseErrorMessage;\nsetToDefaultLocale(upperCase);\n"]}
1
+ {"version":3,"sources":["/home/runner/work/bguard/bguard/lib/asserts/string/upperCase.js","../../../src/asserts/string/upperCase.ts"],"names":[],"mappings":"AAAA;AACE;AACF,0DAAgC;AAChC,mCAAgC;AAChC;AACA;ACFA,IAAM,sBAAA,EAAwB,wCAAA;AAC9B,IAAM,kBAAA,EAAoB,aAAA;AAcnB,IAAM,UAAA,EAAY,CAAA,EAAA,GAA0B,CAAC,QAAA,EAAkB,GAAA,EAAA,GAA0B;AAC9F,EAAA,GAAA,CAAI,SAAA,IAAa,QAAA,CAAS,WAAA,CAAY,CAAA,EAAG;AACvC,IAAA,GAAA,CAAI,QAAA,CAAS,YAAA,EAAc,QAAA,EAAU,iBAAiB,CAAA;AAAA,EACxD;AACF,CAAA;AAEA,SAAA,CAAU,IAAA,EAAM,iBAAA;AAChB,SAAA,CAAU,QAAA,EAAU,qBAAA;AACpB,iDAAA,SAA4B,CAAA;ADV5B;AACE;AACF,8BAAC","file":"/home/runner/work/bguard/bguard/lib/asserts/string/upperCase.js","sourcesContent":[null,"import { ExceptionContext, RequiredValidation } from '../../ExceptionContext';\nimport { setToDefaultLocale } from '../../translationMap';\n\nconst upperCaseErrorMessage = 'The received value is not in uppercase';\nconst upperCaseErrorKey = 's:upperCase';\n\n/**\n * @description Asserts that a string value is entirely in uppercase.\n * @returns {RequiredValidation} A validation function that takes a received string and an exception context.\n * @throws {ValidationError} if the received value is not in uppercase.\n * @example\n * const schema = string().custom(upperCase());\n * parseOrFail(schema, 'VALID'); // Valid\n * parseOrFail(schema, 'INVALID'); // Throws an error: 'The received value is not in uppercase'\n * parseOrFail(schema, 'Valid'); // Throws an error: 'The received value is not in uppercase'\n *\n * @translation Error Translation Key = 's:upperCase'\n */\nexport const upperCase = (): RequiredValidation => (received: string, ctx: ExceptionContext) => {\n if (received !== received.toUpperCase()) {\n ctx.addIssue('upper case', received, upperCaseErrorKey);\n }\n};\n\nupperCase.key = upperCaseErrorKey;\nupperCase.message = upperCaseErrorMessage;\nsetToDefaultLocale(upperCase);\n"]}
@@ -1,16 +1,14 @@
1
1
  import {
2
2
  setToDefaultLocale
3
- } from "../../chunk-H32B3NHW.mjs";
4
- import {
5
- guardException
6
- } from "../../chunk-FGZKNBDP.mjs";
3
+ } from "../../chunk-QWPHP26D.mjs";
4
+ import "../../chunk-ZTCXXAKD.mjs";
7
5
 
8
6
  // src/asserts/string/upperCase.ts
9
7
  var upperCaseErrorMessage = "The received value is not in uppercase";
10
8
  var upperCaseErrorKey = "s:upperCase";
11
9
  var upperCase = () => (received, ctx) => {
12
10
  if (received !== received.toUpperCase()) {
13
- guardException("upper case", received, ctx, upperCaseErrorKey);
11
+ ctx.addIssue("upper case", received, upperCaseErrorKey);
14
12
  }
15
13
  };
16
14
  upperCase.key = upperCaseErrorKey;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/asserts/string/upperCase.ts"],"sourcesContent":["import { guardException } from '../../exceptions';\nimport { ExceptionContext, RequiredValidation } from '../../commonTypes';\nimport { setToDefaultLocale } from '../../translationMap';\n\nconst upperCaseErrorMessage = 'The received value is not in uppercase';\nconst upperCaseErrorKey = 's:upperCase';\n\n/**\n * @description Asserts that a string value is entirely in uppercase.\n * @returns {RequiredValidation} A validation function that takes a received string and an exception context.\n * @throws {ValidationError} if the received value is not in uppercase.\n * @example\n * const schema = string().custom(upperCase());\n * parseOrFail(schema, 'VALID'); // Valid\n * parseOrFail(schema, 'INVALID'); // Throws an error: 'The received value is not in uppercase'\n * parseOrFail(schema, 'Valid'); // Throws an error: 'The received value is not in uppercase'\n *\n * @translation Error Translation Key = 's:upperCase'\n */\nexport const upperCase = (): RequiredValidation => (received: string, ctx: ExceptionContext) => {\n if (received !== received.toUpperCase()) {\n guardException('upper case', received, ctx, upperCaseErrorKey);\n }\n};\n\nupperCase.key = upperCaseErrorKey;\nupperCase.message = upperCaseErrorMessage;\nsetToDefaultLocale(upperCase);\n"],"mappings":";;;;;;;;AAIA,IAAM,wBAAwB;AAC9B,IAAM,oBAAoB;AAcnB,IAAM,YAAY,MAA0B,CAAC,UAAkB,QAA0B;AAC9F,MAAI,aAAa,SAAS,YAAY,GAAG;AACvC,mBAAe,cAAc,UAAU,KAAK,iBAAiB;AAAA,EAC/D;AACF;AAEA,UAAU,MAAM;AAChB,UAAU,UAAU;AACpB,mBAAmB,SAAS;","names":[]}
1
+ {"version":3,"sources":["../../../src/asserts/string/upperCase.ts"],"sourcesContent":["import { ExceptionContext, RequiredValidation } from '../../ExceptionContext';\nimport { setToDefaultLocale } from '../../translationMap';\n\nconst upperCaseErrorMessage = 'The received value is not in uppercase';\nconst upperCaseErrorKey = 's:upperCase';\n\n/**\n * @description Asserts that a string value is entirely in uppercase.\n * @returns {RequiredValidation} A validation function that takes a received string and an exception context.\n * @throws {ValidationError} if the received value is not in uppercase.\n * @example\n * const schema = string().custom(upperCase());\n * parseOrFail(schema, 'VALID'); // Valid\n * parseOrFail(schema, 'INVALID'); // Throws an error: 'The received value is not in uppercase'\n * parseOrFail(schema, 'Valid'); // Throws an error: 'The received value is not in uppercase'\n *\n * @translation Error Translation Key = 's:upperCase'\n */\nexport const upperCase = (): RequiredValidation => (received: string, ctx: ExceptionContext) => {\n if (received !== received.toUpperCase()) {\n ctx.addIssue('upper case', received, upperCaseErrorKey);\n }\n};\n\nupperCase.key = upperCaseErrorKey;\nupperCase.message = upperCaseErrorMessage;\nsetToDefaultLocale(upperCase);\n"],"mappings":";;;;;;AAGA,IAAM,wBAAwB;AAC9B,IAAM,oBAAoB;AAcnB,IAAM,YAAY,MAA0B,CAAC,UAAkB,QAA0B;AAC9F,MAAI,aAAa,SAAS,YAAY,GAAG;AACvC,QAAI,SAAS,cAAc,UAAU,iBAAiB;AAAA,EACxD;AACF;AAEA,UAAU,MAAM;AAChB,UAAU,UAAU;AACpB,mBAAmB,SAAS;","names":[]}
@@ -1,4 +1,5 @@
1
- import { RequiredValidation } from '../../commonTypes.mjs';
1
+ import { RequiredValidation } from '../../ExceptionContext.mjs';
2
+ import '../../commonTypes.mjs';
2
3
 
3
4
  /**
4
5
  * @description Asserts that a string value matches the UUID format.
@@ -1,4 +1,5 @@
1
- import { RequiredValidation } from '../../commonTypes.js';
1
+ import { RequiredValidation } from '../../ExceptionContext.js';
2
+ import '../../commonTypes.js';
2
3
 
3
4
  /**
4
5
  * @description Asserts that a string value matches the UUID format.
@@ -1,9 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunk5YYRBKDPjs = require('../../chunk-5YYRBKDP.js');
4
-
5
-
6
- var _chunk5P6AZJCNjs = require('../../chunk-5P6AZJCN.js');
3
+ var _chunkEXVTHIT5js = require('../../chunk-EXVTHIT5.js');
4
+ require('../../chunk-FIDPCCCW.js');
7
5
 
8
6
  // src/asserts/string/uuid.ts
9
7
  var uuidErrorMessage = "The received value is not a valid UUID";
@@ -11,12 +9,12 @@ var uuidErrorKey = "s:uuid";
11
9
  var uuidPattern = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
12
10
  var uuid = () => (received, ctx) => {
13
11
  if (!uuidPattern.test(received)) {
14
- _chunk5P6AZJCNjs.guardException.call(void 0, "uuid", received, ctx, uuidErrorKey);
12
+ ctx.addIssue("uuid", received, uuidErrorKey);
15
13
  }
16
14
  };
17
15
  uuid.key = uuidErrorKey;
18
16
  uuid.message = uuidErrorMessage;
19
- _chunk5YYRBKDPjs.setToDefaultLocale.call(void 0, uuid);
17
+ _chunkEXVTHIT5js.setToDefaultLocale.call(void 0, uuid);
20
18
 
21
19
 
22
20
  exports.uuid = uuid;
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/bguard/bguard/lib/asserts/string/uuid.js","../../../src/asserts/string/uuid.ts"],"names":[],"mappings":"AAAA;AACE;AACF,0DAAgC;AAChC;AACE;AACF,0DAAgC;AAChC;AACA;ACHA,IAAM,iBAAA,EAAmB,wCAAA;AACzB,IAAM,aAAA,EAAe,QAAA;AAErB,IAAM,YAAA,EAAc,iEAAA;AAab,IAAM,KAAA,EAAO,CAAA,EAAA,GAA0B,CAAC,QAAA,EAAkB,GAAA,EAAA,GAA0B;AACzF,EAAA,GAAA,CAAI,CAAC,WAAA,CAAY,IAAA,CAAK,QAAQ,CAAA,EAAG;AAC/B,IAAA,6CAAA,MAAe,EAAQ,QAAA,EAAU,GAAA,EAAK,YAAY,CAAA;AAAA,EACpD;AACF,CAAA;AAEA,IAAA,CAAK,IAAA,EAAM,YAAA;AACX,IAAA,CAAK,QAAA,EAAU,gBAAA;AACf,iDAAA,IAAuB,CAAA;ADTvB;AACE;AACF,oBAAC","file":"/home/runner/work/bguard/bguard/lib/asserts/string/uuid.js","sourcesContent":[null,"import { guardException } from '../../exceptions';\nimport { ExceptionContext, RequiredValidation } from '../../commonTypes';\nimport { setToDefaultLocale } from '../../translationMap';\n\nconst uuidErrorMessage = 'The received value is not a valid UUID';\nconst uuidErrorKey = 's:uuid';\n\nconst uuidPattern = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;\n\n/**\n * @description Asserts that a string value matches the UUID 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.\n * @example\n * const schema = string().custom(uuid());\n * parseOrFail(schema, '123e4567-e89b-12d3-a456-426614174000'); // Valid\n * parseOrFail(schema, 'invalid-uuid'); // Throws an error: 'The received value is not a valid UUID'\n *\n * @translation Error Translation Key = 's:uuid'\n */\nexport const uuid = (): RequiredValidation => (received: string, ctx: ExceptionContext) => {\n if (!uuidPattern.test(received)) {\n guardException('uuid', received, ctx, uuidErrorKey);\n }\n};\n\nuuid.key = uuidErrorKey;\nuuid.message = uuidErrorMessage;\nsetToDefaultLocale(uuid);\n"]}
1
+ {"version":3,"sources":["/home/runner/work/bguard/bguard/lib/asserts/string/uuid.js","../../../src/asserts/string/uuid.ts"],"names":[],"mappings":"AAAA;AACE;AACF,0DAAgC;AAChC,mCAAgC;AAChC;AACA;ACFA,IAAM,iBAAA,EAAmB,wCAAA;AACzB,IAAM,aAAA,EAAe,QAAA;AAErB,IAAM,YAAA,EAAc,iEAAA;AAab,IAAM,KAAA,EAAO,CAAA,EAAA,GAA0B,CAAC,QAAA,EAAkB,GAAA,EAAA,GAA0B;AACzF,EAAA,GAAA,CAAI,CAAC,WAAA,CAAY,IAAA,CAAK,QAAQ,CAAA,EAAG;AAC/B,IAAA,GAAA,CAAI,QAAA,CAAS,MAAA,EAAQ,QAAA,EAAU,YAAY,CAAA;AAAA,EAC7C;AACF,CAAA;AAEA,IAAA,CAAK,IAAA,EAAM,YAAA;AACX,IAAA,CAAK,QAAA,EAAU,gBAAA;AACf,iDAAA,IAAuB,CAAA;ADVvB;AACE;AACF,oBAAC","file":"/home/runner/work/bguard/bguard/lib/asserts/string/uuid.js","sourcesContent":[null,"import { ExceptionContext, RequiredValidation } from '../../ExceptionContext';\nimport { setToDefaultLocale } from '../../translationMap';\n\nconst uuidErrorMessage = 'The received value is not a valid UUID';\nconst uuidErrorKey = 's:uuid';\n\nconst uuidPattern = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;\n\n/**\n * @description Asserts that a string value matches the UUID 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.\n * @example\n * const schema = string().custom(uuid());\n * parseOrFail(schema, '123e4567-e89b-12d3-a456-426614174000'); // Valid\n * parseOrFail(schema, 'invalid-uuid'); // Throws an error: 'The received value is not a valid UUID'\n *\n * @translation Error Translation Key = 's:uuid'\n */\nexport const uuid = (): RequiredValidation => (received: string, ctx: ExceptionContext) => {\n if (!uuidPattern.test(received)) {\n ctx.addIssue('uuid', received, uuidErrorKey);\n }\n};\n\nuuid.key = uuidErrorKey;\nuuid.message = uuidErrorMessage;\nsetToDefaultLocale(uuid);\n"]}
@@ -1,9 +1,7 @@
1
1
  import {
2
2
  setToDefaultLocale
3
- } from "../../chunk-H32B3NHW.mjs";
4
- import {
5
- guardException
6
- } from "../../chunk-FGZKNBDP.mjs";
3
+ } from "../../chunk-QWPHP26D.mjs";
4
+ import "../../chunk-ZTCXXAKD.mjs";
7
5
 
8
6
  // src/asserts/string/uuid.ts
9
7
  var uuidErrorMessage = "The received value is not a valid UUID";
@@ -11,7 +9,7 @@ var uuidErrorKey = "s:uuid";
11
9
  var uuidPattern = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
12
10
  var uuid = () => (received, ctx) => {
13
11
  if (!uuidPattern.test(received)) {
14
- guardException("uuid", received, ctx, uuidErrorKey);
12
+ ctx.addIssue("uuid", received, uuidErrorKey);
15
13
  }
16
14
  };
17
15
  uuid.key = uuidErrorKey;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/asserts/string/uuid.ts"],"sourcesContent":["import { guardException } from '../../exceptions';\nimport { ExceptionContext, RequiredValidation } from '../../commonTypes';\nimport { setToDefaultLocale } from '../../translationMap';\n\nconst uuidErrorMessage = 'The received value is not a valid UUID';\nconst uuidErrorKey = 's:uuid';\n\nconst uuidPattern = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;\n\n/**\n * @description Asserts that a string value matches the UUID 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.\n * @example\n * const schema = string().custom(uuid());\n * parseOrFail(schema, '123e4567-e89b-12d3-a456-426614174000'); // Valid\n * parseOrFail(schema, 'invalid-uuid'); // Throws an error: 'The received value is not a valid UUID'\n *\n * @translation Error Translation Key = 's:uuid'\n */\nexport const uuid = (): RequiredValidation => (received: string, ctx: ExceptionContext) => {\n if (!uuidPattern.test(received)) {\n guardException('uuid', received, ctx, uuidErrorKey);\n }\n};\n\nuuid.key = uuidErrorKey;\nuuid.message = uuidErrorMessage;\nsetToDefaultLocale(uuid);\n"],"mappings":";;;;;;;;AAIA,IAAM,mBAAmB;AACzB,IAAM,eAAe;AAErB,IAAM,cAAc;AAab,IAAM,OAAO,MAA0B,CAAC,UAAkB,QAA0B;AACzF,MAAI,CAAC,YAAY,KAAK,QAAQ,GAAG;AAC/B,mBAAe,QAAQ,UAAU,KAAK,YAAY;AAAA,EACpD;AACF;AAEA,KAAK,MAAM;AACX,KAAK,UAAU;AACf,mBAAmB,IAAI;","names":[]}
1
+ {"version":3,"sources":["../../../src/asserts/string/uuid.ts"],"sourcesContent":["import { ExceptionContext, RequiredValidation } from '../../ExceptionContext';\nimport { setToDefaultLocale } from '../../translationMap';\n\nconst uuidErrorMessage = 'The received value is not a valid UUID';\nconst uuidErrorKey = 's:uuid';\n\nconst uuidPattern = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;\n\n/**\n * @description Asserts that a string value matches the UUID 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.\n * @example\n * const schema = string().custom(uuid());\n * parseOrFail(schema, '123e4567-e89b-12d3-a456-426614174000'); // Valid\n * parseOrFail(schema, 'invalid-uuid'); // Throws an error: 'The received value is not a valid UUID'\n *\n * @translation Error Translation Key = 's:uuid'\n */\nexport const uuid = (): RequiredValidation => (received: string, ctx: ExceptionContext) => {\n if (!uuidPattern.test(received)) {\n ctx.addIssue('uuid', received, uuidErrorKey);\n }\n};\n\nuuid.key = uuidErrorKey;\nuuid.message = uuidErrorMessage;\nsetToDefaultLocale(uuid);\n"],"mappings":";;;;;;AAGA,IAAM,mBAAmB;AACzB,IAAM,eAAe;AAErB,IAAM,cAAc;AAab,IAAM,OAAO,MAA0B,CAAC,UAAkB,QAA0B;AACzF,MAAI,CAAC,YAAY,KAAK,QAAQ,GAAG;AAC/B,QAAI,SAAS,QAAQ,UAAU,YAAY;AAAA,EAC7C;AACF;AAEA,KAAK,MAAM;AACX,KAAK,UAAU;AACf,mBAAmB,IAAI;","names":[]}
@@ -1,4 +1,5 @@
1
- import { RequiredValidation } from '../../commonTypes.mjs';
1
+ import { RequiredValidation } from '../../ExceptionContext.mjs';
2
+ import '../../commonTypes.mjs';
2
3
 
3
4
  /**
4
5
  * @description Asserts that a string value matches the UUID v1 format.
@@ -1,4 +1,5 @@
1
- import { RequiredValidation } from '../../commonTypes.js';
1
+ import { RequiredValidation } from '../../ExceptionContext.js';
2
+ import '../../commonTypes.js';
2
3
 
3
4
  /**
4
5
  * @description Asserts that a string value matches the UUID v1 format.