bguard 0.3.0 → 0.4.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 (290) hide show
  1. package/README.md +270 -122
  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,55 +1,65 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
3
  var _chunkVBTWYDEMjs = require('./chunk-VBTWYDEM.js');
4
4
 
5
5
 
6
- var _chunkAY7HKAG2js = require('./chunk-AY7HKAG2.js');
6
+ var _chunk5P6AZJCNjs = require('./chunk-5P6AZJCN.js');
7
7
 
8
8
  // src/helpers/core.ts
9
9
  var ctxSymbol = Symbol("contextSymbol");
10
10
  function innerCheck(schema, receivedValue, exCtx) {
11
11
  const commonTmap = exCtx.t;
12
12
  const schemaData = schema[ctxSymbol];
13
+ _optionalChain([schemaData, 'access', _ => _.transformListBefore, 'optionalAccess', _2 => _2.forEach, 'call', _3 => _3((transformCallback) => {
14
+ receivedValue = transformCallback(receivedValue);
15
+ })]);
13
16
  if (receivedValue === void 0) {
14
17
  if (schemaData.defaultValue !== void 0) return schemaData.defaultValue;
15
- if (!schemaData.isOptional) _chunkAY7HKAG2js.guardException.call(void 0, "Required", receivedValue, exCtx, commonTmap["c:optional"]);
18
+ if (!schemaData.isOptional) _chunk5P6AZJCNjs.guardException.call(void 0, "Required", receivedValue, exCtx, commonTmap["c:optional"]);
16
19
  return receivedValue;
17
20
  }
18
21
  if (receivedValue === null) {
19
- if (!schemaData.isNullable) _chunkAY7HKAG2js.guardException.call(void 0, "Not null", receivedValue, exCtx, commonTmap["c:nullable"]);
22
+ if (!schemaData.isNullable) _chunk5P6AZJCNjs.guardException.call(void 0, "Not null", receivedValue, exCtx, commonTmap["c:nullable"]);
20
23
  return receivedValue;
21
24
  }
22
25
  if (schemaData.date) {
23
- if (!_chunkVBTWYDEMjs.isValidDateInner.call(void 0, receivedValue)) _chunkAY7HKAG2js.guardException.call(void 0, "Date", receivedValue, exCtx, commonTmap["c:date"]);
26
+ if (!_chunkVBTWYDEMjs.isValidDateInner.call(void 0, receivedValue)) _chunk5P6AZJCNjs.guardException.call(void 0, "Date", receivedValue, exCtx, commonTmap["c:date"]);
24
27
  }
25
28
  const typeOfVal = typeof receivedValue;
26
29
  if (schemaData.type.length) {
27
30
  if (!schemaData.type.includes(typeOfVal))
28
- _chunkAY7HKAG2js.guardException.call(void 0, schemaData.type, typeOfVal, exCtx, commonTmap["c:invalidType"]);
31
+ _chunk5P6AZJCNjs.guardException.call(void 0, schemaData.type, typeOfVal, exCtx, commonTmap["c:invalidType"]);
29
32
  }
30
- schemaData.requiredValidations.forEach((requiredValidation) => {
31
- requiredValidation(receivedValue, exCtx);
32
- });
33
33
  if (schemaData.array) {
34
- if (!Array.isArray(receivedValue)) return _chunkAY7HKAG2js.guardException.call(void 0, "Array", receivedValue, exCtx, commonTmap["c:array"]);
34
+ if (!Array.isArray(receivedValue)) return _chunk5P6AZJCNjs.guardException.call(void 0, "Array", receivedValue, exCtx, commonTmap["c:array"]);
35
+ schemaData.requiredValidations.forEach((requiredValidation) => {
36
+ requiredValidation(receivedValue, exCtx);
37
+ });
35
38
  const schema2 = schemaData.array;
36
39
  const pathToError = exCtx.pathToError;
37
40
  const parsedReceivedValue = [];
38
41
  receivedValue.forEach((elem, i) => {
39
- const parsedElement = innerCheck(schema2, elem, { ...exCtx, pathToError: `${pathToError}[${i}]` });
42
+ const parsedElement = innerCheck(schema2, elem, {
43
+ ...exCtx,
44
+ pathToError: `${pathToError}[${i}]`,
45
+ meta: schemaData.meta
46
+ });
40
47
  parsedReceivedValue.push(parsedElement);
41
48
  });
42
49
  return parsedReceivedValue;
43
50
  }
44
51
  if (schemaData.object) {
45
- if (typeOfVal !== "object") _chunkAY7HKAG2js.guardException.call(void 0, "Object", receivedValue, exCtx, commonTmap["c:objectType"]);
46
- if (Array.isArray(receivedValue)) _chunkAY7HKAG2js.guardException.call(void 0, "Object", receivedValue, exCtx, commonTmap["c:objectTypeAsArray"]);
52
+ if (typeOfVal !== "object") _chunk5P6AZJCNjs.guardException.call(void 0, "Object", receivedValue, exCtx, commonTmap["c:objectType"]);
53
+ if (Array.isArray(receivedValue)) _chunk5P6AZJCNjs.guardException.call(void 0, "Object", receivedValue, exCtx, commonTmap["c:objectTypeAsArray"]);
54
+ schemaData.requiredValidations.forEach((requiredValidation) => {
55
+ requiredValidation(receivedValue, exCtx);
56
+ });
47
57
  const shapeSchema = schemaData.object;
48
58
  const parsedReceivedValue = {};
49
59
  if (!schemaData.allowUnrecognizedObjectProps) {
50
60
  for (const keyPerReceivedValue of Object.keys(receivedValue)) {
51
61
  if (shapeSchema[keyPerReceivedValue] === void 0)
52
- _chunkAY7HKAG2js.guardException.call(void 0, "Unrecognized property", keyPerReceivedValue, exCtx, commonTmap["c:unrecognizedProperty"]);
62
+ _chunk5P6AZJCNjs.guardException.call(void 0, "Unrecognized property", keyPerReceivedValue, exCtx, commonTmap["c:unrecognizedProperty"]);
53
63
  }
54
64
  }
55
65
  const pathToError = exCtx.pathToError;
@@ -57,16 +67,20 @@ function innerCheck(schema, receivedValue, exCtx) {
57
67
  const receivedObjectValuePropery = receivedValue[keyOfSchema];
58
68
  if (receivedObjectValuePropery === void 0) {
59
69
  if (!valueOfSchema[ctxSymbol].isOptional)
60
- _chunkAY7HKAG2js.guardException.call(void 0, "Required", receivedObjectValuePropery, exCtx, commonTmap["c:requiredProperty"]);
70
+ _chunk5P6AZJCNjs.guardException.call(void 0, "Required", receivedObjectValuePropery, exCtx, commonTmap["c:requiredProperty"]);
61
71
  }
62
72
  const parsedReceivedObjectValuePropery = innerCheck(valueOfSchema, receivedObjectValuePropery, {
63
73
  ...exCtx,
64
- pathToError: `${pathToError}.${keyOfSchema}`
74
+ pathToError: `${pathToError}.${keyOfSchema}`,
75
+ meta: schemaData.meta
65
76
  });
66
77
  parsedReceivedValue[keyOfSchema] = parsedReceivedObjectValuePropery;
67
78
  }
68
79
  return parsedReceivedValue;
69
80
  }
81
+ schemaData.requiredValidations.forEach((requiredValidation) => {
82
+ requiredValidation(receivedValue, exCtx);
83
+ });
70
84
  return receivedValue;
71
85
  }
72
86
 
@@ -74,4 +88,4 @@ function innerCheck(schema, receivedValue, exCtx) {
74
88
 
75
89
 
76
90
  exports.ctxSymbol = ctxSymbol; exports.innerCheck = innerCheck;
77
- //# sourceMappingURL=chunk-PIBDJJUU.js.map
91
+ //# sourceMappingURL=chunk-X762EUSZ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/runner/work/bguard/bguard/lib/chunk-X762EUSZ.js","../src/helpers/core.ts"],"names":["schema"],"mappings":"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","file":"/home/runner/work/bguard/bguard/lib/chunk-X762EUSZ.js","sourcesContent":[null,"export const ctxSymbol = Symbol('contextSymbol');\n\nimport { ExceptionContext } from '../commonTypes';\nimport { guardException } from '../exceptions';\nimport type { CommonSchema } from '../schemas/CommonSchema';\nimport { isValidDateInner } from './isValidDateInner';\n\nexport function innerCheck(schema: CommonSchema, receivedValue: unknown, exCtx: ExceptionContext): unknown {\n const commonTmap = exCtx.t;\n const schemaData = schema[ctxSymbol];\n\n schemaData.transformListBefore?.forEach((transformCallback) => {\n receivedValue = transformCallback(receivedValue);\n });\n\n if (receivedValue === undefined) {\n if (schemaData.defaultValue !== undefined) return schemaData.defaultValue;\n if (!schemaData.isOptional) guardException('Required', receivedValue, exCtx, commonTmap['c:optional']);\n return receivedValue;\n }\n\n if (receivedValue === null) {\n if (!schemaData.isNullable) guardException('Not null', receivedValue, exCtx, commonTmap['c:nullable']);\n return receivedValue;\n }\n\n if (schemaData.date) {\n if (!isValidDateInner(receivedValue)) guardException('Date', receivedValue, exCtx, commonTmap['c:date']);\n }\n\n const typeOfVal = typeof receivedValue;\n\n if (schemaData.type.length) {\n if (!schemaData.type.includes(typeOfVal))\n guardException(schemaData.type, typeOfVal, exCtx, commonTmap['c:invalidType']);\n }\n\n if (schemaData.array) {\n if (!Array.isArray(receivedValue)) return guardException('Array', receivedValue, exCtx, commonTmap['c:array']);\n\n schemaData.requiredValidations.forEach((requiredValidation) => {\n requiredValidation(receivedValue, exCtx);\n });\n\n const schema = schemaData.array;\n const pathToError = exCtx.pathToError;\n const parsedReceivedValue: unknown[] = [];\n receivedValue.forEach((elem, i) => {\n const parsedElement = innerCheck(schema, elem, {\n ...exCtx,\n pathToError: `${pathToError}[${i}]`,\n meta: schemaData.meta,\n });\n parsedReceivedValue.push(parsedElement);\n });\n\n return parsedReceivedValue;\n }\n\n if (schemaData.object) {\n if (typeOfVal !== 'object') guardException('Object', receivedValue, exCtx, commonTmap['c:objectType']);\n if (Array.isArray(receivedValue)) guardException('Object', receivedValue, exCtx, commonTmap['c:objectTypeAsArray']);\n\n schemaData.requiredValidations.forEach((requiredValidation) => {\n requiredValidation(receivedValue, exCtx);\n });\n\n const shapeSchema = schemaData.object;\n const parsedReceivedValue: Record<string, unknown> = {};\n\n if (!schemaData.allowUnrecognizedObjectProps) {\n for (const keyPerReceivedValue of Object.keys(receivedValue)) {\n if (shapeSchema[keyPerReceivedValue] === undefined)\n guardException('Unrecognized property', keyPerReceivedValue, exCtx, commonTmap['c:unrecognizedProperty']);\n }\n }\n\n const pathToError = exCtx.pathToError;\n for (const [keyOfSchema, valueOfSchema] of Object.entries(shapeSchema)) {\n const receivedObjectValuePropery = (receivedValue as Record<string, unknown>)[keyOfSchema];\n if (receivedObjectValuePropery === undefined) {\n if (!valueOfSchema[ctxSymbol].isOptional)\n guardException('Required', receivedObjectValuePropery, exCtx, commonTmap['c:requiredProperty']);\n }\n\n const parsedReceivedObjectValuePropery = innerCheck(valueOfSchema, receivedObjectValuePropery, {\n ...exCtx,\n pathToError: `${pathToError}.${keyOfSchema}`,\n meta: schemaData.meta,\n });\n\n parsedReceivedValue[keyOfSchema] = parsedReceivedObjectValuePropery;\n }\n\n return parsedReceivedValue;\n }\n\n schemaData.requiredValidations.forEach((requiredValidation) => {\n requiredValidation(receivedValue, exCtx);\n });\n\n return receivedValue;\n}\n"]}
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  CommonSchema
3
- } from "./chunk-AOUFWACR.mjs";
3
+ } from "./chunk-7NBOVYSP.mjs";
4
4
  import {
5
5
  ctxSymbol
6
- } from "./chunk-5LLJ22IG.mjs";
6
+ } from "./chunk-BNCT7NOR.mjs";
7
7
  import {
8
8
  BuildSchemaError
9
- } from "./chunk-NP64RC7B.mjs";
9
+ } from "./chunk-FGZKNBDP.mjs";
10
10
 
11
11
  // src/schemas/ObjectSchema.ts
12
12
  var ObjectSchema = class extends CommonSchema {
@@ -50,4 +50,4 @@ var ObjectSchema = class extends CommonSchema {
50
50
  export {
51
51
  ObjectSchema
52
52
  };
53
- //# sourceMappingURL=chunk-5HT3PYSG.mjs.map
53
+ //# sourceMappingURL=chunk-YUMUCQKL.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/schemas/ObjectSchema.ts"],"sourcesContent":["import { ctxSymbol } from '../helpers/core';\nimport { BuildSchemaError } from '../exceptions';\nimport { CommonSchema, ObjectShapeSchemaType, ValidatorContext } from './CommonSchema';\n\nexport class ObjectSchema extends CommonSchema {\n protected _object = 1;\n constructor(ctx: ValidatorContext, shapeSchema: ObjectShapeSchemaType) {\n super(ctx);\n this.validateObjectEntry(shapeSchema);\n this[ctxSymbol].object = shapeSchema;\n }\n\n private validateObjectEntry(shapeSchema: ObjectShapeSchemaType) {\n if (!shapeSchema) throw new BuildSchemaError('Missing schema in object method');\n if (shapeSchema instanceof CommonSchema) throw new BuildSchemaError('Invalid schema in object');\n for (const [key, value] of Object.entries(shapeSchema)) {\n if (!(value instanceof CommonSchema))\n throw new BuildSchemaError(`Invalid schema in object method for property '${key}'`);\n }\n }\n\n /**\n * Allows unrecognized properties in the validated object.\n * When this method is called, the validation will not fail\n * if the received object contains properties not specified\n * in the validation schema.\n *\n * @returns {this} The current ObjectSchema instance.\n *\n * @example\n * const userSchema = object({\n * name: string(),\n * age: number(),\n * }).allowUnrecognized();\n *\n * parseOrFail(userSchema, ({ name: 'John', age: 30, extra: 'value' }););\n * // No error thrown\n */\n public allowUnrecognized(): this {\n this[ctxSymbol].allowUnrecognizedObjectProps = true;\n return this;\n }\n}\n\nexport type WithObject<Y extends ObjectShapeSchemaType> = ObjectSchema & { validation_object: Y };\n"],"mappings":";;;;;;;;;;;AAIO,IAAM,eAAN,cAA2B,aAAa;AAAA,EACnC,UAAU;AAAA,EACpB,YAAY,KAAuB,aAAoC;AACrE,UAAM,GAAG;AACT,SAAK,oBAAoB,WAAW;AACpC,SAAK,SAAS,EAAE,SAAS;AAAA,EAC3B;AAAA,EAEQ,oBAAoB,aAAoC;AAC9D,QAAI,CAAC,YAAa,OAAM,IAAI,iBAAiB,iCAAiC;AAC9E,QAAI,uBAAuB,aAAc,OAAM,IAAI,iBAAiB,0BAA0B;AAC9F,eAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,WAAW,GAAG;AACtD,UAAI,EAAE,iBAAiB;AACrB,cAAM,IAAI,iBAAiB,iDAAiD,GAAG,GAAG;AAAA,IACtF;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAmBO,oBAA0B;AAC/B,SAAK,SAAS,EAAE,+BAA+B;AAC/C,WAAO;AAAA,EACT;AACF;","names":[]}
1
+ {"version":3,"sources":["../src/schemas/ObjectSchema.ts"],"sourcesContent":["import { ctxSymbol } from '../helpers/core';\nimport { BuildSchemaError } from '../exceptions';\nimport { CommonSchema, ObjectShapeSchemaType, ValidatorContext } from './CommonSchema';\n\nexport class ObjectSchema extends CommonSchema {\n protected _object = 1;\n constructor(ctx: ValidatorContext, shapeSchema: ObjectShapeSchemaType) {\n super(ctx);\n this.validateObjectEntry(shapeSchema);\n this[ctxSymbol].object = shapeSchema;\n }\n\n private validateObjectEntry(shapeSchema: ObjectShapeSchemaType) {\n if (!shapeSchema) throw new BuildSchemaError('Missing schema in object method');\n if (shapeSchema instanceof CommonSchema) throw new BuildSchemaError('Invalid schema in object');\n for (const [key, value] of Object.entries(shapeSchema)) {\n if (!(value instanceof CommonSchema))\n throw new BuildSchemaError(`Invalid schema in object method for property '${key}'`);\n }\n }\n\n /**\n * Allows unrecognized properties in the validated object.\n * When this method is called, the validation will not fail\n * if the received object contains properties not specified\n * in the validation schema.\n *\n * @returns {this} The current ObjectSchema instance.\n *\n * @example\n * const userSchema = object({\n * name: string(),\n * age: number(),\n * }).allowUnrecognized();\n *\n * parseOrFail(userSchema, ({ name: 'John', age: 30, extra: 'value' }););\n * // No error thrown\n */\n public allowUnrecognized(): this {\n this[ctxSymbol].allowUnrecognizedObjectProps = true;\n return this;\n }\n}\n"],"mappings":";;;;;;;;;;;AAIO,IAAM,eAAN,cAA2B,aAAa;AAAA,EACnC,UAAU;AAAA,EACpB,YAAY,KAAuB,aAAoC;AACrE,UAAM,GAAG;AACT,SAAK,oBAAoB,WAAW;AACpC,SAAK,SAAS,EAAE,SAAS;AAAA,EAC3B;AAAA,EAEQ,oBAAoB,aAAoC;AAC9D,QAAI,CAAC,YAAa,OAAM,IAAI,iBAAiB,iCAAiC;AAC9E,QAAI,uBAAuB,aAAc,OAAM,IAAI,iBAAiB,0BAA0B;AAC9F,eAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,WAAW,GAAG;AACtD,UAAI,EAAE,iBAAiB;AACrB,cAAM,IAAI,iBAAiB,iDAAiD,GAAG,GAAG;AAAA,IACtF;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAmBO,oBAA0B;AAC/B,SAAK,SAAS,EAAE,+BAA+B;AAC/C,WAAO;AAAA,EACT;AACF;","names":[]}
@@ -1,24 +1,24 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); var _class;
2
2
 
3
- var _chunkSPWF5IFUjs = require('./chunk-SPWF5IFU.js');
3
+ var _chunkHP3DRZWKjs = require('./chunk-HP3DRZWK.js');
4
4
 
5
5
 
6
- var _chunkW2GOLG3Kjs = require('./chunk-W2GOLG3K.js');
6
+ var _chunkIZ3CBVEEjs = require('./chunk-IZ3CBVEE.js');
7
7
 
8
8
 
9
9
  var _chunk42J6CHIOjs = require('./chunk-42J6CHIO.js');
10
10
 
11
11
 
12
- var _chunk3ZPLJ5KCjs = require('./chunk-3ZPLJ5KC.js');
12
+ var _chunkQIDWASOCjs = require('./chunk-QIDWASOC.js');
13
13
 
14
14
 
15
- var _chunk3IOQH3K4js = require('./chunk-3IOQH3K4.js');
15
+ var _chunkSHJVKSEZjs = require('./chunk-SHJVKSEZ.js');
16
16
 
17
17
 
18
- var _chunkAY7HKAG2js = require('./chunk-AY7HKAG2.js');
18
+ var _chunk5P6AZJCNjs = require('./chunk-5P6AZJCN.js');
19
19
 
20
20
  // src/schemas/StringSchema.ts
21
- var StringSchema = (_class = class extends _chunk3IOQH3K4js.CommonSchema {constructor(...args) { super(...args); _class.prototype.__init.call(this); }
21
+ var StringSchema = (_class = class extends _chunkSHJVKSEZjs.CommonSchema {constructor(...args) { super(...args); _class.prototype.__init.call(this); }
22
22
  __init() {this._string = 1}
23
23
 
24
24
  /**
@@ -31,8 +31,8 @@ var StringSchema = (_class = class extends _chunk3IOQH3K4js.CommonSchema {constr
31
31
  */
32
32
  equalTo(expectedValue) {
33
33
  this.limitCheck();
34
- _chunk3ZPLJ5KCjs._setStrictType.call(void 0, this, `'${expectedValue}'`);
35
- return this.custom(_chunkSPWF5IFUjs.equalTo.call(void 0, expectedValue));
34
+ _chunkQIDWASOCjs._setStrictType.call(void 0, this, `'${expectedValue}'`);
35
+ return this.custom(_chunkHP3DRZWKjs.equalTo.call(void 0, expectedValue));
36
36
  }
37
37
  /**
38
38
  * Restricts the schema to match one of the specified values and infers the union of those values as the TypeScript type.
@@ -45,14 +45,14 @@ var StringSchema = (_class = class extends _chunk3IOQH3K4js.CommonSchema {constr
45
45
  */
46
46
  oneOfValues(expectedValue) {
47
47
  this.limitCheck();
48
- _chunk3ZPLJ5KCjs._setStrictType.call(void 0,
48
+ _chunkQIDWASOCjs._setStrictType.call(void 0,
49
49
  this,
50
50
  expectedValue.map((el) => `'${el}'`)
51
51
  );
52
- return this.custom(_chunkW2GOLG3Kjs.oneOfValues.call(void 0, expectedValue));
52
+ return this.custom(_chunkIZ3CBVEEjs.oneOfValues.call(void 0, expectedValue));
53
53
  }
54
54
  limitCheck() {
55
- if (this.limit) throw new (0, _chunkAY7HKAG2js.BuildSchemaError)(_chunk42J6CHIOjs.ONLY_ONCE);
55
+ if (this.limit) throw new (0, _chunk5P6AZJCNjs.BuildSchemaError)(_chunk42J6CHIOjs.ONLY_ONCE);
56
56
  this.limit = true;
57
57
  }
58
58
  }, _class);
@@ -60,4 +60,4 @@ var StringSchema = (_class = class extends _chunk3IOQH3K4js.CommonSchema {constr
60
60
 
61
61
 
62
62
  exports.StringSchema = StringSchema;
63
- //# sourceMappingURL=chunk-2D5QE7F4.js.map
63
+ //# sourceMappingURL=chunk-Z6QU36MM.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/runner/work/bguard/bguard/lib/chunk-Z6QU36MM.js","../src/schemas/StringSchema.ts"],"names":[],"mappings":"AAAA;AACE;AACF,sDAA4B;AAC5B;AACE;AACF,sDAA4B;AAC5B;AACE;AACF,sDAA4B;AAC5B;AACE;AACF,sDAA4B;AAC5B;AACE;AACF,sDAA4B;AAC5B;AACE;AACF,sDAA4B;AAC5B;AACA;ACXO,IAAM,aAAA,YAAN,MAAA,QAA2B,8BAAa;AAAA,iBACnC,QAAA,EAAU,EAAA;AAAA,EACZ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUD,OAAA,CAA0B,aAAA,EAA2C;AAC1E,IAAA,IAAA,CAAK,UAAA,CAAW,CAAA;AAChB,IAAA,6CAAA,IAAe,EAAM,CAAA,CAAA,EAAI,aAAa,CAAA,CAAA,CAAG,CAAA;AAEzC,IAAA,OAAO,IAAA,CAAK,MAAA,CAAO,sCAAA,aAAqB,CAAC,CAAA;AAAA,EAC3C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWO,WAAA,CAA8B,aAAA,EAA6C;AAChF,IAAA,IAAA,CAAK,UAAA,CAAW,CAAA;AAChB,IAAA,6CAAA;AAAA,MACE,IAAA;AAAA,MACA,aAAA,CAAc,GAAA,CAAI,CAAC,EAAA,EAAA,GAAO,CAAA,CAAA,EAAI,EAAE,CAAA,CAAA,CAAG;AAAA,IACrC,CAAA;AACA,IAAA,OAAO,IAAA,CAAK,MAAA,CAAO,0CAAA,aAAyB,CAAC,CAAA;AAAA,EAC/C;AAAA,EAEQ,UAAA,CAAA,EAAa;AACnB,IAAA,GAAA,CAAI,IAAA,CAAK,KAAA,EAAO,MAAM,IAAI,sCAAA,CAAiB,0BAAS,CAAA;AACpD,IAAA,IAAA,CAAK,MAAA,EAAQ,IAAA;AAAA,EACf;AACF,UAAA;ADSA;AACA;AACE;AACF,oCAAC","file":"/home/runner/work/bguard/bguard/lib/chunk-Z6QU36MM.js","sourcesContent":[null,"import { equalTo } from '../asserts/mix/equalTo';\nimport { oneOfValues } from '../asserts/mix/oneOfValues';\nimport { WithBGuardType } from '../commonTypes';\nimport { BuildSchemaError } from '../exceptions';\nimport { ONLY_ONCE } from '../helpers/constants';\nimport { _setStrictType } from '../helpers/setStrictType';\nimport { CommonSchema } from './CommonSchema';\n\nexport class StringSchema extends CommonSchema {\n protected _string = 1;\n private limit: boolean | undefined;\n\n /**\n * Restricts the schema to exactly match the specified value and infers the literal value as the TypeScript type.\n *\n * @param expectedValue - The value that the schema must exactly match.\n * @returns - The schema instance restricted to the specified value, with the literal value inferred as the TypeScript type\n *\n * @example - string().equalTo('hello'); // Infers the type 'hello'\n */\n public equalTo<Y extends string>(expectedValue: Y): WithBGuardType<this, Y> {\n this.limitCheck();\n _setStrictType(this, `'${expectedValue}'`);\n\n return this.custom(equalTo(expectedValue)) as WithBGuardType<this, Y>;\n }\n\n /**\n * Restricts the schema to match one of the specified values and infers the union of those values as the TypeScript type.\n *\n * @param expectedValues - An array of values that the schema can match.\n * @returns - The schema instance restricted to one of the specified values, with the union of those values inferred as the TypeScript type.\n *\n * @example\n * string().oneOfValues(['foo', 'bar']); // Infers the type 'foo' | 'bar'\n */\n public oneOfValues<Y extends string>(expectedValue: Y[]): WithBGuardType<this, Y> {\n this.limitCheck();\n _setStrictType(\n this,\n expectedValue.map((el) => `'${el}'`),\n );\n return this.custom(oneOfValues(expectedValue)) as WithBGuardType<this, Y>;\n }\n\n private limitCheck() {\n if (this.limit) throw new BuildSchemaError(ONLY_ONCE);\n this.limit = true;\n }\n}\n"]}
package/lib/codeGen.d.mts CHANGED
@@ -1,4 +1,5 @@
1
- import { C as CommonSchema } from './CommonSchema-CiY7spmg.mjs';
1
+ import { C as CommonSchema } from './CommonSchema-wi9MOXGF.mjs';
2
+ import './InferType.mjs';
2
3
  import './commonTypes.mjs';
3
4
 
4
5
  declare function codeGen(schema: CommonSchema): string;
package/lib/codeGen.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- import { C as CommonSchema } from './CommonSchema-D9QVJBJe.js';
1
+ import { C as CommonSchema } from './CommonSchema-DOh3bsL-.js';
2
+ import './InferType.js';
2
3
  import './commonTypes.js';
3
4
 
4
5
  declare function codeGen(schema: CommonSchema): string;
package/lib/codeGen.js CHANGED
@@ -1,8 +1,8 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkPIBDJJUUjs = require('./chunk-PIBDJJUU.js');
3
+ var _chunkX762EUSZjs = require('./chunk-X762EUSZ.js');
4
4
  require('./chunk-VBTWYDEM.js');
5
- require('./chunk-AY7HKAG2.js');
5
+ require('./chunk-5P6AZJCN.js');
6
6
 
7
7
  // src/codeGen.ts
8
8
  function generateBaseType(schemaData) {
@@ -17,7 +17,7 @@ function generateBaseType(schemaData) {
17
17
  }
18
18
  var INDENT_DEFAULT = ` `;
19
19
  function innerGenerator(schema, isProperty, indent = INDENT_DEFAULT) {
20
- const schemaData = schema[_chunkPIBDJJUUjs.ctxSymbol];
20
+ const schemaData = schema[_chunkX762EUSZjs.ctxSymbol];
21
21
  let code = "";
22
22
  if (isProperty) {
23
23
  code = code + (schemaData.isOptional ? "?: " : ": ");
package/lib/codeGen.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  ctxSymbol
3
- } from "./chunk-5LLJ22IG.mjs";
3
+ } from "./chunk-BNCT7NOR.mjs";
4
4
  import "./chunk-YBVMP4EI.mjs";
5
- import "./chunk-NP64RC7B.mjs";
5
+ import "./chunk-FGZKNBDP.mjs";
6
6
 
7
7
  // src/codeGen.ts
8
8
  function generateBaseType(schemaData) {
@@ -16,9 +16,15 @@ interface ValidationErrorData {
16
16
  expected: unknown;
17
17
  received: unknown;
18
18
  pathToError: string;
19
+ meta?: MetaContext;
20
+ }
21
+ interface MetaContext {
22
+ id?: string;
23
+ description?: string;
19
24
  }
20
25
  type ExceptionContext = {
21
26
  pathToError: string;
27
+ meta?: MetaContext;
22
28
  t: TranslationErrorMap;
23
29
  } & ({
24
30
  getAllErrors?: false;
@@ -27,6 +33,24 @@ type ExceptionContext = {
27
33
  errors: ValidationErrorData[];
28
34
  });
29
35
  type RequiredValidation = (received: any, ctx: ExceptionContext) => void;
30
- type PrimitiveType = 'number' | 'string' | 'boolean' | 'undefined' | 'object' | 'function' | 'symbol' | 'bigint';
36
+ type BaseType = 'number' | 'string' | 'boolean' | 'undefined' | 'object' | 'function' | 'symbol' | 'bigint';
37
+ type WithBGuardType<T, Y> = T & {
38
+ validation_bguard: Y;
39
+ };
40
+ type ExtractFromBGuardType<T> = T extends WithBGuardType<unknown, infer Y> ? Y : never;
41
+ type WithNull<T> = T & {
42
+ validation_null: true;
43
+ };
44
+ type WithUndefined<T> = T & {
45
+ validation_undefined: true;
46
+ };
47
+ type WithArray<T, Y> = T & {
48
+ validation_array: Y;
49
+ };
50
+ type ExtractFromArray<T> = T extends WithArray<unknown, infer X> ? X : never;
51
+ type WithObject<T, Y> = T & {
52
+ validation_object: Y;
53
+ };
54
+ type TransformCallback<In = unknown, Out = unknown> = (val: In) => Out;
31
55
 
32
- export type { ExceptionContext, PrimitiveType, RequiredValidation, TranslationErrorMap, ValidationErrorData };
56
+ export type { BaseType, ExceptionContext, ExtractFromArray, ExtractFromBGuardType, MetaContext, RequiredValidation, TransformCallback, TranslationErrorMap, ValidationErrorData, WithArray, WithBGuardType, WithNull, WithObject, WithUndefined };
@@ -16,9 +16,15 @@ interface ValidationErrorData {
16
16
  expected: unknown;
17
17
  received: unknown;
18
18
  pathToError: string;
19
+ meta?: MetaContext;
20
+ }
21
+ interface MetaContext {
22
+ id?: string;
23
+ description?: string;
19
24
  }
20
25
  type ExceptionContext = {
21
26
  pathToError: string;
27
+ meta?: MetaContext;
22
28
  t: TranslationErrorMap;
23
29
  } & ({
24
30
  getAllErrors?: false;
@@ -27,6 +33,24 @@ type ExceptionContext = {
27
33
  errors: ValidationErrorData[];
28
34
  });
29
35
  type RequiredValidation = (received: any, ctx: ExceptionContext) => void;
30
- type PrimitiveType = 'number' | 'string' | 'boolean' | 'undefined' | 'object' | 'function' | 'symbol' | 'bigint';
36
+ type BaseType = 'number' | 'string' | 'boolean' | 'undefined' | 'object' | 'function' | 'symbol' | 'bigint';
37
+ type WithBGuardType<T, Y> = T & {
38
+ validation_bguard: Y;
39
+ };
40
+ type ExtractFromBGuardType<T> = T extends WithBGuardType<unknown, infer Y> ? Y : never;
41
+ type WithNull<T> = T & {
42
+ validation_null: true;
43
+ };
44
+ type WithUndefined<T> = T & {
45
+ validation_undefined: true;
46
+ };
47
+ type WithArray<T, Y> = T & {
48
+ validation_array: Y;
49
+ };
50
+ type ExtractFromArray<T> = T extends WithArray<unknown, infer X> ? X : never;
51
+ type WithObject<T, Y> = T & {
52
+ validation_object: Y;
53
+ };
54
+ type TransformCallback<In = unknown, Out = unknown> = (val: In) => Out;
31
55
 
32
- export type { ExceptionContext, PrimitiveType, RequiredValidation, TranslationErrorMap, ValidationErrorData };
56
+ export type { BaseType, ExceptionContext, ExtractFromArray, ExtractFromBGuardType, MetaContext, RequiredValidation, TransformCallback, TranslationErrorMap, ValidationErrorData, WithArray, WithBGuardType, WithNull, WithObject, WithUndefined };
@@ -1,11 +1,12 @@
1
- import { ExceptionContext } from './commonTypes.mjs';
1
+ import { MetaContext, ExceptionContext } from './commonTypes.mjs';
2
2
 
3
3
  declare class ValidationError extends Error {
4
4
  expected: unknown;
5
5
  received: unknown;
6
6
  pathToError: string;
7
7
  message: string;
8
- constructor(expected: unknown, received: unknown, pathToError: string, message: string);
8
+ meta?: MetaContext;
9
+ constructor(expected: unknown, received: unknown, pathToError: string, message: string, meta?: MetaContext);
9
10
  }
10
11
  declare class BuildSchemaError extends Error {
11
12
  }
@@ -1,11 +1,12 @@
1
- import { ExceptionContext } from './commonTypes.js';
1
+ import { MetaContext, ExceptionContext } from './commonTypes.js';
2
2
 
3
3
  declare class ValidationError extends Error {
4
4
  expected: unknown;
5
5
  received: unknown;
6
6
  pathToError: string;
7
7
  message: string;
8
- constructor(expected: unknown, received: unknown, pathToError: string, message: string);
8
+ meta?: MetaContext;
9
+ constructor(expected: unknown, received: unknown, pathToError: string, message: string, meta?: MetaContext);
9
10
  }
10
11
  declare class BuildSchemaError extends Error {
11
12
  }
package/lib/exceptions.js CHANGED
@@ -2,10 +2,10 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkAY7HKAG2js = require('./chunk-AY7HKAG2.js');
5
+ var _chunk5P6AZJCNjs = require('./chunk-5P6AZJCN.js');
6
6
 
7
7
 
8
8
 
9
9
 
10
- exports.BuildSchemaError = _chunkAY7HKAG2js.BuildSchemaError; exports.ValidationError = _chunkAY7HKAG2js.ValidationError; exports.guardException = _chunkAY7HKAG2js.guardException;
10
+ exports.BuildSchemaError = _chunk5P6AZJCNjs.BuildSchemaError; exports.ValidationError = _chunk5P6AZJCNjs.ValidationError; exports.guardException = _chunk5P6AZJCNjs.guardException;
11
11
  //# sourceMappingURL=exceptions.js.map
@@ -2,7 +2,7 @@ import {
2
2
  BuildSchemaError,
3
3
  ValidationError,
4
4
  guardException
5
- } from "./chunk-NP64RC7B.mjs";
5
+ } from "./chunk-FGZKNBDP.mjs";
6
6
  export {
7
7
  BuildSchemaError,
8
8
  ValidationError,
@@ -1,2 +1,3 @@
1
1
  import '../commonTypes.mjs';
2
- export { c as ctxSymbol, i as innerCheck } from '../CommonSchema-CiY7spmg.mjs';
2
+ export { c as ctxSymbol, i as innerCheck } from '../CommonSchema-wi9MOXGF.mjs';
3
+ import '../InferType.mjs';
@@ -1,2 +1,3 @@
1
1
  import '../commonTypes.js';
2
- export { c as ctxSymbol, i as innerCheck } from '../CommonSchema-D9QVJBJe.js';
2
+ export { c as ctxSymbol, i as innerCheck } from '../CommonSchema-DOh3bsL-.js';
3
+ import '../InferType.js';
@@ -1,11 +1,11 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
3
 
4
- var _chunkPIBDJJUUjs = require('../chunk-PIBDJJUU.js');
4
+ var _chunkX762EUSZjs = require('../chunk-X762EUSZ.js');
5
5
  require('../chunk-VBTWYDEM.js');
6
- require('../chunk-AY7HKAG2.js');
6
+ require('../chunk-5P6AZJCN.js');
7
7
 
8
8
 
9
9
 
10
- exports.ctxSymbol = _chunkPIBDJJUUjs.ctxSymbol; exports.innerCheck = _chunkPIBDJJUUjs.innerCheck;
10
+ exports.ctxSymbol = _chunkX762EUSZjs.ctxSymbol; exports.innerCheck = _chunkX762EUSZjs.innerCheck;
11
11
  //# sourceMappingURL=core.js.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  ctxSymbol,
3
3
  innerCheck
4
- } from "../chunk-5LLJ22IG.mjs";
4
+ } from "../chunk-BNCT7NOR.mjs";
5
5
  import "../chunk-YBVMP4EI.mjs";
6
- import "../chunk-NP64RC7B.mjs";
6
+ import "../chunk-FGZKNBDP.mjs";
7
7
  export {
8
8
  ctxSymbol,
9
9
  innerCheck
@@ -1,4 +1,5 @@
1
- import { C as CommonSchema } from '../CommonSchema-CiY7spmg.mjs';
1
+ import { C as CommonSchema } from '../CommonSchema-wi9MOXGF.mjs';
2
+ import '../InferType.mjs';
2
3
  import '../commonTypes.mjs';
3
4
 
4
5
  declare function _setStrictType(that: CommonSchema, val: unknown): void;
@@ -1,4 +1,5 @@
1
- import { C as CommonSchema } from '../CommonSchema-D9QVJBJe.js';
1
+ import { C as CommonSchema } from '../CommonSchema-DOh3bsL-.js';
2
+ import '../InferType.js';
2
3
  import '../commonTypes.js';
3
4
 
4
5
  declare function _setStrictType(that: CommonSchema, val: unknown): void;
@@ -1,10 +1,10 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunk3ZPLJ5KCjs = require('../chunk-3ZPLJ5KC.js');
4
- require('../chunk-PIBDJJUU.js');
3
+ var _chunkQIDWASOCjs = require('../chunk-QIDWASOC.js');
4
+ require('../chunk-X762EUSZ.js');
5
5
  require('../chunk-VBTWYDEM.js');
6
- require('../chunk-AY7HKAG2.js');
6
+ require('../chunk-5P6AZJCN.js');
7
7
 
8
8
 
9
- exports._setStrictType = _chunk3ZPLJ5KCjs._setStrictType;
9
+ exports._setStrictType = _chunkQIDWASOCjs._setStrictType;
10
10
  //# sourceMappingURL=setStrictType.js.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  _setStrictType
3
- } from "../chunk-D42ISCFK.mjs";
4
- import "../chunk-5LLJ22IG.mjs";
3
+ } from "../chunk-H6LHV3EA.mjs";
4
+ import "../chunk-BNCT7NOR.mjs";
5
5
  import "../chunk-YBVMP4EI.mjs";
6
- import "../chunk-NP64RC7B.mjs";
6
+ import "../chunk-FGZKNBDP.mjs";
7
7
  export {
8
8
  _setStrictType
9
9
  };
package/lib/index.d.mts CHANGED
@@ -3,12 +3,5 @@ export { parse } from './parse.mjs';
3
3
  export { parseOrFail } from './parseOrFail.mjs';
4
4
  export { BuildSchemaError, ValidationError, guardException } from './exceptions.mjs';
5
5
  export { clearLocales, setLocale, setToDefaultLocale } from './translationMap.mjs';
6
- import './schemas/ArraySchema.mjs';
7
- import './CommonSchema-CiY7spmg.mjs';
8
6
  import './commonTypes.mjs';
9
- import './schemas/BigIntSchema.mjs';
10
- import './schemas/BooleanSchema.mjs';
11
- import './schemas/DateSchema.mjs';
12
- import './schemas/NumberSchema.mjs';
13
- import './schemas/ObjectSchema.mjs';
14
- import './schemas/StringSchema.mjs';
7
+ import './CommonSchema-wi9MOXGF.mjs';
package/lib/index.d.ts CHANGED
@@ -3,12 +3,5 @@ export { parse } from './parse.js';
3
3
  export { parseOrFail } from './parseOrFail.js';
4
4
  export { BuildSchemaError, ValidationError, guardException } from './exceptions.js';
5
5
  export { clearLocales, setLocale, setToDefaultLocale } from './translationMap.js';
6
- import './schemas/ArraySchema.js';
7
- import './CommonSchema-D9QVJBJe.js';
8
6
  import './commonTypes.js';
9
- import './schemas/BigIntSchema.js';
10
- import './schemas/BooleanSchema.js';
11
- import './schemas/DateSchema.js';
12
- import './schemas/NumberSchema.js';
13
- import './schemas/ObjectSchema.js';
14
- import './schemas/StringSchema.js';
7
+ import './CommonSchema-DOh3bsL-.js';
package/lib/index.js CHANGED
@@ -1,21 +1,21 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkAN3VHQEQjs = require('./chunk-AN3VHQEQ.js');
3
+ var _chunk5WHCMWXKjs = require('./chunk-5WHCMWXK.js');
4
4
 
5
5
 
6
- var _chunkPESVL5YJjs = require('./chunk-PESVL5YJ.js');
7
- require('./chunk-PIBDJJUU.js');
6
+ var _chunkG55SHHARjs = require('./chunk-G55SHHAR.js');
7
+ require('./chunk-X762EUSZ.js');
8
8
  require('./chunk-VBTWYDEM.js');
9
9
 
10
10
 
11
11
 
12
12
 
13
- var _chunkUZ2PWO4Ojs = require('./chunk-UZ2PWO4O.js');
13
+ var _chunk5YYRBKDPjs = require('./chunk-5YYRBKDP.js');
14
14
 
15
15
 
16
16
 
17
17
 
18
- var _chunkAY7HKAG2js = require('./chunk-AY7HKAG2.js');
18
+ var _chunk5P6AZJCNjs = require('./chunk-5P6AZJCN.js');
19
19
 
20
20
 
21
21
 
@@ -25,5 +25,5 @@ var _chunkAY7HKAG2js = require('./chunk-AY7HKAG2.js');
25
25
 
26
26
 
27
27
 
28
- exports.BuildSchemaError = _chunkAY7HKAG2js.BuildSchemaError; exports.ValidationError = _chunkAY7HKAG2js.ValidationError; exports.clearLocales = _chunkUZ2PWO4Ojs.clearLocales; exports.guardException = _chunkAY7HKAG2js.guardException; exports.parse = _chunkAN3VHQEQjs.parse; exports.parseOrFail = _chunkPESVL5YJjs.parseOrFail; exports.setLocale = _chunkUZ2PWO4Ojs.setLocale; exports.setToDefaultLocale = _chunkUZ2PWO4Ojs.setToDefaultLocale;
28
+ exports.BuildSchemaError = _chunk5P6AZJCNjs.BuildSchemaError; exports.ValidationError = _chunk5P6AZJCNjs.ValidationError; exports.clearLocales = _chunk5YYRBKDPjs.clearLocales; exports.guardException = _chunk5P6AZJCNjs.guardException; exports.parse = _chunk5WHCMWXKjs.parse; exports.parseOrFail = _chunkG55SHHARjs.parseOrFail; exports.setLocale = _chunk5YYRBKDPjs.setLocale; exports.setToDefaultLocale = _chunk5YYRBKDPjs.setToDefaultLocale;
29
29
  //# sourceMappingURL=index.js.map
package/lib/index.mjs CHANGED
@@ -1,21 +1,21 @@
1
1
  import {
2
2
  parse
3
- } from "./chunk-OKF3BVUD.mjs";
3
+ } from "./chunk-TV5IZY4L.mjs";
4
4
  import {
5
5
  parseOrFail
6
- } from "./chunk-ADSMWGDJ.mjs";
7
- import "./chunk-5LLJ22IG.mjs";
6
+ } from "./chunk-TRGMD7LA.mjs";
7
+ import "./chunk-BNCT7NOR.mjs";
8
8
  import "./chunk-YBVMP4EI.mjs";
9
9
  import {
10
10
  clearLocales,
11
11
  setLocale,
12
12
  setToDefaultLocale
13
- } from "./chunk-4GDBM5LP.mjs";
13
+ } from "./chunk-H32B3NHW.mjs";
14
14
  import {
15
15
  BuildSchemaError,
16
16
  ValidationError,
17
17
  guardException
18
- } from "./chunk-NP64RC7B.mjs";
18
+ } from "./chunk-FGZKNBDP.mjs";
19
19
  export {
20
20
  BuildSchemaError,
21
21
  ValidationError,
package/lib/parse.d.mts CHANGED
@@ -1,13 +1,6 @@
1
1
  import { InferType } from './InferType.mjs';
2
- import { C as CommonSchema } from './CommonSchema-CiY7spmg.mjs';
2
+ import { C as CommonSchema } from './CommonSchema-wi9MOXGF.mjs';
3
3
  import { ValidationErrorData } from './commonTypes.mjs';
4
- import './schemas/ArraySchema.mjs';
5
- import './schemas/BigIntSchema.mjs';
6
- import './schemas/BooleanSchema.mjs';
7
- import './schemas/DateSchema.mjs';
8
- import './schemas/NumberSchema.mjs';
9
- import './schemas/ObjectSchema.mjs';
10
- import './schemas/StringSchema.mjs';
11
4
 
12
5
  interface ParseOptions {
13
6
  /**