bguard 0.0.4 → 0.0.6

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 (239) hide show
  1. package/lib/{CommonSchema-DeTBsQhn.d.mts → CommonSchema-BIe85W_A.d.mts} +3 -1
  2. package/lib/{CommonSchema-DeTBsQhn.d.ts → CommonSchema-BIe85W_A.d.ts} +3 -1
  3. package/lib/InferType.d.mts +18 -0
  4. package/lib/InferType.d.ts +18 -0
  5. package/lib/InferType.js +1 -0
  6. package/lib/InferType.js.map +1 -0
  7. package/lib/InferType.mjs +1 -0
  8. package/lib/InferType.mjs.map +1 -0
  9. package/lib/asserts/array/index.d.mts +18 -2
  10. package/lib/asserts/array/index.d.ts +18 -2
  11. package/lib/asserts/array/index.js +7 -86
  12. package/lib/asserts/array/index.js.map +1 -1
  13. package/lib/asserts/array/index.mjs +7 -59
  14. package/lib/asserts/array/index.mjs.map +1 -1
  15. package/lib/asserts/boolean/index.d.mts +16 -2
  16. package/lib/asserts/boolean/index.d.ts +16 -2
  17. package/lib/asserts/boolean/index.js +7 -114
  18. package/lib/asserts/boolean/index.js.map +1 -1
  19. package/lib/asserts/boolean/index.mjs +7 -87
  20. package/lib/asserts/boolean/index.mjs.map +1 -1
  21. package/lib/asserts/common/equalTo.d.mts +1 -1
  22. package/lib/asserts/common/equalTo.d.ts +1 -1
  23. package/lib/asserts/common/equalTo.js +4 -50
  24. package/lib/asserts/common/equalTo.js.map +1 -1
  25. package/lib/asserts/common/equalTo.mjs +4 -23
  26. package/lib/asserts/common/equalTo.mjs.map +1 -1
  27. package/lib/asserts/common/index.d.mts +1 -1
  28. package/lib/asserts/common/index.d.ts +1 -1
  29. package/lib/asserts/common/index.js +6 -68
  30. package/lib/asserts/common/index.js.map +1 -1
  31. package/lib/asserts/common/index.mjs +6 -41
  32. package/lib/asserts/common/index.mjs.map +1 -1
  33. package/lib/asserts/number/index.d.mts +16 -2
  34. package/lib/asserts/number/index.d.ts +16 -2
  35. package/lib/asserts/number/index.js +8 -108
  36. package/lib/asserts/number/index.js.map +1 -1
  37. package/lib/asserts/number/index.mjs +8 -81
  38. package/lib/asserts/number/index.mjs.map +1 -1
  39. package/lib/asserts/number/max.d.mts +1 -1
  40. package/lib/asserts/number/max.d.ts +1 -1
  41. package/lib/asserts/number/max.js +6 -47
  42. package/lib/asserts/number/max.js.map +1 -1
  43. package/lib/asserts/number/max.mjs +3 -17
  44. package/lib/asserts/number/max.mjs.map +1 -1
  45. package/lib/asserts/number/maxExcluded.d.mts +1 -1
  46. package/lib/asserts/number/maxExcluded.d.ts +1 -1
  47. package/lib/asserts/number/maxExcluded.js +6 -47
  48. package/lib/asserts/number/maxExcluded.js.map +1 -1
  49. package/lib/asserts/number/maxExcluded.mjs +3 -17
  50. package/lib/asserts/number/maxExcluded.mjs.map +1 -1
  51. package/lib/asserts/number/min.d.mts +1 -1
  52. package/lib/asserts/number/min.d.ts +1 -1
  53. package/lib/asserts/number/min.js +6 -47
  54. package/lib/asserts/number/min.js.map +1 -1
  55. package/lib/asserts/number/min.mjs +3 -17
  56. package/lib/asserts/number/min.mjs.map +1 -1
  57. package/lib/asserts/number/minExcluded.d.mts +1 -1
  58. package/lib/asserts/number/minExcluded.d.ts +1 -1
  59. package/lib/asserts/number/minExcluded.js +6 -47
  60. package/lib/asserts/number/minExcluded.js.map +1 -1
  61. package/lib/asserts/number/minExcluded.mjs +3 -17
  62. package/lib/asserts/number/minExcluded.mjs.map +1 -1
  63. package/lib/asserts/number/negative.d.mts +1 -1
  64. package/lib/asserts/number/negative.d.ts +1 -1
  65. package/lib/asserts/number/negative.js +6 -47
  66. package/lib/asserts/number/negative.js.map +1 -1
  67. package/lib/asserts/number/negative.mjs +3 -17
  68. package/lib/asserts/number/negative.mjs.map +1 -1
  69. package/lib/asserts/number/positive.d.mts +1 -1
  70. package/lib/asserts/number/positive.d.ts +1 -1
  71. package/lib/asserts/number/positive.js +6 -47
  72. package/lib/asserts/number/positive.js.map +1 -1
  73. package/lib/asserts/number/positive.mjs +3 -17
  74. package/lib/asserts/number/positive.mjs.map +1 -1
  75. package/lib/asserts/object/index.d.mts +21 -2
  76. package/lib/asserts/object/index.d.ts +21 -2
  77. package/lib/asserts/object/index.js +7 -90
  78. package/lib/asserts/object/index.js.map +1 -1
  79. package/lib/asserts/object/index.mjs +7 -63
  80. package/lib/asserts/object/index.mjs.map +1 -1
  81. package/lib/asserts/string/email.d.mts +1 -1
  82. package/lib/asserts/string/email.d.ts +1 -1
  83. package/lib/asserts/string/email.js +6 -47
  84. package/lib/asserts/string/email.js.map +1 -1
  85. package/lib/asserts/string/email.mjs +3 -17
  86. package/lib/asserts/string/email.mjs.map +1 -1
  87. package/lib/asserts/string/index.d.mts +16 -2
  88. package/lib/asserts/string/index.d.ts +16 -2
  89. package/lib/asserts/string/index.js +8 -108
  90. package/lib/asserts/string/index.js.map +1 -1
  91. package/lib/asserts/string/index.mjs +8 -81
  92. package/lib/asserts/string/index.mjs.map +1 -1
  93. package/lib/asserts/string/maxLength.d.mts +1 -1
  94. package/lib/asserts/string/maxLength.d.ts +1 -1
  95. package/lib/asserts/string/maxLength.js +6 -47
  96. package/lib/asserts/string/maxLength.js.map +1 -1
  97. package/lib/asserts/string/maxLength.mjs +3 -17
  98. package/lib/asserts/string/maxLength.mjs.map +1 -1
  99. package/lib/asserts/string/minLength.d.mts +1 -1
  100. package/lib/asserts/string/minLength.d.ts +1 -1
  101. package/lib/asserts/string/minLength.js +6 -47
  102. package/lib/asserts/string/minLength.js.map +1 -1
  103. package/lib/asserts/string/minLength.mjs +3 -17
  104. package/lib/asserts/string/minLength.mjs.map +1 -1
  105. package/lib/asserts/string/regExp.d.mts +1 -1
  106. package/lib/asserts/string/regExp.d.ts +1 -1
  107. package/lib/asserts/string/regExp.js +6 -47
  108. package/lib/asserts/string/regExp.js.map +1 -1
  109. package/lib/asserts/string/regExp.mjs +3 -17
  110. package/lib/asserts/string/regExp.mjs.map +1 -1
  111. package/lib/chunk-2AP4OQMT.js +26 -0
  112. package/lib/chunk-2AP4OQMT.js.map +1 -0
  113. package/lib/chunk-32IQXZRK.mjs +13 -0
  114. package/lib/chunk-32IQXZRK.mjs.map +1 -0
  115. package/lib/chunk-3FEJUC3K.mjs +13 -0
  116. package/lib/chunk-3FEJUC3K.mjs.map +1 -0
  117. package/lib/chunk-5NCJN6D2.js +70 -0
  118. package/lib/chunk-5NCJN6D2.js.map +1 -0
  119. package/lib/chunk-5ZMICHV3.js +21 -0
  120. package/lib/chunk-5ZMICHV3.js.map +1 -0
  121. package/lib/chunk-63IQFNFO.mjs +27 -0
  122. package/lib/chunk-63IQFNFO.mjs.map +1 -0
  123. package/lib/chunk-A2SAWKJA.mjs +13 -0
  124. package/lib/chunk-A2SAWKJA.mjs.map +1 -0
  125. package/lib/chunk-A3UTB4RE.mjs +28 -0
  126. package/lib/chunk-A3UTB4RE.mjs.map +1 -0
  127. package/lib/chunk-A7I2JEQO.js +13 -0
  128. package/lib/chunk-A7I2JEQO.js.map +1 -0
  129. package/lib/chunk-AJ4WV5DG.mjs +13 -0
  130. package/lib/chunk-AJ4WV5DG.mjs.map +1 -0
  131. package/lib/chunk-APTTIN2L.js +42 -0
  132. package/lib/chunk-APTTIN2L.js.map +1 -0
  133. package/lib/chunk-AXOP6HPJ.js +14 -0
  134. package/lib/chunk-AXOP6HPJ.js.map +1 -0
  135. package/lib/chunk-BGMR7A6X.mjs +13 -0
  136. package/lib/chunk-BGMR7A6X.mjs.map +1 -0
  137. package/lib/chunk-FCFO5J5Y.mjs +14 -0
  138. package/lib/chunk-FCFO5J5Y.mjs.map +1 -0
  139. package/lib/chunk-GEZME6V2.mjs +39 -0
  140. package/lib/chunk-GEZME6V2.mjs.map +1 -0
  141. package/lib/chunk-GNBSKTFV.js +27 -0
  142. package/lib/chunk-GNBSKTFV.js.map +1 -0
  143. package/lib/chunk-IQ3QYABE.js +32 -0
  144. package/lib/chunk-IQ3QYABE.js.map +1 -0
  145. package/lib/chunk-K2S3FS5K.js +13 -0
  146. package/lib/chunk-K2S3FS5K.js.map +1 -0
  147. package/lib/chunk-KCBOOOTF.mjs +13 -0
  148. package/lib/chunk-KCBOOOTF.mjs.map +1 -0
  149. package/lib/chunk-L6A7NXUJ.js +13 -0
  150. package/lib/chunk-L6A7NXUJ.js.map +1 -0
  151. package/lib/chunk-L7HUXYFV.mjs +42 -0
  152. package/lib/chunk-L7HUXYFV.mjs.map +1 -0
  153. package/lib/chunk-LHTJHMKJ.mjs +27 -0
  154. package/lib/chunk-LHTJHMKJ.mjs.map +1 -0
  155. package/lib/chunk-NOADI6PO.mjs +21 -0
  156. package/lib/chunk-NOADI6PO.mjs.map +1 -0
  157. package/lib/chunk-NWY33MFU.js +13 -0
  158. package/lib/chunk-NWY33MFU.js.map +1 -0
  159. package/lib/chunk-P3Y6IWFA.mjs +70 -0
  160. package/lib/chunk-P3Y6IWFA.mjs.map +1 -0
  161. package/lib/chunk-PDVXBE27.js +27 -0
  162. package/lib/chunk-PDVXBE27.js.map +1 -0
  163. package/lib/chunk-PJP63SJT.js +13 -0
  164. package/lib/chunk-PJP63SJT.js.map +1 -0
  165. package/lib/chunk-QJOXKH7A.mjs +26 -0
  166. package/lib/chunk-QJOXKH7A.mjs.map +1 -0
  167. package/lib/chunk-QKGQ4XZC.js +13 -0
  168. package/lib/chunk-QKGQ4XZC.js.map +1 -0
  169. package/lib/chunk-QYLH5ZAC.mjs +32 -0
  170. package/lib/chunk-QYLH5ZAC.mjs.map +1 -0
  171. package/lib/chunk-VPFIIM2X.js +39 -0
  172. package/lib/chunk-VPFIIM2X.js.map +1 -0
  173. package/lib/chunk-YXHH5BF6.js +28 -0
  174. package/lib/chunk-YXHH5BF6.js.map +1 -0
  175. package/lib/core.d.mts +1 -0
  176. package/lib/core.d.ts +1 -0
  177. package/lib/core.js +10 -0
  178. package/lib/core.js.map +1 -0
  179. package/lib/core.mjs +10 -0
  180. package/lib/core.mjs.map +1 -0
  181. package/lib/exceptions.d.mts +12 -0
  182. package/lib/exceptions.d.ts +12 -0
  183. package/lib/exceptions.js +11 -0
  184. package/lib/exceptions.js.map +1 -0
  185. package/lib/exceptions.mjs +11 -0
  186. package/lib/exceptions.mjs.map +1 -0
  187. package/lib/index.d.mts +14 -51
  188. package/lib/index.d.ts +14 -51
  189. package/lib/index.js +29 -277
  190. package/lib/index.js.map +1 -1
  191. package/lib/index.mjs +38 -253
  192. package/lib/index.mjs.map +1 -1
  193. package/lib/parseSchema.d.mts +37 -0
  194. package/lib/parseSchema.d.ts +37 -0
  195. package/lib/parseSchema.js +9 -0
  196. package/lib/parseSchema.js.map +1 -0
  197. package/lib/parseSchema.mjs +9 -0
  198. package/lib/parseSchema.mjs.map +1 -0
  199. package/lib/schemas/ArraySchema.d.mts +13 -0
  200. package/lib/schemas/ArraySchema.d.ts +13 -0
  201. package/lib/schemas/ArraySchema.js +10 -0
  202. package/lib/schemas/ArraySchema.js.map +1 -0
  203. package/lib/schemas/ArraySchema.mjs +10 -0
  204. package/lib/schemas/ArraySchema.mjs.map +1 -0
  205. package/lib/{index-nzqBrOHf.d.mts → schemas/BooleanSchema.d.mts} +2 -14
  206. package/lib/{index-B1yBez0g.d.ts → schemas/BooleanSchema.d.ts} +2 -14
  207. package/lib/schemas/BooleanSchema.js +10 -0
  208. package/lib/schemas/BooleanSchema.js.map +1 -0
  209. package/lib/schemas/BooleanSchema.mjs +10 -0
  210. package/lib/schemas/BooleanSchema.mjs.map +1 -0
  211. package/lib/schemas/CommonSchema.d.mts +1 -0
  212. package/lib/schemas/CommonSchema.d.ts +1 -0
  213. package/lib/schemas/CommonSchema.js +9 -0
  214. package/lib/schemas/CommonSchema.js.map +1 -0
  215. package/lib/schemas/CommonSchema.mjs +9 -0
  216. package/lib/schemas/CommonSchema.mjs.map +1 -0
  217. package/lib/{index-B63cXDOm.d.mts → schemas/NumberSchema.d.mts} +2 -14
  218. package/lib/{index-CK_g_aEC.d.ts → schemas/NumberSchema.d.ts} +2 -14
  219. package/lib/schemas/NumberSchema.js +11 -0
  220. package/lib/schemas/NumberSchema.js.map +1 -0
  221. package/lib/schemas/NumberSchema.mjs +11 -0
  222. package/lib/schemas/NumberSchema.mjs.map +1 -0
  223. package/lib/schemas/ObjectSchema.d.mts +12 -0
  224. package/lib/schemas/ObjectSchema.d.ts +12 -0
  225. package/lib/schemas/ObjectSchema.js +10 -0
  226. package/lib/schemas/ObjectSchema.js.map +1 -0
  227. package/lib/schemas/ObjectSchema.mjs +10 -0
  228. package/lib/schemas/ObjectSchema.mjs.map +1 -0
  229. package/lib/{index-aBEYpJdZ.d.mts → schemas/StringSchema.d.mts} +2 -14
  230. package/lib/{index-BEyBEBSm.d.ts → schemas/StringSchema.d.ts} +2 -14
  231. package/lib/schemas/StringSchema.js +11 -0
  232. package/lib/schemas/StringSchema.js.map +1 -0
  233. package/lib/schemas/StringSchema.mjs +11 -0
  234. package/lib/schemas/StringSchema.mjs.map +1 -0
  235. package/package.json +30 -28
  236. package/lib/index-D3R2euaT.d.mts +0 -29
  237. package/lib/index-DPkImfCy.d.ts +0 -29
  238. package/lib/index-DitgsWDO.d.ts +0 -27
  239. package/lib/index-T3KBmyyn.d.mts +0 -27
@@ -1,4 +1,4 @@
1
- import { C as CommonSchema } from './CommonSchema-DeTBsQhn.mjs';
1
+ import { C as CommonSchema } from '../CommonSchema-BIe85W_A.mjs';
2
2
 
3
3
  declare class NumberSchema extends CommonSchema {
4
4
  _number: number;
@@ -17,16 +17,4 @@ type WithNumber<T extends NumberSchema, Y = number> = T & {
17
17
  };
18
18
  type ExtractFromNumber<T> = T extends WithNumber<NumberSchema, infer Y> ? Y : never;
19
19
 
20
- /**
21
- * Creates a new schema for validating number values.
22
- *
23
- * @returns {NumberSchema} A new instance of `NumberSchema` for validating numbers.
24
- *
25
- * @example
26
- * const schema = number();
27
- * parseSchema(schema, 42); // Validates successfully
28
- * parseSchema(schema, '42'); // Throws a validation error
29
- */
30
- declare function number(): NumberSchema;
31
-
32
- export { type ExtractFromNumber as E, NumberSchema as N, type WithNumber as W, number as n };
20
+ export { type ExtractFromNumber, NumberSchema, type WithNumber };
@@ -1,4 +1,4 @@
1
- import { C as CommonSchema } from './CommonSchema-DeTBsQhn.js';
1
+ import { C as CommonSchema } from '../CommonSchema-BIe85W_A.js';
2
2
 
3
3
  declare class NumberSchema extends CommonSchema {
4
4
  _number: number;
@@ -17,16 +17,4 @@ type WithNumber<T extends NumberSchema, Y = number> = T & {
17
17
  };
18
18
  type ExtractFromNumber<T> = T extends WithNumber<NumberSchema, infer Y> ? Y : never;
19
19
 
20
- /**
21
- * Creates a new schema for validating number values.
22
- *
23
- * @returns {NumberSchema} A new instance of `NumberSchema` for validating numbers.
24
- *
25
- * @example
26
- * const schema = number();
27
- * parseSchema(schema, 42); // Validates successfully
28
- * parseSchema(schema, '42'); // Throws a validation error
29
- */
30
- declare function number(): NumberSchema;
31
-
32
- export { type ExtractFromNumber as E, NumberSchema as N, type WithNumber as W, number as n };
20
+ export { type ExtractFromNumber, NumberSchema, type WithNumber };
@@ -0,0 +1,11 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunkGNBSKTFVjs = require('../chunk-GNBSKTFV.js');
4
+ require('../chunk-AXOP6HPJ.js');
5
+ require('../chunk-APTTIN2L.js');
6
+ require('../chunk-5NCJN6D2.js');
7
+ require('../chunk-2AP4OQMT.js');
8
+
9
+
10
+ exports.NumberSchema = _chunkGNBSKTFVjs.NumberSchema;
11
+ //# sourceMappingURL=NumberSchema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/runner/work/bguard/bguard/lib/schemas/NumberSchema.js"],"names":[],"mappings":"AAAA;AACE;AACF,uDAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B;AACE;AACF,qDAAC","file":"/home/runner/work/bguard/bguard/lib/schemas/NumberSchema.js"}
@@ -0,0 +1,11 @@
1
+ import {
2
+ NumberSchema
3
+ } from "../chunk-63IQFNFO.mjs";
4
+ import "../chunk-FCFO5J5Y.mjs";
5
+ import "../chunk-L7HUXYFV.mjs";
6
+ import "../chunk-P3Y6IWFA.mjs";
7
+ import "../chunk-QJOXKH7A.mjs";
8
+ export {
9
+ NumberSchema
10
+ };
11
+ //# sourceMappingURL=NumberSchema.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,12 @@
1
+ import { C as CommonSchema, V as ValidatorContext, O as ObjectShapeSchemaType } from '../CommonSchema-BIe85W_A.mjs';
2
+
3
+ declare class ObjectSchema extends CommonSchema {
4
+ _object: number;
5
+ constructor(ctx: ValidatorContext, shapeSchema: ObjectShapeSchemaType);
6
+ private validateObjectEntry;
7
+ }
8
+ type WithObject<Y extends ObjectShapeSchemaType> = ObjectSchema & {
9
+ validation_object: Y;
10
+ };
11
+
12
+ export { ObjectSchema, type WithObject };
@@ -0,0 +1,12 @@
1
+ import { C as CommonSchema, V as ValidatorContext, O as ObjectShapeSchemaType } from '../CommonSchema-BIe85W_A.js';
2
+
3
+ declare class ObjectSchema extends CommonSchema {
4
+ _object: number;
5
+ constructor(ctx: ValidatorContext, shapeSchema: ObjectShapeSchemaType);
6
+ private validateObjectEntry;
7
+ }
8
+ type WithObject<Y extends ObjectShapeSchemaType> = ObjectSchema & {
9
+ validation_object: Y;
10
+ };
11
+
12
+ export { ObjectSchema, type WithObject };
@@ -0,0 +1,10 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunkIQ3QYABEjs = require('../chunk-IQ3QYABE.js');
4
+ require('../chunk-APTTIN2L.js');
5
+ require('../chunk-5NCJN6D2.js');
6
+ require('../chunk-2AP4OQMT.js');
7
+
8
+
9
+ exports.ObjectSchema = _chunkIQ3QYABEjs.ObjectSchema;
10
+ //# sourceMappingURL=ObjectSchema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/runner/work/bguard/bguard/lib/schemas/ObjectSchema.js"],"names":[],"mappings":"AAAA;AACE;AACF,uDAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B;AACE;AACF,qDAAC","file":"/home/runner/work/bguard/bguard/lib/schemas/ObjectSchema.js"}
@@ -0,0 +1,10 @@
1
+ import {
2
+ ObjectSchema
3
+ } from "../chunk-QYLH5ZAC.mjs";
4
+ import "../chunk-L7HUXYFV.mjs";
5
+ import "../chunk-P3Y6IWFA.mjs";
6
+ import "../chunk-QJOXKH7A.mjs";
7
+ export {
8
+ ObjectSchema
9
+ };
10
+ //# sourceMappingURL=ObjectSchema.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,4 +1,4 @@
1
- import { C as CommonSchema } from './CommonSchema-DeTBsQhn.mjs';
1
+ import { C as CommonSchema } from '../CommonSchema-BIe85W_A.mjs';
2
2
 
3
3
  declare class StringSchema extends CommonSchema {
4
4
  _string: number;
@@ -17,16 +17,4 @@ type WithString<T extends StringSchema, Y = string> = T & {
17
17
  };
18
18
  type ExtractFromString<T> = T extends WithString<StringSchema, infer Y> ? Y : never;
19
19
 
20
- /**
21
- * Creates a new schema for validating string values.
22
- *
23
- * @returns {StringSchema} A new instance of `StringSchema` for validating strings.
24
- *
25
- * @example
26
- * const schema = string();
27
- * parseSchema(schema, 'hello'); // Validates successfully
28
- * parseSchema(schema, 123); // Throws a validation error
29
- */
30
- declare function string(): StringSchema;
31
-
32
- export { type ExtractFromString as E, StringSchema as S, type WithString as W, string as s };
20
+ export { type ExtractFromString, StringSchema, type WithString };
@@ -1,4 +1,4 @@
1
- import { C as CommonSchema } from './CommonSchema-DeTBsQhn.js';
1
+ import { C as CommonSchema } from '../CommonSchema-BIe85W_A.js';
2
2
 
3
3
  declare class StringSchema extends CommonSchema {
4
4
  _string: number;
@@ -17,16 +17,4 @@ type WithString<T extends StringSchema, Y = string> = T & {
17
17
  };
18
18
  type ExtractFromString<T> = T extends WithString<StringSchema, infer Y> ? Y : never;
19
19
 
20
- /**
21
- * Creates a new schema for validating string values.
22
- *
23
- * @returns {StringSchema} A new instance of `StringSchema` for validating strings.
24
- *
25
- * @example
26
- * const schema = string();
27
- * parseSchema(schema, 'hello'); // Validates successfully
28
- * parseSchema(schema, 123); // Throws a validation error
29
- */
30
- declare function string(): StringSchema;
31
-
32
- export { type ExtractFromString as E, StringSchema as S, type WithString as W, string as s };
20
+ export { type ExtractFromString, StringSchema, type WithString };
@@ -0,0 +1,11 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunkPDVXBE27js = require('../chunk-PDVXBE27.js');
4
+ require('../chunk-AXOP6HPJ.js');
5
+ require('../chunk-APTTIN2L.js');
6
+ require('../chunk-5NCJN6D2.js');
7
+ require('../chunk-2AP4OQMT.js');
8
+
9
+
10
+ exports.StringSchema = _chunkPDVXBE27js.StringSchema;
11
+ //# sourceMappingURL=StringSchema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/runner/work/bguard/bguard/lib/schemas/StringSchema.js"],"names":[],"mappings":"AAAA;AACE;AACF,uDAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B;AACE;AACF,qDAAC","file":"/home/runner/work/bguard/bguard/lib/schemas/StringSchema.js"}
@@ -0,0 +1,11 @@
1
+ import {
2
+ StringSchema
3
+ } from "../chunk-LHTJHMKJ.mjs";
4
+ import "../chunk-FCFO5J5Y.mjs";
5
+ import "../chunk-L7HUXYFV.mjs";
6
+ import "../chunk-P3Y6IWFA.mjs";
7
+ import "../chunk-QJOXKH7A.mjs";
8
+ export {
9
+ StringSchema
10
+ };
11
+ //# sourceMappingURL=StringSchema.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "bguard",
3
3
  "private": false,
4
4
  "license": "MIT",
5
- "version": "0.0.4",
5
+ "version": "0.0.6",
6
6
  "main": "lib/index.js",
7
7
  "module": "lib/index.mjs",
8
8
  "types": "lib/index.d.ts",
@@ -78,15 +78,10 @@
78
78
  },
79
79
  "tsup": {
80
80
  "entry": [
81
- "src/index.ts",
82
- "src/asserts/common/*",
83
- "src/asserts/array/*",
84
- "src/asserts/object/*",
85
- "src/asserts/boolean/*",
86
- "src/asserts/string/*",
87
- "src/asserts/number/*"
81
+ "src/**",
82
+ "!src/__tests__/**"
88
83
  ],
89
- "splitting": false,
84
+ "splitting": true,
90
85
  "sourcemap": true,
91
86
  "clean": true,
92
87
  "outDir": "./lib",
@@ -99,31 +94,38 @@
99
94
  "exports": {
100
95
  ".": {
101
96
  "import": "./lib/index.mjs",
102
- "require": "./lib/index.js"
97
+ "require": "./lib/index.js",
98
+ "types": "./lib/index.d.ts"
103
99
  },
104
- "./asserts/string/*": {
105
- "import": "./lib/asserts/string/*",
106
- "require": "./lib/asserts/string/*"
100
+ "./string/*": {
101
+ "import": "./lib/asserts/string/*.js",
102
+ "require": "./lib/asserts/string/*.js",
103
+ "types": "./lib/asserts/common/*.d.ts"
107
104
  },
108
- "./asserts/boolean/*": {
109
- "import": "./lib/asserts/boolean/*",
110
- "require": "./lib/asserts/boolean/*"
105
+ "./boolean/*": {
106
+ "import": "./lib/asserts/boolean/*.js",
107
+ "require": "./lib/asserts/boolean/*.js",
108
+ "types": "./lib/index.d.ts"
111
109
  },
112
- "./asserts/number/*": {
113
- "import": "./lib/asserts/number/*",
114
- "require": "./lib/asserts/number/*"
110
+ "./number/*": {
111
+ "import": "./lib/asserts/number/*.js",
112
+ "require": "./lib/asserts/number/*.js",
113
+ "types": "./lib/asserts/common/*.d.ts"
115
114
  },
116
- "./asserts/array/*": {
117
- "import": "./lib/asserts/array/*",
118
- "require": "./lib/asserts/array/*"
115
+ "./array/*": {
116
+ "import": "./lib/asserts/array/*.js",
117
+ "require": "./lib/asserts/array/*.js",
118
+ "types": "./lib/asserts/common/*.d.ts"
119
119
  },
120
- "./asserts/object/*": {
121
- "import": "./lib/asserts/object/*",
122
- "require": "./lib/asserts/object/*"
120
+ "./object/*": {
121
+ "import": "./lib/asserts/object/*.js",
122
+ "require": "./lib/asserts/object/*.js",
123
+ "types": "./lib/asserts/common/*.d.ts"
123
124
  },
124
- "./asserts/common/*": {
125
- "import": "./lib/asserts/common/*",
126
- "require": "./lib/asserts/common/*"
125
+ "./common/*": {
126
+ "import": "./lib/asserts/common/*.js",
127
+ "require": "./lib/asserts/common/*.js",
128
+ "types": "./lib/asserts/common/*.d.ts"
127
129
  }
128
130
  }
129
131
  }
@@ -1,29 +0,0 @@
1
- import { C as CommonSchema, V as ValidatorContext, O as ObjectShapeSchemaType } from './CommonSchema-DeTBsQhn.mjs';
2
-
3
- declare class ObjectSchema extends CommonSchema {
4
- _object: number;
5
- constructor(ctx: ValidatorContext, shapeSchema: ObjectShapeSchemaType);
6
- private validateObjectEntry;
7
- }
8
- type WithObject<Y extends ObjectShapeSchemaType> = ObjectSchema & {
9
- validation_object: Y;
10
- };
11
-
12
- /**
13
- * Creates a new schema for validating objects where each property must match the specified schema.
14
- *
15
- * @template T
16
- * @param {T} shapeSchema - The schema that each property of the object must match.
17
- * @returns {WithObject<T>} A new instance of `ObjectSchema` for validating objects with properties matching the specified schema.
18
- *
19
- * @example
20
- * const schema = object({
21
- * name: string(),
22
- * age: number()
23
- * });
24
- * parseSchema(schema, { name: 'John', age: 30 }); // Validates successfully
25
- * parseSchema(schema, { name: 'John', age: '30' }); // Throws a validation error
26
- */
27
- declare function object<T extends ObjectShapeSchemaType>(shapeSchema: T): WithObject<T>;
28
-
29
- export { ObjectSchema as O, type WithObject as W, object as o };
@@ -1,29 +0,0 @@
1
- import { C as CommonSchema, V as ValidatorContext, O as ObjectShapeSchemaType } from './CommonSchema-DeTBsQhn.js';
2
-
3
- declare class ObjectSchema extends CommonSchema {
4
- _object: number;
5
- constructor(ctx: ValidatorContext, shapeSchema: ObjectShapeSchemaType);
6
- private validateObjectEntry;
7
- }
8
- type WithObject<Y extends ObjectShapeSchemaType> = ObjectSchema & {
9
- validation_object: Y;
10
- };
11
-
12
- /**
13
- * Creates a new schema for validating objects where each property must match the specified schema.
14
- *
15
- * @template T
16
- * @param {T} shapeSchema - The schema that each property of the object must match.
17
- * @returns {WithObject<T>} A new instance of `ObjectSchema` for validating objects with properties matching the specified schema.
18
- *
19
- * @example
20
- * const schema = object({
21
- * name: string(),
22
- * age: number()
23
- * });
24
- * parseSchema(schema, { name: 'John', age: 30 }); // Validates successfully
25
- * parseSchema(schema, { name: 'John', age: '30' }); // Throws a validation error
26
- */
27
- declare function object<T extends ObjectShapeSchemaType>(shapeSchema: T): WithObject<T>;
28
-
29
- export { ObjectSchema as O, type WithObject as W, object as o };
@@ -1,27 +0,0 @@
1
- import { C as CommonSchema, V as ValidatorContext } from './CommonSchema-DeTBsQhn.js';
2
-
3
- declare class ArraySchema extends CommonSchema {
4
- _array: number;
5
- constructor(ctx: ValidatorContext, arraySchema: CommonSchema);
6
- private validateArrayEntry;
7
- }
8
- type WithArray<Y extends CommonSchema> = ArraySchema & {
9
- validation_array: Y;
10
- };
11
- type ExtractFromArray<T> = T extends WithArray<infer X> ? X : never;
12
-
13
- /**
14
- * Creates a new schema for validating arrays where each element must match the specified schema.
15
- *
16
- * @template T
17
- * @param {T} arraySchema - The schema that each element of the array must match.
18
- * @returns {WithArray<T>} A new instance of `ArraySchema` for validating arrays of elements that match the specified schema.
19
- *
20
- * @example
21
- * const schema = array(string());
22
- * parseSchema(schema, ['hello', 'world']); // Validates successfully
23
- * parseSchema(schema, ['hello', 123]); // Throws a validation error
24
- */
25
- declare function array<T extends CommonSchema>(arraySchema: T): WithArray<T>;
26
-
27
- export { ArraySchema as A, type ExtractFromArray as E, array as a };
@@ -1,27 +0,0 @@
1
- import { C as CommonSchema, V as ValidatorContext } from './CommonSchema-DeTBsQhn.mjs';
2
-
3
- declare class ArraySchema extends CommonSchema {
4
- _array: number;
5
- constructor(ctx: ValidatorContext, arraySchema: CommonSchema);
6
- private validateArrayEntry;
7
- }
8
- type WithArray<Y extends CommonSchema> = ArraySchema & {
9
- validation_array: Y;
10
- };
11
- type ExtractFromArray<T> = T extends WithArray<infer X> ? X : never;
12
-
13
- /**
14
- * Creates a new schema for validating arrays where each element must match the specified schema.
15
- *
16
- * @template T
17
- * @param {T} arraySchema - The schema that each element of the array must match.
18
- * @returns {WithArray<T>} A new instance of `ArraySchema` for validating arrays of elements that match the specified schema.
19
- *
20
- * @example
21
- * const schema = array(string());
22
- * parseSchema(schema, ['hello', 'world']); // Validates successfully
23
- * parseSchema(schema, ['hello', 123]); // Throws a validation error
24
- */
25
- declare function array<T extends CommonSchema>(arraySchema: T): WithArray<T>;
26
-
27
- export { ArraySchema as A, type ExtractFromArray as E, array as a };