bguard 0.3.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (290) hide show
  1. package/README.md +269 -121
  2. package/lib/CommonSchema-DOh3bsL-.d.ts +110 -0
  3. package/lib/CommonSchema-wi9MOXGF.d.mts +110 -0
  4. package/lib/InferType.d.mts +6 -14
  5. package/lib/InferType.d.ts +6 -14
  6. package/lib/asserts/array/index.d.mts +6 -5
  7. package/lib/asserts/array/index.d.ts +6 -5
  8. package/lib/asserts/array/index.js +7 -7
  9. package/lib/asserts/array/index.js.map +1 -1
  10. package/lib/asserts/array/index.mjs +6 -6
  11. package/lib/asserts/array/index.mjs.map +1 -1
  12. package/lib/asserts/array/maxArrayLength.js +4 -4
  13. package/lib/asserts/array/maxArrayLength.mjs +2 -2
  14. package/lib/asserts/array/minArrayLength.js +4 -4
  15. package/lib/asserts/array/minArrayLength.mjs +2 -2
  16. package/lib/asserts/bigint/bigintMax.js +4 -4
  17. package/lib/asserts/bigint/bigintMax.mjs +2 -2
  18. package/lib/asserts/bigint/bigintMaxExcluded.js +4 -4
  19. package/lib/asserts/bigint/bigintMaxExcluded.mjs +2 -2
  20. package/lib/asserts/bigint/bigintMin.js +4 -4
  21. package/lib/asserts/bigint/bigintMin.mjs +2 -2
  22. package/lib/asserts/bigint/bigintMinExcluded.js +4 -4
  23. package/lib/asserts/bigint/bigintMinExcluded.mjs +2 -2
  24. package/lib/asserts/bigint/index.d.mts +5 -4
  25. package/lib/asserts/bigint/index.d.ts +5 -4
  26. package/lib/asserts/bigint/index.js +10 -10
  27. package/lib/asserts/bigint/index.js.map +1 -1
  28. package/lib/asserts/bigint/index.mjs +9 -9
  29. package/lib/asserts/bigint/index.mjs.map +1 -1
  30. package/lib/asserts/boolean/index.d.mts +5 -4
  31. package/lib/asserts/boolean/index.d.ts +5 -4
  32. package/lib/asserts/boolean/index.js +8 -8
  33. package/lib/asserts/boolean/index.js.map +1 -1
  34. package/lib/asserts/boolean/index.mjs +7 -7
  35. package/lib/asserts/boolean/index.mjs.map +1 -1
  36. package/lib/asserts/date/dateMax.js +5 -5
  37. package/lib/asserts/date/dateMax.mjs +2 -2
  38. package/lib/asserts/date/dateMin.js +5 -5
  39. package/lib/asserts/date/dateMin.mjs +2 -2
  40. package/lib/asserts/date/index.d.mts +5 -4
  41. package/lib/asserts/date/index.d.ts +5 -4
  42. package/lib/asserts/date/index.js +7 -7
  43. package/lib/asserts/date/index.js.map +1 -1
  44. package/lib/asserts/date/index.mjs +6 -6
  45. package/lib/asserts/date/index.mjs.map +1 -1
  46. package/lib/asserts/mix/equalTo.js +4 -4
  47. package/lib/asserts/mix/equalTo.mjs +3 -3
  48. package/lib/asserts/mix/index.d.mts +5 -4
  49. package/lib/asserts/mix/index.d.ts +5 -4
  50. package/lib/asserts/mix/index.js +6 -6
  51. package/lib/asserts/mix/index.js.map +1 -1
  52. package/lib/asserts/mix/index.mjs +5 -5
  53. package/lib/asserts/mix/index.mjs.map +1 -1
  54. package/lib/asserts/mix/oneOfValues.js +4 -4
  55. package/lib/asserts/mix/oneOfValues.mjs +3 -3
  56. package/lib/asserts/number/index.d.mts +4 -3
  57. package/lib/asserts/number/index.d.ts +4 -3
  58. package/lib/asserts/number/index.js +10 -10
  59. package/lib/asserts/number/index.js.map +1 -1
  60. package/lib/asserts/number/index.mjs +9 -9
  61. package/lib/asserts/number/index.mjs.map +1 -1
  62. package/lib/asserts/number/max.js +4 -4
  63. package/lib/asserts/number/max.mjs +2 -2
  64. package/lib/asserts/number/maxExcluded.js +4 -4
  65. package/lib/asserts/number/maxExcluded.mjs +2 -2
  66. package/lib/asserts/number/min.js +4 -4
  67. package/lib/asserts/number/min.mjs +2 -2
  68. package/lib/asserts/number/minExcluded.js +4 -4
  69. package/lib/asserts/number/minExcluded.mjs +2 -2
  70. package/lib/asserts/number/negative.js +4 -4
  71. package/lib/asserts/number/negative.mjs +2 -2
  72. package/lib/asserts/number/positive.js +4 -4
  73. package/lib/asserts/number/positive.mjs +2 -2
  74. package/lib/asserts/object/index.d.mts +6 -5
  75. package/lib/asserts/object/index.d.ts +6 -5
  76. package/lib/asserts/object/index.js +7 -7
  77. package/lib/asserts/object/index.js.map +1 -1
  78. package/lib/asserts/object/index.mjs +6 -6
  79. package/lib/asserts/object/index.mjs.map +1 -1
  80. package/lib/asserts/object/maxKeys.d.mts +30 -0
  81. package/lib/asserts/object/maxKeys.d.ts +30 -0
  82. package/lib/asserts/object/maxKeys.js +23 -0
  83. package/lib/asserts/object/maxKeys.js.map +1 -0
  84. package/lib/asserts/object/maxKeys.mjs +23 -0
  85. package/lib/asserts/object/maxKeys.mjs.map +1 -0
  86. package/lib/asserts/string/atLeastOneDigit.js +4 -4
  87. package/lib/asserts/string/atLeastOneDigit.mjs +2 -2
  88. package/lib/asserts/string/atLeastOneLowerChar.js +4 -4
  89. package/lib/asserts/string/atLeastOneLowerChar.mjs +2 -2
  90. package/lib/asserts/string/atLeastOneSpecialChar.js +4 -4
  91. package/lib/asserts/string/atLeastOneSpecialChar.mjs +2 -2
  92. package/lib/asserts/string/atLeastOneUpperChar.js +4 -4
  93. package/lib/asserts/string/atLeastOneUpperChar.mjs +2 -2
  94. package/lib/asserts/string/contains.js +4 -4
  95. package/lib/asserts/string/contains.mjs +2 -2
  96. package/lib/asserts/string/email.js +4 -4
  97. package/lib/asserts/string/email.mjs +2 -2
  98. package/lib/asserts/string/endsWith.js +4 -4
  99. package/lib/asserts/string/endsWith.mjs +2 -2
  100. package/lib/asserts/string/index.d.mts +5 -4
  101. package/lib/asserts/string/index.d.ts +5 -4
  102. package/lib/asserts/string/index.js +10 -10
  103. package/lib/asserts/string/index.js.map +1 -1
  104. package/lib/asserts/string/index.mjs +9 -9
  105. package/lib/asserts/string/index.mjs.map +1 -1
  106. package/lib/asserts/string/isValidDate.js +4 -4
  107. package/lib/asserts/string/isValidDate.mjs +2 -2
  108. package/lib/asserts/string/isValidDateTime.js +4 -4
  109. package/lib/asserts/string/isValidDateTime.mjs +2 -2
  110. package/lib/asserts/string/isValidTime.js +5 -5
  111. package/lib/asserts/string/isValidTime.mjs +2 -2
  112. package/lib/asserts/string/lowerCase.js +4 -4
  113. package/lib/asserts/string/lowerCase.mjs +2 -2
  114. package/lib/asserts/string/maxLength.js +4 -4
  115. package/lib/asserts/string/maxLength.mjs +2 -2
  116. package/lib/asserts/string/minLength.js +4 -4
  117. package/lib/asserts/string/minLength.mjs +2 -2
  118. package/lib/asserts/string/regExp.js +4 -4
  119. package/lib/asserts/string/regExp.mjs +2 -2
  120. package/lib/asserts/string/startsWith.js +4 -4
  121. package/lib/asserts/string/startsWith.mjs +2 -2
  122. package/lib/asserts/string/upperCase.js +4 -4
  123. package/lib/asserts/string/upperCase.mjs +2 -2
  124. package/lib/asserts/string/uuid.js +4 -4
  125. package/lib/asserts/string/uuid.mjs +2 -2
  126. package/lib/asserts/string/uuidV1.js +4 -4
  127. package/lib/asserts/string/uuidV1.mjs +2 -2
  128. package/lib/asserts/string/uuidV2.js +4 -4
  129. package/lib/asserts/string/uuidV2.mjs +2 -2
  130. package/lib/asserts/string/uuidV3.js +4 -4
  131. package/lib/asserts/string/uuidV3.mjs +2 -2
  132. package/lib/asserts/string/uuidV4.js +4 -4
  133. package/lib/asserts/string/uuidV4.mjs +2 -2
  134. package/lib/asserts/string/uuidV5.js +4 -4
  135. package/lib/asserts/string/uuidV5.mjs +2 -2
  136. package/lib/asserts/string/validUrl.js +4 -4
  137. package/lib/asserts/string/validUrl.mjs +2 -2
  138. package/lib/{chunk-OJSTQQ3N.js → chunk-2KQASECD.js} +5 -5
  139. package/lib/{chunk-OJSTQQ3N.js.map → chunk-2KQASECD.js.map} +1 -1
  140. package/lib/{chunk-AY7HKAG2.js → chunk-5P6AZJCN.js} +5 -3
  141. package/lib/chunk-5P6AZJCN.js.map +1 -0
  142. package/lib/{chunk-AN3VHQEQ.js → chunk-5WHCMWXK.js} +12 -9
  143. package/lib/chunk-5WHCMWXK.js.map +1 -0
  144. package/lib/{chunk-UZ2PWO4O.js → chunk-5YYRBKDP.js} +4 -4
  145. package/lib/{chunk-UZ2PWO4O.js.map → chunk-5YYRBKDP.js.map} +1 -1
  146. package/lib/{chunk-YPAFWVDL.mjs → chunk-6D5W7SSQ.mjs} +4 -4
  147. package/lib/chunk-6D5W7SSQ.mjs.map +1 -0
  148. package/lib/chunk-7NBOVYSP.mjs +136 -0
  149. package/lib/chunk-7NBOVYSP.mjs.map +1 -0
  150. package/lib/{chunk-5LLJ22IG.mjs → chunk-BNCT7NOR.mjs} +21 -7
  151. package/lib/chunk-BNCT7NOR.mjs.map +1 -0
  152. package/lib/{chunk-BUXOCPHI.mjs → chunk-C3EDEQ3W.mjs} +3 -3
  153. package/lib/{chunk-TQWUSDQD.mjs → chunk-CHUPE6SJ.mjs} +6 -6
  154. package/lib/chunk-CHUPE6SJ.mjs.map +1 -0
  155. package/lib/{chunk-ZVW3IHBW.js → chunk-ECBOZ3BM.js} +8 -8
  156. package/lib/chunk-ECBOZ3BM.js.map +1 -0
  157. package/lib/{chunk-NP64RC7B.mjs → chunk-FGZKNBDP.mjs} +5 -3
  158. package/lib/chunk-FGZKNBDP.mjs.map +1 -0
  159. package/lib/{chunk-ZWE5Q37U.mjs → chunk-FP5QAEVQ.mjs} +6 -6
  160. package/lib/chunk-FP5QAEVQ.mjs.map +1 -0
  161. package/lib/{chunk-PESVL5YJ.js → chunk-G55SHHAR.js} +10 -8
  162. package/lib/chunk-G55SHHAR.js.map +1 -0
  163. package/lib/{chunk-4GDBM5LP.mjs → chunk-H32B3NHW.mjs} +2 -2
  164. package/lib/{chunk-D42ISCFK.mjs → chunk-H6LHV3EA.mjs} +2 -2
  165. package/lib/{chunk-SPWF5IFU.js → chunk-HP3DRZWK.js} +5 -5
  166. package/lib/{chunk-SPWF5IFU.js.map → chunk-HP3DRZWK.js.map} +1 -1
  167. package/lib/{chunk-W2GOLG3K.js → chunk-IZ3CBVEE.js} +5 -5
  168. package/lib/{chunk-W2GOLG3K.js.map → chunk-IZ3CBVEE.js.map} +1 -1
  169. package/lib/{chunk-OHEMRF7Y.mjs → chunk-K7X6DVM2.mjs} +3 -3
  170. package/lib/{chunk-KBZUNXJB.mjs → chunk-LPR3G5T3.mjs} +4 -4
  171. package/lib/{chunk-KBZUNXJB.mjs.map → chunk-LPR3G5T3.mjs.map} +1 -1
  172. package/lib/{chunk-2MFBOVP2.mjs → chunk-MHBY5OIQ.mjs} +3 -3
  173. package/lib/{chunk-EU3ZZF7Y.js → chunk-MLNQZ445.js} +13 -13
  174. package/lib/chunk-MLNQZ445.js.map +1 -0
  175. package/lib/chunk-QIDWASOC.js +14 -0
  176. package/lib/{chunk-3ZPLJ5KC.js.map → chunk-QIDWASOC.js.map} +1 -1
  177. package/lib/chunk-SHJVKSEZ.js +136 -0
  178. package/lib/chunk-SHJVKSEZ.js.map +1 -0
  179. package/lib/{chunk-ADSMWGDJ.mjs → chunk-TRGMD7LA.mjs} +7 -5
  180. package/lib/chunk-TRGMD7LA.mjs.map +1 -0
  181. package/lib/{chunk-OKF3BVUD.mjs → chunk-TV5IZY4L.mjs} +9 -6
  182. package/lib/chunk-TV5IZY4L.mjs.map +1 -0
  183. package/lib/{chunk-OO6BTBVP.js → chunk-U4USIJV3.js} +11 -11
  184. package/lib/{chunk-OO6BTBVP.js.map → chunk-U4USIJV3.js.map} +1 -1
  185. package/lib/{chunk-P6V6S6TZ.js → chunk-UUY7DPHK.js} +12 -12
  186. package/lib/chunk-UUY7DPHK.js.map +1 -0
  187. package/lib/chunk-VW4RMQD4.js +28 -0
  188. package/lib/{chunk-LYNVPN3R.js.map → chunk-VW4RMQD4.js.map} +1 -1
  189. package/lib/{chunk-ZMEQCIRN.mjs → chunk-WK4FJ5GD.mjs} +6 -6
  190. package/lib/chunk-WK4FJ5GD.mjs.map +1 -0
  191. package/lib/{chunk-PIBDJJUU.js → chunk-X762EUSZ.js} +31 -17
  192. package/lib/chunk-X762EUSZ.js.map +1 -0
  193. package/lib/{chunk-5HT3PYSG.mjs → chunk-YUMUCQKL.mjs} +4 -4
  194. package/lib/{chunk-5HT3PYSG.mjs.map → chunk-YUMUCQKL.mjs.map} +1 -1
  195. package/lib/{chunk-2D5QE7F4.js → chunk-Z6QU36MM.js} +12 -12
  196. package/lib/chunk-Z6QU36MM.js.map +1 -0
  197. package/lib/codeGen.d.mts +2 -1
  198. package/lib/codeGen.d.ts +2 -1
  199. package/lib/codeGen.js +3 -3
  200. package/lib/codeGen.mjs +2 -2
  201. package/lib/commonTypes.d.mts +26 -2
  202. package/lib/commonTypes.d.ts +26 -2
  203. package/lib/exceptions.d.mts +3 -2
  204. package/lib/exceptions.d.ts +3 -2
  205. package/lib/exceptions.js +2 -2
  206. package/lib/exceptions.mjs +1 -1
  207. package/lib/helpers/core.d.mts +2 -1
  208. package/lib/helpers/core.d.ts +2 -1
  209. package/lib/helpers/core.js +3 -3
  210. package/lib/helpers/core.mjs +2 -2
  211. package/lib/helpers/setStrictType.d.mts +2 -1
  212. package/lib/helpers/setStrictType.d.ts +2 -1
  213. package/lib/helpers/setStrictType.js +4 -4
  214. package/lib/helpers/setStrictType.mjs +3 -3
  215. package/lib/index.d.mts +1 -8
  216. package/lib/index.d.ts +1 -8
  217. package/lib/index.js +6 -6
  218. package/lib/index.mjs +5 -5
  219. package/lib/parse.d.mts +1 -8
  220. package/lib/parse.d.ts +1 -8
  221. package/lib/parse.js +5 -5
  222. package/lib/parse.mjs +4 -4
  223. package/lib/parseOrFail.d.mts +1 -8
  224. package/lib/parseOrFail.d.ts +1 -8
  225. package/lib/parseOrFail.js +5 -5
  226. package/lib/parseOrFail.mjs +4 -4
  227. package/lib/schemas/ArraySchema.d.mts +3 -6
  228. package/lib/schemas/ArraySchema.d.ts +3 -6
  229. package/lib/schemas/ArraySchema.js +7 -7
  230. package/lib/schemas/ArraySchema.mjs +6 -6
  231. package/lib/schemas/BigIntSchema.d.mts +6 -9
  232. package/lib/schemas/BigIntSchema.d.ts +6 -9
  233. package/lib/schemas/BigIntSchema.js +10 -10
  234. package/lib/schemas/BigIntSchema.mjs +9 -9
  235. package/lib/schemas/BooleanSchema.d.mts +6 -9
  236. package/lib/schemas/BooleanSchema.d.ts +6 -9
  237. package/lib/schemas/BooleanSchema.js +8 -8
  238. package/lib/schemas/BooleanSchema.mjs +7 -7
  239. package/lib/schemas/CommonSchema.d.mts +2 -1
  240. package/lib/schemas/CommonSchema.d.ts +2 -1
  241. package/lib/schemas/CommonSchema.js +6 -6
  242. package/lib/schemas/CommonSchema.mjs +5 -5
  243. package/lib/schemas/DateSchema.d.mts +2 -1
  244. package/lib/schemas/DateSchema.d.ts +2 -1
  245. package/lib/schemas/DateSchema.js +7 -7
  246. package/lib/schemas/DateSchema.mjs +6 -6
  247. package/lib/schemas/NumberSchema.d.mts +6 -9
  248. package/lib/schemas/NumberSchema.d.ts +6 -9
  249. package/lib/schemas/NumberSchema.js +10 -10
  250. package/lib/schemas/NumberSchema.mjs +9 -9
  251. package/lib/schemas/ObjectSchema.d.mts +3 -5
  252. package/lib/schemas/ObjectSchema.d.ts +3 -5
  253. package/lib/schemas/ObjectSchema.js +7 -7
  254. package/lib/schemas/ObjectSchema.mjs +6 -6
  255. package/lib/schemas/StringSchema.d.mts +6 -9
  256. package/lib/schemas/StringSchema.d.ts +6 -9
  257. package/lib/schemas/StringSchema.js +10 -10
  258. package/lib/schemas/StringSchema.mjs +9 -9
  259. package/lib/translationMap.js +3 -3
  260. package/lib/translationMap.mjs +2 -2
  261. package/package.json +1 -1
  262. package/lib/CommonSchema-CiY7spmg.d.mts +0 -71
  263. package/lib/CommonSchema-D9QVJBJe.d.ts +0 -71
  264. package/lib/chunk-2D5QE7F4.js.map +0 -1
  265. package/lib/chunk-3IOQH3K4.js +0 -74
  266. package/lib/chunk-3IOQH3K4.js.map +0 -1
  267. package/lib/chunk-3ZPLJ5KC.js +0 -14
  268. package/lib/chunk-5LLJ22IG.mjs.map +0 -1
  269. package/lib/chunk-ADSMWGDJ.mjs.map +0 -1
  270. package/lib/chunk-AN3VHQEQ.js.map +0 -1
  271. package/lib/chunk-AOUFWACR.mjs +0 -74
  272. package/lib/chunk-AOUFWACR.mjs.map +0 -1
  273. package/lib/chunk-AY7HKAG2.js.map +0 -1
  274. package/lib/chunk-EU3ZZF7Y.js.map +0 -1
  275. package/lib/chunk-LYNVPN3R.js +0 -28
  276. package/lib/chunk-NP64RC7B.mjs.map +0 -1
  277. package/lib/chunk-OKF3BVUD.mjs.map +0 -1
  278. package/lib/chunk-P6V6S6TZ.js.map +0 -1
  279. package/lib/chunk-PESVL5YJ.js.map +0 -1
  280. package/lib/chunk-PIBDJJUU.js.map +0 -1
  281. package/lib/chunk-TQWUSDQD.mjs.map +0 -1
  282. package/lib/chunk-YPAFWVDL.mjs.map +0 -1
  283. package/lib/chunk-ZMEQCIRN.mjs.map +0 -1
  284. package/lib/chunk-ZVW3IHBW.js.map +0 -1
  285. package/lib/chunk-ZWE5Q37U.mjs.map +0 -1
  286. /package/lib/{chunk-BUXOCPHI.mjs.map → chunk-C3EDEQ3W.mjs.map} +0 -0
  287. /package/lib/{chunk-4GDBM5LP.mjs.map → chunk-H32B3NHW.mjs.map} +0 -0
  288. /package/lib/{chunk-D42ISCFK.mjs.map → chunk-H6LHV3EA.mjs.map} +0 -0
  289. /package/lib/{chunk-OHEMRF7Y.mjs.map → chunk-K7X6DVM2.mjs.map} +0 -0
  290. /package/lib/{chunk-2MFBOVP2.mjs.map → chunk-MHBY5OIQ.mjs.map} +0 -0
@@ -1,6 +1,7 @@
1
+ import { WithBGuardType } from '../../commonTypes.mjs';
1
2
  import { NumberSchema } from '../../schemas/NumberSchema.mjs';
2
- import '../../CommonSchema-CiY7spmg.mjs';
3
- import '../../commonTypes.mjs';
3
+ import '../../CommonSchema-wi9MOXGF.mjs';
4
+ import '../../InferType.mjs';
4
5
 
5
6
  /**
6
7
  * @description Creates a new schema for validating number values.
@@ -12,6 +13,6 @@ import '../../commonTypes.mjs';
12
13
  *
13
14
  * @instance Of NumberSchema
14
15
  */
15
- declare function number(): NumberSchema;
16
+ declare function number(): WithBGuardType<NumberSchema, number>;
16
17
 
17
18
  export { number };
@@ -1,6 +1,7 @@
1
+ import { WithBGuardType } from '../../commonTypes.js';
1
2
  import { NumberSchema } from '../../schemas/NumberSchema.js';
2
- import '../../CommonSchema-D9QVJBJe.js';
3
- import '../../commonTypes.js';
3
+ import '../../CommonSchema-DOh3bsL-.js';
4
+ import '../../InferType.js';
4
5
 
5
6
  /**
6
7
  * @description Creates a new schema for validating number values.
@@ -12,6 +13,6 @@ import '../../commonTypes.js';
12
13
  *
13
14
  * @instance Of NumberSchema
14
15
  */
15
- declare function number(): NumberSchema;
16
+ declare function number(): WithBGuardType<NumberSchema, number>;
16
17
 
17
18
  export { number };
@@ -1,20 +1,20 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkEU3ZZF7Yjs = require('../../chunk-EU3ZZF7Y.js');
4
- require('../../chunk-SPWF5IFU.js');
5
- require('../../chunk-W2GOLG3K.js');
3
+ var _chunkMLNQZ445js = require('../../chunk-MLNQZ445.js');
4
+ require('../../chunk-HP3DRZWK.js');
5
+ require('../../chunk-IZ3CBVEE.js');
6
6
  require('../../chunk-42J6CHIO.js');
7
- require('../../chunk-3ZPLJ5KC.js');
8
- require('../../chunk-3IOQH3K4.js');
9
- require('../../chunk-PESVL5YJ.js');
10
- require('../../chunk-PIBDJJUU.js');
7
+ require('../../chunk-QIDWASOC.js');
8
+ require('../../chunk-SHJVKSEZ.js');
9
+ require('../../chunk-G55SHHAR.js');
10
+ require('../../chunk-X762EUSZ.js');
11
11
  require('../../chunk-VBTWYDEM.js');
12
- require('../../chunk-UZ2PWO4O.js');
13
- require('../../chunk-AY7HKAG2.js');
12
+ require('../../chunk-5YYRBKDP.js');
13
+ require('../../chunk-5P6AZJCN.js');
14
14
 
15
15
  // src/asserts/number/index.ts
16
16
  function number() {
17
- return new (0, _chunkEU3ZZF7Yjs.NumberSchema)({ type: ["number"], requiredValidations: [] });
17
+ return new (0, _chunkMLNQZ445js.NumberSchema)({ type: ["number"], requiredValidations: [] });
18
18
  }
19
19
 
20
20
 
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/bguard/bguard/lib/asserts/number/index.js","../../../src/asserts/number/index.ts"],"names":[],"mappings":"AAAA;AACE;AACF,0DAAgC;AAChC,mCAAgC;AAChC,mCAAgC;AAChC,mCAAgC;AAChC,mCAAgC;AAChC,mCAAgC;AAChC,mCAAgC;AAChC,mCAAgC;AAChC,mCAAgC;AAChC,mCAAgC;AAChC,mCAAgC;AAChC;AACA;ACFO,SAAS,MAAA,CAAA,EAAuB;AACrC,EAAA,OAAO,IAAI,kCAAA,CAAa,EAAE,IAAA,EAAM,CAAC,QAAQ,CAAA,EAAG,mBAAA,EAAqB,CAAC,EAAE,CAAC,CAAA;AACvE;ADIA;AACE;AACF,wBAAC","file":"/home/runner/work/bguard/bguard/lib/asserts/number/index.js","sourcesContent":[null,"import { NumberSchema } from '../../schemas/NumberSchema';\n\n/**\n * @description Creates a new schema for validating number values.\n * @returns {NumberSchema} A new instance of `NumberSchema` for validating numbers.\n * @example\n * const schema = number();\n * parseOrFail(schema, 42); // Validates successfully\n * parseOrFail(schema, '42'); // Throws a validation error\n *\n * @instance Of NumberSchema\n */\nexport function number(): NumberSchema {\n return new NumberSchema({ type: ['number'], requiredValidations: [] });\n}\n"]}
1
+ {"version":3,"sources":["/home/runner/work/bguard/bguard/lib/asserts/number/index.js","../../../src/asserts/number/index.ts"],"names":[],"mappings":"AAAA;AACE;AACF,0DAAgC;AAChC,mCAAgC;AAChC,mCAAgC;AAChC,mCAAgC;AAChC,mCAAgC;AAChC,mCAAgC;AAChC,mCAAgC;AAChC,mCAAgC;AAChC,mCAAgC;AAChC,mCAAgC;AAChC,mCAAgC;AAChC;AACA;ACDO,SAAS,MAAA,CAAA,EAA+C;AAC7D,EAAA,OAAO,IAAI,kCAAA,CAAa,EAAE,IAAA,EAAM,CAAC,QAAQ,CAAA,EAAG,mBAAA,EAAqB,CAAC,EAAE,CAAC,CAAA;AACvE;ADGA;AACE;AACF,wBAAC","file":"/home/runner/work/bguard/bguard/lib/asserts/number/index.js","sourcesContent":[null,"import { WithBGuardType } from '../../commonTypes';\nimport { NumberSchema } from '../../schemas/NumberSchema';\n\n/**\n * @description Creates a new schema for validating number values.\n * @returns {NumberSchema} A new instance of `NumberSchema` for validating numbers.\n * @example\n * const schema = number();\n * parseOrFail(schema, 42); // Validates successfully\n * parseOrFail(schema, '42'); // Throws a validation error\n *\n * @instance Of NumberSchema\n */\nexport function number(): WithBGuardType<NumberSchema, number> {\n return new NumberSchema({ type: ['number'], requiredValidations: [] }) as WithBGuardType<NumberSchema, number>;\n}\n"]}
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  NumberSchema
3
- } from "../../chunk-TQWUSDQD.mjs";
4
- import "../../chunk-BUXOCPHI.mjs";
5
- import "../../chunk-OHEMRF7Y.mjs";
3
+ } from "../../chunk-CHUPE6SJ.mjs";
4
+ import "../../chunk-C3EDEQ3W.mjs";
5
+ import "../../chunk-K7X6DVM2.mjs";
6
6
  import "../../chunk-ASZW6XRM.mjs";
7
- import "../../chunk-D42ISCFK.mjs";
8
- import "../../chunk-AOUFWACR.mjs";
9
- import "../../chunk-ADSMWGDJ.mjs";
10
- import "../../chunk-5LLJ22IG.mjs";
7
+ import "../../chunk-H6LHV3EA.mjs";
8
+ import "../../chunk-7NBOVYSP.mjs";
9
+ import "../../chunk-TRGMD7LA.mjs";
10
+ import "../../chunk-BNCT7NOR.mjs";
11
11
  import "../../chunk-YBVMP4EI.mjs";
12
- import "../../chunk-4GDBM5LP.mjs";
13
- import "../../chunk-NP64RC7B.mjs";
12
+ import "../../chunk-H32B3NHW.mjs";
13
+ import "../../chunk-FGZKNBDP.mjs";
14
14
 
15
15
  // src/asserts/number/index.ts
16
16
  function number() {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/asserts/number/index.ts"],"sourcesContent":["import { NumberSchema } from '../../schemas/NumberSchema';\n\n/**\n * @description Creates a new schema for validating number values.\n * @returns {NumberSchema} A new instance of `NumberSchema` for validating numbers.\n * @example\n * const schema = number();\n * parseOrFail(schema, 42); // Validates successfully\n * parseOrFail(schema, '42'); // Throws a validation error\n *\n * @instance Of NumberSchema\n */\nexport function number(): NumberSchema {\n return new NumberSchema({ type: ['number'], requiredValidations: [] });\n}\n"],"mappings":";;;;;;;;;;;;;;;AAYO,SAAS,SAAuB;AACrC,SAAO,IAAI,aAAa,EAAE,MAAM,CAAC,QAAQ,GAAG,qBAAqB,CAAC,EAAE,CAAC;AACvE;","names":[]}
1
+ {"version":3,"sources":["../../../src/asserts/number/index.ts"],"sourcesContent":["import { WithBGuardType } from '../../commonTypes';\nimport { NumberSchema } from '../../schemas/NumberSchema';\n\n/**\n * @description Creates a new schema for validating number values.\n * @returns {NumberSchema} A new instance of `NumberSchema` for validating numbers.\n * @example\n * const schema = number();\n * parseOrFail(schema, 42); // Validates successfully\n * parseOrFail(schema, '42'); // Throws a validation error\n *\n * @instance Of NumberSchema\n */\nexport function number(): WithBGuardType<NumberSchema, number> {\n return new NumberSchema({ type: ['number'], requiredValidations: [] }) as WithBGuardType<NumberSchema, number>;\n}\n"],"mappings":";;;;;;;;;;;;;;;AAaO,SAAS,SAA+C;AAC7D,SAAO,IAAI,aAAa,EAAE,MAAM,CAAC,QAAQ,GAAG,qBAAqB,CAAC,EAAE,CAAC;AACvE;","names":[]}
@@ -1,19 +1,19 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkUZ2PWO4Ojs = require('../../chunk-UZ2PWO4O.js');
3
+ var _chunk5YYRBKDPjs = require('../../chunk-5YYRBKDP.js');
4
4
 
5
5
 
6
- var _chunkAY7HKAG2js = require('../../chunk-AY7HKAG2.js');
6
+ var _chunk5P6AZJCNjs = require('../../chunk-5P6AZJCN.js');
7
7
 
8
8
  // src/asserts/number/max.ts
9
9
  var maxErrorMessage = "The received value is greater than expected";
10
10
  var maxErrorKey = "n:max";
11
11
  var max = (expected) => (received, ctx) => {
12
- if (expected < received) _chunkAY7HKAG2js.guardException.call(void 0, expected, received, ctx, maxErrorKey);
12
+ if (expected < received) _chunk5P6AZJCNjs.guardException.call(void 0, expected, received, ctx, maxErrorKey);
13
13
  };
14
14
  max.key = maxErrorKey;
15
15
  max.message = maxErrorMessage;
16
- _chunkUZ2PWO4Ojs.setToDefaultLocale.call(void 0, max);
16
+ _chunk5YYRBKDPjs.setToDefaultLocale.call(void 0, max);
17
17
 
18
18
 
19
19
  exports.max = max;
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  setToDefaultLocale
3
- } from "../../chunk-4GDBM5LP.mjs";
3
+ } from "../../chunk-H32B3NHW.mjs";
4
4
  import {
5
5
  guardException
6
- } from "../../chunk-NP64RC7B.mjs";
6
+ } from "../../chunk-FGZKNBDP.mjs";
7
7
 
8
8
  // src/asserts/number/max.ts
9
9
  var maxErrorMessage = "The received value is greater than expected";
@@ -1,19 +1,19 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkUZ2PWO4Ojs = require('../../chunk-UZ2PWO4O.js');
3
+ var _chunk5YYRBKDPjs = require('../../chunk-5YYRBKDP.js');
4
4
 
5
5
 
6
- var _chunkAY7HKAG2js = require('../../chunk-AY7HKAG2.js');
6
+ var _chunk5P6AZJCNjs = require('../../chunk-5P6AZJCN.js');
7
7
 
8
8
  // src/asserts/number/maxExcluded.ts
9
9
  var maxExcludedErrorMessage = "The received value is greater than or equal to expected";
10
10
  var maxExcludedErrorKey = "n:maxExcluded";
11
11
  var maxExcluded = (expected) => (received, ctx) => {
12
- if (expected <= received) _chunkAY7HKAG2js.guardException.call(void 0, expected, received, ctx, maxExcludedErrorKey);
12
+ if (expected <= received) _chunk5P6AZJCNjs.guardException.call(void 0, expected, received, ctx, maxExcludedErrorKey);
13
13
  };
14
14
  maxExcluded.key = maxExcludedErrorKey;
15
15
  maxExcluded.message = maxExcludedErrorMessage;
16
- _chunkUZ2PWO4Ojs.setToDefaultLocale.call(void 0, maxExcluded);
16
+ _chunk5YYRBKDPjs.setToDefaultLocale.call(void 0, maxExcluded);
17
17
 
18
18
 
19
19
  exports.maxExcluded = maxExcluded;
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  setToDefaultLocale
3
- } from "../../chunk-4GDBM5LP.mjs";
3
+ } from "../../chunk-H32B3NHW.mjs";
4
4
  import {
5
5
  guardException
6
- } from "../../chunk-NP64RC7B.mjs";
6
+ } from "../../chunk-FGZKNBDP.mjs";
7
7
 
8
8
  // src/asserts/number/maxExcluded.ts
9
9
  var maxExcludedErrorMessage = "The received value is greater than or equal to expected";
@@ -1,19 +1,19 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkUZ2PWO4Ojs = require('../../chunk-UZ2PWO4O.js');
3
+ var _chunk5YYRBKDPjs = require('../../chunk-5YYRBKDP.js');
4
4
 
5
5
 
6
- var _chunkAY7HKAG2js = require('../../chunk-AY7HKAG2.js');
6
+ var _chunk5P6AZJCNjs = require('../../chunk-5P6AZJCN.js');
7
7
 
8
8
  // src/asserts/number/min.ts
9
9
  var minErrorMessage = "The received value is less than expected";
10
10
  var minErrorKey = "n:min";
11
11
  var min = (expected) => (received, ctx) => {
12
- if (expected > received) _chunkAY7HKAG2js.guardException.call(void 0, expected, received, ctx, minErrorKey);
12
+ if (expected > received) _chunk5P6AZJCNjs.guardException.call(void 0, expected, received, ctx, minErrorKey);
13
13
  };
14
14
  min.key = minErrorKey;
15
15
  min.message = minErrorMessage;
16
- _chunkUZ2PWO4Ojs.setToDefaultLocale.call(void 0, min);
16
+ _chunk5YYRBKDPjs.setToDefaultLocale.call(void 0, min);
17
17
 
18
18
 
19
19
  exports.min = min;
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  setToDefaultLocale
3
- } from "../../chunk-4GDBM5LP.mjs";
3
+ } from "../../chunk-H32B3NHW.mjs";
4
4
  import {
5
5
  guardException
6
- } from "../../chunk-NP64RC7B.mjs";
6
+ } from "../../chunk-FGZKNBDP.mjs";
7
7
 
8
8
  // src/asserts/number/min.ts
9
9
  var minErrorMessage = "The received value is less than expected";
@@ -1,19 +1,19 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkUZ2PWO4Ojs = require('../../chunk-UZ2PWO4O.js');
3
+ var _chunk5YYRBKDPjs = require('../../chunk-5YYRBKDP.js');
4
4
 
5
5
 
6
- var _chunkAY7HKAG2js = require('../../chunk-AY7HKAG2.js');
6
+ var _chunk5P6AZJCNjs = require('../../chunk-5P6AZJCN.js');
7
7
 
8
8
  // src/asserts/number/minExcluded.ts
9
9
  var minExcludedErrorMessage = "The received value is less than or equal to expected";
10
10
  var minExcludedErrorKey = "n:minExcluded";
11
11
  var minExcluded = (expected) => (received, ctx) => {
12
- if (expected >= received) _chunkAY7HKAG2js.guardException.call(void 0, expected, received, ctx, minExcludedErrorKey);
12
+ if (expected >= received) _chunk5P6AZJCNjs.guardException.call(void 0, expected, received, ctx, minExcludedErrorKey);
13
13
  };
14
14
  minExcluded.key = minExcludedErrorKey;
15
15
  minExcluded.message = minExcludedErrorMessage;
16
- _chunkUZ2PWO4Ojs.setToDefaultLocale.call(void 0, minExcluded);
16
+ _chunk5YYRBKDPjs.setToDefaultLocale.call(void 0, minExcluded);
17
17
 
18
18
 
19
19
  exports.minExcluded = minExcluded;
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  setToDefaultLocale
3
- } from "../../chunk-4GDBM5LP.mjs";
3
+ } from "../../chunk-H32B3NHW.mjs";
4
4
  import {
5
5
  guardException
6
- } from "../../chunk-NP64RC7B.mjs";
6
+ } from "../../chunk-FGZKNBDP.mjs";
7
7
 
8
8
  // src/asserts/number/minExcluded.ts
9
9
  var minExcludedErrorMessage = "The received value is less than or equal to expected";
@@ -1,19 +1,19 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkUZ2PWO4Ojs = require('../../chunk-UZ2PWO4O.js');
3
+ var _chunk5YYRBKDPjs = require('../../chunk-5YYRBKDP.js');
4
4
 
5
5
 
6
- var _chunkAY7HKAG2js = require('../../chunk-AY7HKAG2.js');
6
+ var _chunk5P6AZJCNjs = require('../../chunk-5P6AZJCN.js');
7
7
 
8
8
  // src/asserts/number/negative.ts
9
9
  var negativeErrorMessage = "The received value is not a negative number";
10
10
  var negativeErrorKey = "n:negative";
11
11
  var negative = () => (received, ctx) => {
12
- if (received >= 0) _chunkAY7HKAG2js.guardException.call(void 0, "negative", received, ctx, negativeErrorKey);
12
+ if (received >= 0) _chunk5P6AZJCNjs.guardException.call(void 0, "negative", received, ctx, negativeErrorKey);
13
13
  };
14
14
  negative.key = negativeErrorKey;
15
15
  negative.message = negativeErrorMessage;
16
- _chunkUZ2PWO4Ojs.setToDefaultLocale.call(void 0, negative);
16
+ _chunk5YYRBKDPjs.setToDefaultLocale.call(void 0, negative);
17
17
 
18
18
 
19
19
  exports.negative = negative;
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  setToDefaultLocale
3
- } from "../../chunk-4GDBM5LP.mjs";
3
+ } from "../../chunk-H32B3NHW.mjs";
4
4
  import {
5
5
  guardException
6
- } from "../../chunk-NP64RC7B.mjs";
6
+ } from "../../chunk-FGZKNBDP.mjs";
7
7
 
8
8
  // src/asserts/number/negative.ts
9
9
  var negativeErrorMessage = "The received value is not a negative number";
@@ -1,19 +1,19 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkUZ2PWO4Ojs = require('../../chunk-UZ2PWO4O.js');
3
+ var _chunk5YYRBKDPjs = require('../../chunk-5YYRBKDP.js');
4
4
 
5
5
 
6
- var _chunkAY7HKAG2js = require('../../chunk-AY7HKAG2.js');
6
+ var _chunk5P6AZJCNjs = require('../../chunk-5P6AZJCN.js');
7
7
 
8
8
  // src/asserts/number/positive.ts
9
9
  var positiveErrorMessage = "The received value is not a positive number";
10
10
  var positiveErrorKey = "n:positive";
11
11
  var positive = () => (received, ctx) => {
12
- if (received <= 0) _chunkAY7HKAG2js.guardException.call(void 0, "positive", received, ctx, positiveErrorMessage);
12
+ if (received <= 0) _chunk5P6AZJCNjs.guardException.call(void 0, "positive", received, ctx, positiveErrorMessage);
13
13
  };
14
14
  positive.key = positiveErrorKey;
15
15
  positive.message = positiveErrorMessage;
16
- _chunkUZ2PWO4Ojs.setToDefaultLocale.call(void 0, positive);
16
+ _chunk5YYRBKDPjs.setToDefaultLocale.call(void 0, positive);
17
17
 
18
18
 
19
19
  exports.positive = positive;
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  setToDefaultLocale
3
- } from "../../chunk-4GDBM5LP.mjs";
3
+ } from "../../chunk-H32B3NHW.mjs";
4
4
  import {
5
5
  guardException
6
- } from "../../chunk-NP64RC7B.mjs";
6
+ } from "../../chunk-FGZKNBDP.mjs";
7
7
 
8
8
  // src/asserts/number/positive.ts
9
9
  var positiveErrorMessage = "The received value is not a positive number";
@@ -1,12 +1,13 @@
1
- import { O as ObjectShapeSchemaType } from '../../CommonSchema-CiY7spmg.mjs';
2
- import { WithObject } from '../../schemas/ObjectSchema.mjs';
3
- import '../../commonTypes.mjs';
1
+ import { WithObject } from '../../commonTypes.mjs';
2
+ import { O as ObjectShapeSchemaType } from '../../CommonSchema-wi9MOXGF.mjs';
3
+ import { ObjectSchema } from '../../schemas/ObjectSchema.mjs';
4
+ import '../../InferType.mjs';
4
5
 
5
6
  /**
6
7
  * @description Creates a new schema for validating objects where each property must match the specified schema.
7
8
  * @template T
8
9
  * @param {T} shapeSchema - The schema that each property of the object must match.
9
- * @returns {WithObject<T>} A new instance of `ObjectSchema` for validating objects with properties matching the specified schema.
10
+ * @returns {WithObject<ObjectSchema, T>} A new instance of `ObjectSchema` for validating objects with properties matching the specified schema.
10
11
  * @example
11
12
  * const schema = object({
12
13
  * name: string(),
@@ -17,6 +18,6 @@ import '../../commonTypes.mjs';
17
18
  *
18
19
  * @instance Of ObjectSchema
19
20
  */
20
- declare function object<T extends ObjectShapeSchemaType>(shapeSchema: T): WithObject<T>;
21
+ declare function object<T extends ObjectShapeSchemaType>(shapeSchema: T): WithObject<ObjectSchema, T>;
21
22
 
22
23
  export { object };
@@ -1,12 +1,13 @@
1
- import { O as ObjectShapeSchemaType } from '../../CommonSchema-D9QVJBJe.js';
2
- import { WithObject } from '../../schemas/ObjectSchema.js';
3
- import '../../commonTypes.js';
1
+ import { WithObject } from '../../commonTypes.js';
2
+ import { O as ObjectShapeSchemaType } from '../../CommonSchema-DOh3bsL-.js';
3
+ import { ObjectSchema } from '../../schemas/ObjectSchema.js';
4
+ import '../../InferType.js';
4
5
 
5
6
  /**
6
7
  * @description Creates a new schema for validating objects where each property must match the specified schema.
7
8
  * @template T
8
9
  * @param {T} shapeSchema - The schema that each property of the object must match.
9
- * @returns {WithObject<T>} A new instance of `ObjectSchema` for validating objects with properties matching the specified schema.
10
+ * @returns {WithObject<ObjectSchema, T>} A new instance of `ObjectSchema` for validating objects with properties matching the specified schema.
10
11
  * @example
11
12
  * const schema = object({
12
13
  * name: string(),
@@ -17,6 +18,6 @@ import '../../commonTypes.js';
17
18
  *
18
19
  * @instance Of ObjectSchema
19
20
  */
20
- declare function object<T extends ObjectShapeSchemaType>(shapeSchema: T): WithObject<T>;
21
+ declare function object<T extends ObjectShapeSchemaType>(shapeSchema: T): WithObject<ObjectSchema, T>;
21
22
 
22
23
  export { object };
@@ -1,16 +1,16 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkOO6BTBVPjs = require('../../chunk-OO6BTBVP.js');
4
- require('../../chunk-3IOQH3K4.js');
5
- require('../../chunk-PESVL5YJ.js');
6
- require('../../chunk-PIBDJJUU.js');
3
+ var _chunkU4USIJV3js = require('../../chunk-U4USIJV3.js');
4
+ require('../../chunk-SHJVKSEZ.js');
5
+ require('../../chunk-G55SHHAR.js');
6
+ require('../../chunk-X762EUSZ.js');
7
7
  require('../../chunk-VBTWYDEM.js');
8
- require('../../chunk-UZ2PWO4O.js');
9
- require('../../chunk-AY7HKAG2.js');
8
+ require('../../chunk-5YYRBKDP.js');
9
+ require('../../chunk-5P6AZJCN.js');
10
10
 
11
11
  // src/asserts/object/index.ts
12
12
  function object(shapeSchema) {
13
- return new (0, _chunkOO6BTBVPjs.ObjectSchema)({ type: [], requiredValidations: [] }, shapeSchema);
13
+ return new (0, _chunkU4USIJV3js.ObjectSchema)({ type: [], requiredValidations: [] }, shapeSchema);
14
14
  }
15
15
 
16
16
 
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/bguard/bguard/lib/asserts/object/index.js","../../../src/asserts/object/index.ts"],"names":[],"mappings":"AAAA;AACE;AACF,0DAAgC;AAChC,mCAAgC;AAChC,mCAAgC;AAChC,mCAAgC;AAChC,mCAAgC;AAChC,mCAAgC;AAChC,mCAAgC;AAChC;AACA;ACQO,SAAS,MAAA,CAAwC,WAAA,EAA+B;AACrF,EAAA,OAAO,IAAI,kCAAA,CAAa,EAAE,IAAA,EAAM,CAAC,CAAA,EAAG,mBAAA,EAAqB,CAAC,EAAE,CAAA,EAAG,WAAW,CAAA;AAC5E;ADNA;AACE;AACF,wBAAC","file":"/home/runner/work/bguard/bguard/lib/asserts/object/index.js","sourcesContent":[null,"import { ObjectShapeSchemaType } from '../../schemas/CommonSchema';\nimport { ObjectSchema, WithObject } from '../../schemas/ObjectSchema';\n\n/**\n * @description Creates a new schema for validating objects where each property must match the specified schema.\n * @template T\n * @param {T} shapeSchema - The schema that each property of the object must match.\n * @returns {WithObject<T>} A new instance of `ObjectSchema` for validating objects with properties matching the specified schema.\n * @example\n * const schema = object({\n * name: string(),\n * age: number()\n * });\n * parseOrFail(schema, { name: 'John', age: 30 }); // Validates successfully\n * parseOrFail(schema, { name: 'John', age: '30' }); // Throws a validation error\n *\n * @instance Of ObjectSchema\n */\nexport function object<T extends ObjectShapeSchemaType>(shapeSchema: T): WithObject<T> {\n return new ObjectSchema({ type: [], requiredValidations: [] }, shapeSchema) as WithObject<T>;\n}\n"]}
1
+ {"version":3,"sources":["/home/runner/work/bguard/bguard/lib/asserts/object/index.js","../../../src/asserts/object/index.ts"],"names":[],"mappings":"AAAA;AACE;AACF,0DAAgC;AAChC,mCAAgC;AAChC,mCAAgC;AAChC,mCAAgC;AAChC,mCAAgC;AAChC,mCAAgC;AAChC,mCAAgC;AAChC;AACA;ACSO,SAAS,MAAA,CAAwC,WAAA,EAA6C;AACnG,EAAA,OAAO,IAAI,kCAAA,CAAa,EAAE,IAAA,EAAM,CAAC,CAAA,EAAG,mBAAA,EAAqB,CAAC,EAAE,CAAA,EAAG,WAAW,CAAA;AAC5E;ADPA;AACE;AACF,wBAAC","file":"/home/runner/work/bguard/bguard/lib/asserts/object/index.js","sourcesContent":[null,"import { WithObject } from '../../commonTypes';\nimport { ObjectShapeSchemaType } from '../../schemas/CommonSchema';\nimport { ObjectSchema } from '../../schemas/ObjectSchema';\n\n/**\n * @description Creates a new schema for validating objects where each property must match the specified schema.\n * @template T\n * @param {T} shapeSchema - The schema that each property of the object must match.\n * @returns {WithObject<ObjectSchema, T>} A new instance of `ObjectSchema` for validating objects with properties matching the specified schema.\n * @example\n * const schema = object({\n * name: string(),\n * age: number()\n * });\n * parseOrFail(schema, { name: 'John', age: 30 }); // Validates successfully\n * parseOrFail(schema, { name: 'John', age: '30' }); // Throws a validation error\n *\n * @instance Of ObjectSchema\n */\nexport function object<T extends ObjectShapeSchemaType>(shapeSchema: T): WithObject<ObjectSchema, T> {\n return new ObjectSchema({ type: [], requiredValidations: [] }, shapeSchema) as WithObject<ObjectSchema, T>;\n}\n"]}
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  ObjectSchema
3
- } from "../../chunk-5HT3PYSG.mjs";
4
- import "../../chunk-AOUFWACR.mjs";
5
- import "../../chunk-ADSMWGDJ.mjs";
6
- import "../../chunk-5LLJ22IG.mjs";
3
+ } from "../../chunk-YUMUCQKL.mjs";
4
+ import "../../chunk-7NBOVYSP.mjs";
5
+ import "../../chunk-TRGMD7LA.mjs";
6
+ import "../../chunk-BNCT7NOR.mjs";
7
7
  import "../../chunk-YBVMP4EI.mjs";
8
- import "../../chunk-4GDBM5LP.mjs";
9
- import "../../chunk-NP64RC7B.mjs";
8
+ import "../../chunk-H32B3NHW.mjs";
9
+ import "../../chunk-FGZKNBDP.mjs";
10
10
 
11
11
  // src/asserts/object/index.ts
12
12
  function object(shapeSchema) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/asserts/object/index.ts"],"sourcesContent":["import { ObjectShapeSchemaType } from '../../schemas/CommonSchema';\nimport { ObjectSchema, WithObject } from '../../schemas/ObjectSchema';\n\n/**\n * @description Creates a new schema for validating objects where each property must match the specified schema.\n * @template T\n * @param {T} shapeSchema - The schema that each property of the object must match.\n * @returns {WithObject<T>} A new instance of `ObjectSchema` for validating objects with properties matching the specified schema.\n * @example\n * const schema = object({\n * name: string(),\n * age: number()\n * });\n * parseOrFail(schema, { name: 'John', age: 30 }); // Validates successfully\n * parseOrFail(schema, { name: 'John', age: '30' }); // Throws a validation error\n *\n * @instance Of ObjectSchema\n */\nexport function object<T extends ObjectShapeSchemaType>(shapeSchema: T): WithObject<T> {\n return new ObjectSchema({ type: [], requiredValidations: [] }, shapeSchema) as WithObject<T>;\n}\n"],"mappings":";;;;;;;;;;;AAkBO,SAAS,OAAwC,aAA+B;AACrF,SAAO,IAAI,aAAa,EAAE,MAAM,CAAC,GAAG,qBAAqB,CAAC,EAAE,GAAG,WAAW;AAC5E;","names":[]}
1
+ {"version":3,"sources":["../../../src/asserts/object/index.ts"],"sourcesContent":["import { WithObject } from '../../commonTypes';\nimport { ObjectShapeSchemaType } from '../../schemas/CommonSchema';\nimport { ObjectSchema } from '../../schemas/ObjectSchema';\n\n/**\n * @description Creates a new schema for validating objects where each property must match the specified schema.\n * @template T\n * @param {T} shapeSchema - The schema that each property of the object must match.\n * @returns {WithObject<ObjectSchema, T>} A new instance of `ObjectSchema` for validating objects with properties matching the specified schema.\n * @example\n * const schema = object({\n * name: string(),\n * age: number()\n * });\n * parseOrFail(schema, { name: 'John', age: 30 }); // Validates successfully\n * parseOrFail(schema, { name: 'John', age: '30' }); // Throws a validation error\n *\n * @instance Of ObjectSchema\n */\nexport function object<T extends ObjectShapeSchemaType>(shapeSchema: T): WithObject<ObjectSchema, T> {\n return new ObjectSchema({ type: [], requiredValidations: [] }, shapeSchema) as WithObject<ObjectSchema, T>;\n}\n"],"mappings":";;;;;;;;;;;AAmBO,SAAS,OAAwC,aAA6C;AACnG,SAAO,IAAI,aAAa,EAAE,MAAM,CAAC,GAAG,qBAAqB,CAAC,EAAE,GAAG,WAAW;AAC5E;","names":[]}
@@ -0,0 +1,30 @@
1
+ import { RequiredValidation } from '../../commonTypes.mjs';
2
+
3
+ /**
4
+ * @description Ensures that the object has no more than the specified number of keys.
5
+ * @param {number} expected - The maximum number of keys allowed in the object.
6
+ * @returns {RequiredValidation} A validation function that takes a received object and an exception context.
7
+ * @throws {ValidationError} if the number of the received keys is greater than the expected value.
8
+ * @example
9
+ * const schema = object({
10
+ * name: string(),
11
+ * email: string(),
12
+ * })
13
+ * .allowUnrecognized()
14
+ * .custom(maxKeys(2));
15
+ *
16
+ * // This will pass
17
+ * parseOrFail(schema, { name: 'John', email: 'john@example.com' });
18
+ *
19
+ * // This will throw an error because there are 3 keys
20
+ * parseOrFail(schema, { name: 'John', email: 'john@example.com', address: '123 Main St' });
21
+ *
22
+ * @translation Error Translation Key = 'o:maxKeys'
23
+ */
24
+ declare const maxKeys: {
25
+ (expected: number): RequiredValidation;
26
+ key: string;
27
+ message: string;
28
+ };
29
+
30
+ export { maxKeys };
@@ -0,0 +1,30 @@
1
+ import { RequiredValidation } from '../../commonTypes.js';
2
+
3
+ /**
4
+ * @description Ensures that the object has no more than the specified number of keys.
5
+ * @param {number} expected - The maximum number of keys allowed in the object.
6
+ * @returns {RequiredValidation} A validation function that takes a received object and an exception context.
7
+ * @throws {ValidationError} if the number of the received keys is greater than the expected value.
8
+ * @example
9
+ * const schema = object({
10
+ * name: string(),
11
+ * email: string(),
12
+ * })
13
+ * .allowUnrecognized()
14
+ * .custom(maxKeys(2));
15
+ *
16
+ * // This will pass
17
+ * parseOrFail(schema, { name: 'John', email: 'john@example.com' });
18
+ *
19
+ * // This will throw an error because there are 3 keys
20
+ * parseOrFail(schema, { name: 'John', email: 'john@example.com', address: '123 Main St' });
21
+ *
22
+ * @translation Error Translation Key = 'o:maxKeys'
23
+ */
24
+ declare const maxKeys: {
25
+ (expected: number): RequiredValidation;
26
+ key: string;
27
+ message: string;
28
+ };
29
+
30
+ export { maxKeys };
@@ -0,0 +1,23 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunk5YYRBKDPjs = require('../../chunk-5YYRBKDP.js');
4
+
5
+
6
+ var _chunk5P6AZJCNjs = require('../../chunk-5P6AZJCN.js');
7
+
8
+ // src/asserts/object/maxKeys.ts
9
+ var maxKeysErrorMessage = "The received number of keys is greater than expected";
10
+ var maxKeysErrorKey = "o:maxKeys";
11
+ var maxKeys = (expected) => (receivedObject, ctx) => {
12
+ const keysCount = Object.keys(receivedObject).length;
13
+ if (keysCount > expected) {
14
+ _chunk5P6AZJCNjs.guardException.call(void 0, expected, keysCount, ctx, maxKeysErrorKey);
15
+ }
16
+ };
17
+ maxKeys.key = maxKeysErrorKey;
18
+ maxKeys.message = maxKeysErrorMessage;
19
+ _chunk5YYRBKDPjs.setToDefaultLocale.call(void 0, maxKeys);
20
+
21
+
22
+ exports.maxKeys = maxKeys;
23
+ //# sourceMappingURL=maxKeys.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/runner/work/bguard/bguard/lib/asserts/object/maxKeys.js","../../../src/asserts/object/maxKeys.ts"],"names":[],"mappings":"AAAA;AACE;AACF,0DAAgC;AAChC;AACE;AACF,0DAAgC;AAChC;AACA;ACHA,IAAM,oBAAA,EAAsB,sDAAA;AAC5B,IAAM,gBAAA,EAAkB,WAAA;AAuBjB,IAAM,QAAA,EACX,CAAC,QAAA,EAAA,GACD,CAAC,cAAA,EAAyC,GAAA,EAAA,GAA0B;AAClE,EAAA,MAAM,UAAA,EAAY,MAAA,CAAO,IAAA,CAAK,cAAc,CAAA,CAAE,MAAA;AAC9C,EAAA,GAAA,CAAI,UAAA,EAAY,QAAA,EAAU;AACxB,IAAA,6CAAA,QAAe,EAAU,SAAA,EAAW,GAAA,EAAK,eAAe,CAAA;AAAA,EAC1D;AACF,CAAA;AAEF,OAAA,CAAQ,IAAA,EAAM,eAAA;AACd,OAAA,CAAQ,QAAA,EAAU,mBAAA;AAClB,iDAAA,OAA0B,CAAA;ADpB1B;AACE;AACF,0BAAC","file":"/home/runner/work/bguard/bguard/lib/asserts/object/maxKeys.js","sourcesContent":[null,"import { guardException } from '../../exceptions';\nimport { ExceptionContext, RequiredValidation } from '../../commonTypes';\nimport { setToDefaultLocale } from '../../translationMap';\n\nconst maxKeysErrorMessage = 'The received number of keys is greater than expected';\nconst maxKeysErrorKey = 'o:maxKeys';\n\n/**\n * @description Ensures that the object has no more than the specified number of keys.\n * @param {number} expected - The maximum number of keys allowed in the object.\n * @returns {RequiredValidation} A validation function that takes a received object and an exception context.\n * @throws {ValidationError} if the number of the received keys is greater than the expected value.\n * @example\n * const schema = object({\n * name: string(),\n * email: string(),\n * })\n * .allowUnrecognized()\n * .custom(maxKeys(2));\n *\n * // This will pass\n * parseOrFail(schema, { name: 'John', email: 'john@example.com' });\n *\n * // This will throw an error because there are 3 keys\n * parseOrFail(schema, { name: 'John', email: 'john@example.com', address: '123 Main St' });\n *\n * @translation Error Translation Key = 'o:maxKeys'\n */\nexport const maxKeys =\n (expected: number): RequiredValidation =>\n (receivedObject: Record<string, unknown>, ctx: ExceptionContext) => {\n const keysCount = Object.keys(receivedObject).length;\n if (keysCount > expected) {\n guardException(expected, keysCount, ctx, maxKeysErrorKey);\n }\n };\n\nmaxKeys.key = maxKeysErrorKey;\nmaxKeys.message = maxKeysErrorMessage;\nsetToDefaultLocale(maxKeys);\n"]}
@@ -0,0 +1,23 @@
1
+ import {
2
+ setToDefaultLocale
3
+ } from "../../chunk-H32B3NHW.mjs";
4
+ import {
5
+ guardException
6
+ } from "../../chunk-FGZKNBDP.mjs";
7
+
8
+ // src/asserts/object/maxKeys.ts
9
+ var maxKeysErrorMessage = "The received number of keys is greater than expected";
10
+ var maxKeysErrorKey = "o:maxKeys";
11
+ var maxKeys = (expected) => (receivedObject, ctx) => {
12
+ const keysCount = Object.keys(receivedObject).length;
13
+ if (keysCount > expected) {
14
+ guardException(expected, keysCount, ctx, maxKeysErrorKey);
15
+ }
16
+ };
17
+ maxKeys.key = maxKeysErrorKey;
18
+ maxKeys.message = maxKeysErrorMessage;
19
+ setToDefaultLocale(maxKeys);
20
+ export {
21
+ maxKeys
22
+ };
23
+ //# sourceMappingURL=maxKeys.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/asserts/object/maxKeys.ts"],"sourcesContent":["import { guardException } from '../../exceptions';\nimport { ExceptionContext, RequiredValidation } from '../../commonTypes';\nimport { setToDefaultLocale } from '../../translationMap';\n\nconst maxKeysErrorMessage = 'The received number of keys is greater than expected';\nconst maxKeysErrorKey = 'o:maxKeys';\n\n/**\n * @description Ensures that the object has no more than the specified number of keys.\n * @param {number} expected - The maximum number of keys allowed in the object.\n * @returns {RequiredValidation} A validation function that takes a received object and an exception context.\n * @throws {ValidationError} if the number of the received keys is greater than the expected value.\n * @example\n * const schema = object({\n * name: string(),\n * email: string(),\n * })\n * .allowUnrecognized()\n * .custom(maxKeys(2));\n *\n * // This will pass\n * parseOrFail(schema, { name: 'John', email: 'john@example.com' });\n *\n * // This will throw an error because there are 3 keys\n * parseOrFail(schema, { name: 'John', email: 'john@example.com', address: '123 Main St' });\n *\n * @translation Error Translation Key = 'o:maxKeys'\n */\nexport const maxKeys =\n (expected: number): RequiredValidation =>\n (receivedObject: Record<string, unknown>, ctx: ExceptionContext) => {\n const keysCount = Object.keys(receivedObject).length;\n if (keysCount > expected) {\n guardException(expected, keysCount, ctx, maxKeysErrorKey);\n }\n };\n\nmaxKeys.key = maxKeysErrorKey;\nmaxKeys.message = maxKeysErrorMessage;\nsetToDefaultLocale(maxKeys);\n"],"mappings":";;;;;;;;AAIA,IAAM,sBAAsB;AAC5B,IAAM,kBAAkB;AAuBjB,IAAM,UACX,CAAC,aACD,CAAC,gBAAyC,QAA0B;AAClE,QAAM,YAAY,OAAO,KAAK,cAAc,EAAE;AAC9C,MAAI,YAAY,UAAU;AACxB,mBAAe,UAAU,WAAW,KAAK,eAAe;AAAA,EAC1D;AACF;AAEF,QAAQ,MAAM;AACd,QAAQ,UAAU;AAClB,mBAAmB,OAAO;","names":[]}
@@ -1,20 +1,20 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkUZ2PWO4Ojs = require('../../chunk-UZ2PWO4O.js');
3
+ var _chunk5YYRBKDPjs = require('../../chunk-5YYRBKDP.js');
4
4
 
5
5
 
6
- var _chunkAY7HKAG2js = require('../../chunk-AY7HKAG2.js');
6
+ var _chunk5P6AZJCNjs = require('../../chunk-5P6AZJCN.js');
7
7
 
8
8
  // src/asserts/string/atLeastOneDigit.ts
9
9
  var digitRegExp = /\d/;
10
10
  var atLeastOneDigitErrorMessage = "The received value does not contain at least one digit";
11
11
  var atLeastOneDigitErrorKey = "s:atLeastOneDigit";
12
12
  var atLeastOneDigit = () => (received, ctx) => {
13
- if (!digitRegExp.test(received)) _chunkAY7HKAG2js.guardException.call(void 0, "at least one digit", received, ctx, atLeastOneDigitErrorKey);
13
+ if (!digitRegExp.test(received)) _chunk5P6AZJCNjs.guardException.call(void 0, "at least one digit", received, ctx, atLeastOneDigitErrorKey);
14
14
  };
15
15
  atLeastOneDigit.key = atLeastOneDigitErrorKey;
16
16
  atLeastOneDigit.message = atLeastOneDigitErrorMessage;
17
- _chunkUZ2PWO4Ojs.setToDefaultLocale.call(void 0, atLeastOneDigit);
17
+ _chunk5YYRBKDPjs.setToDefaultLocale.call(void 0, atLeastOneDigit);
18
18
 
19
19
 
20
20
  exports.atLeastOneDigit = atLeastOneDigit;
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  setToDefaultLocale
3
- } from "../../chunk-4GDBM5LP.mjs";
3
+ } from "../../chunk-H32B3NHW.mjs";
4
4
  import {
5
5
  guardException
6
- } from "../../chunk-NP64RC7B.mjs";
6
+ } from "../../chunk-FGZKNBDP.mjs";
7
7
 
8
8
  // src/asserts/string/atLeastOneDigit.ts
9
9
  var digitRegExp = /\d/;