bguard 0.0.5 → 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.
- package/lib/InferType.js +1 -19
- package/lib/InferType.js.map +1 -1
- package/lib/asserts/array/index.js +7 -86
- package/lib/asserts/array/index.js.map +1 -1
- package/lib/asserts/array/index.mjs +7 -59
- package/lib/asserts/array/index.mjs.map +1 -1
- package/lib/asserts/boolean/index.js +7 -114
- package/lib/asserts/boolean/index.js.map +1 -1
- package/lib/asserts/boolean/index.mjs +7 -87
- package/lib/asserts/boolean/index.mjs.map +1 -1
- package/lib/asserts/common/equalTo.js +4 -50
- package/lib/asserts/common/equalTo.js.map +1 -1
- package/lib/asserts/common/equalTo.mjs +4 -23
- package/lib/asserts/common/equalTo.mjs.map +1 -1
- package/lib/asserts/common/index.js +6 -68
- package/lib/asserts/common/index.js.map +1 -1
- package/lib/asserts/common/index.mjs +6 -41
- package/lib/asserts/common/index.mjs.map +1 -1
- package/lib/asserts/number/index.js +8 -108
- package/lib/asserts/number/index.js.map +1 -1
- package/lib/asserts/number/index.mjs +8 -81
- package/lib/asserts/number/index.mjs.map +1 -1
- package/lib/asserts/number/max.js +6 -47
- package/lib/asserts/number/max.js.map +1 -1
- package/lib/asserts/number/max.mjs +3 -17
- package/lib/asserts/number/max.mjs.map +1 -1
- package/lib/asserts/number/maxExcluded.js +6 -47
- package/lib/asserts/number/maxExcluded.js.map +1 -1
- package/lib/asserts/number/maxExcluded.mjs +3 -17
- package/lib/asserts/number/maxExcluded.mjs.map +1 -1
- package/lib/asserts/number/min.js +6 -47
- package/lib/asserts/number/min.js.map +1 -1
- package/lib/asserts/number/min.mjs +3 -17
- package/lib/asserts/number/min.mjs.map +1 -1
- package/lib/asserts/number/minExcluded.js +6 -47
- package/lib/asserts/number/minExcluded.js.map +1 -1
- package/lib/asserts/number/minExcluded.mjs +3 -17
- package/lib/asserts/number/minExcluded.mjs.map +1 -1
- package/lib/asserts/number/negative.js +6 -47
- package/lib/asserts/number/negative.js.map +1 -1
- package/lib/asserts/number/negative.mjs +3 -17
- package/lib/asserts/number/negative.mjs.map +1 -1
- package/lib/asserts/number/positive.js +6 -47
- package/lib/asserts/number/positive.js.map +1 -1
- package/lib/asserts/number/positive.mjs +3 -17
- package/lib/asserts/number/positive.mjs.map +1 -1
- package/lib/asserts/object/index.js +7 -90
- package/lib/asserts/object/index.js.map +1 -1
- package/lib/asserts/object/index.mjs +7 -63
- package/lib/asserts/object/index.mjs.map +1 -1
- package/lib/asserts/string/email.js +6 -47
- package/lib/asserts/string/email.js.map +1 -1
- package/lib/asserts/string/email.mjs +3 -17
- package/lib/asserts/string/email.mjs.map +1 -1
- package/lib/asserts/string/index.js +8 -108
- package/lib/asserts/string/index.js.map +1 -1
- package/lib/asserts/string/index.mjs +8 -81
- package/lib/asserts/string/index.mjs.map +1 -1
- package/lib/asserts/string/maxLength.js +6 -47
- package/lib/asserts/string/maxLength.js.map +1 -1
- package/lib/asserts/string/maxLength.mjs +3 -17
- package/lib/asserts/string/maxLength.mjs.map +1 -1
- package/lib/asserts/string/minLength.js +6 -47
- package/lib/asserts/string/minLength.js.map +1 -1
- package/lib/asserts/string/minLength.mjs +3 -17
- package/lib/asserts/string/minLength.mjs.map +1 -1
- package/lib/asserts/string/regExp.js +6 -47
- package/lib/asserts/string/regExp.js.map +1 -1
- package/lib/asserts/string/regExp.mjs +3 -17
- package/lib/asserts/string/regExp.mjs.map +1 -1
- package/lib/chunk-2AP4OQMT.js +26 -0
- package/lib/chunk-2AP4OQMT.js.map +1 -0
- package/lib/chunk-32IQXZRK.mjs +13 -0
- package/lib/chunk-32IQXZRK.mjs.map +1 -0
- package/lib/chunk-3FEJUC3K.mjs +13 -0
- package/lib/chunk-3FEJUC3K.mjs.map +1 -0
- package/lib/chunk-5NCJN6D2.js +70 -0
- package/lib/chunk-5NCJN6D2.js.map +1 -0
- package/lib/chunk-5ZMICHV3.js +21 -0
- package/lib/chunk-5ZMICHV3.js.map +1 -0
- package/lib/chunk-63IQFNFO.mjs +27 -0
- package/lib/chunk-63IQFNFO.mjs.map +1 -0
- package/lib/chunk-A2SAWKJA.mjs +13 -0
- package/lib/chunk-A2SAWKJA.mjs.map +1 -0
- package/lib/chunk-A3UTB4RE.mjs +28 -0
- package/lib/chunk-A3UTB4RE.mjs.map +1 -0
- package/lib/chunk-A7I2JEQO.js +13 -0
- package/lib/chunk-A7I2JEQO.js.map +1 -0
- package/lib/chunk-AJ4WV5DG.mjs +13 -0
- package/lib/chunk-AJ4WV5DG.mjs.map +1 -0
- package/lib/chunk-APTTIN2L.js +42 -0
- package/lib/chunk-APTTIN2L.js.map +1 -0
- package/lib/chunk-AXOP6HPJ.js +14 -0
- package/lib/chunk-AXOP6HPJ.js.map +1 -0
- package/lib/chunk-BGMR7A6X.mjs +13 -0
- package/lib/chunk-BGMR7A6X.mjs.map +1 -0
- package/lib/chunk-FCFO5J5Y.mjs +14 -0
- package/lib/chunk-FCFO5J5Y.mjs.map +1 -0
- package/lib/chunk-GEZME6V2.mjs +39 -0
- package/lib/chunk-GEZME6V2.mjs.map +1 -0
- package/lib/chunk-GNBSKTFV.js +27 -0
- package/lib/chunk-GNBSKTFV.js.map +1 -0
- package/lib/chunk-IQ3QYABE.js +32 -0
- package/lib/chunk-IQ3QYABE.js.map +1 -0
- package/lib/chunk-K2S3FS5K.js +13 -0
- package/lib/chunk-K2S3FS5K.js.map +1 -0
- package/lib/chunk-KCBOOOTF.mjs +13 -0
- package/lib/chunk-KCBOOOTF.mjs.map +1 -0
- package/lib/chunk-L6A7NXUJ.js +13 -0
- package/lib/chunk-L6A7NXUJ.js.map +1 -0
- package/lib/chunk-L7HUXYFV.mjs +42 -0
- package/lib/chunk-L7HUXYFV.mjs.map +1 -0
- package/lib/chunk-LHTJHMKJ.mjs +27 -0
- package/lib/chunk-LHTJHMKJ.mjs.map +1 -0
- package/lib/chunk-NOADI6PO.mjs +21 -0
- package/lib/chunk-NOADI6PO.mjs.map +1 -0
- package/lib/chunk-NWY33MFU.js +13 -0
- package/lib/chunk-NWY33MFU.js.map +1 -0
- package/lib/chunk-P3Y6IWFA.mjs +70 -0
- package/lib/chunk-P3Y6IWFA.mjs.map +1 -0
- package/lib/chunk-PDVXBE27.js +27 -0
- package/lib/chunk-PDVXBE27.js.map +1 -0
- package/lib/chunk-PJP63SJT.js +13 -0
- package/lib/chunk-PJP63SJT.js.map +1 -0
- package/lib/chunk-QJOXKH7A.mjs +26 -0
- package/lib/chunk-QJOXKH7A.mjs.map +1 -0
- package/lib/chunk-QKGQ4XZC.js +13 -0
- package/lib/chunk-QKGQ4XZC.js.map +1 -0
- package/lib/chunk-QYLH5ZAC.mjs +32 -0
- package/lib/chunk-QYLH5ZAC.mjs.map +1 -0
- package/lib/chunk-VPFIIM2X.js +39 -0
- package/lib/chunk-VPFIIM2X.js.map +1 -0
- package/lib/chunk-YXHH5BF6.js +28 -0
- package/lib/chunk-YXHH5BF6.js.map +1 -0
- package/lib/core.js +6 -107
- package/lib/core.js.map +1 -1
- package/lib/core.mjs +5 -78
- package/lib/core.mjs.map +1 -1
- package/lib/exceptions.js +9 -50
- package/lib/exceptions.js.map +1 -1
- package/lib/exceptions.mjs +5 -19
- package/lib/exceptions.mjs.map +1 -1
- package/lib/index.js +29 -283
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +34 -252
- package/lib/index.mjs.map +1 -1
- package/lib/parseSchema.js +5 -115
- package/lib/parseSchema.js.map +1 -1
- package/lib/parseSchema.mjs +5 -88
- package/lib/parseSchema.mjs.map +1 -1
- package/lib/schemas/ArraySchema.js +6 -81
- package/lib/schemas/ArraySchema.js.map +1 -1
- package/lib/schemas/ArraySchema.mjs +6 -54
- package/lib/schemas/ArraySchema.mjs.map +1 -1
- package/lib/schemas/BooleanSchema.js +6 -109
- package/lib/schemas/BooleanSchema.js.map +1 -1
- package/lib/schemas/BooleanSchema.mjs +6 -82
- package/lib/schemas/BooleanSchema.mjs.map +1 -1
- package/lib/schemas/CommonSchema.js +5 -63
- package/lib/schemas/CommonSchema.js.map +1 -1
- package/lib/schemas/CommonSchema.mjs +5 -36
- package/lib/schemas/CommonSchema.mjs.map +1 -1
- package/lib/schemas/NumberSchema.js +7 -103
- package/lib/schemas/NumberSchema.js.map +1 -1
- package/lib/schemas/NumberSchema.mjs +7 -76
- package/lib/schemas/NumberSchema.mjs.map +1 -1
- package/lib/schemas/ObjectSchema.js +6 -85
- package/lib/schemas/ObjectSchema.js.map +1 -1
- package/lib/schemas/ObjectSchema.mjs +6 -58
- package/lib/schemas/ObjectSchema.mjs.map +1 -1
- package/lib/schemas/StringSchema.js +7 -103
- package/lib/schemas/StringSchema.js.map +1 -1
- package/lib/schemas/StringSchema.mjs +7 -76
- package/lib/schemas/StringSchema.mjs.map +1 -1
- package/package.json +4 -3
- package/lib/__tests__/ArraySchema.test.d.mts +0 -2
- package/lib/__tests__/ArraySchema.test.d.ts +0 -2
- package/lib/__tests__/ArraySchema.test.js +0 -201
- package/lib/__tests__/ArraySchema.test.js.map +0 -1
- package/lib/__tests__/ArraySchema.test.mjs +0 -199
- package/lib/__tests__/ArraySchema.test.mjs.map +0 -1
- package/lib/__tests__/BooleanSchema.test.d.mts +0 -2
- package/lib/__tests__/BooleanSchema.test.d.ts +0 -2
- package/lib/__tests__/BooleanSchema.test.js +0 -219
- package/lib/__tests__/BooleanSchema.test.js.map +0 -1
- package/lib/__tests__/BooleanSchema.test.mjs +0 -217
- package/lib/__tests__/BooleanSchema.test.mjs.map +0 -1
- package/lib/__tests__/CommonSchema.test.d.mts +0 -2
- package/lib/__tests__/CommonSchema.test.d.ts +0 -2
- package/lib/__tests__/CommonSchema.test.js +0 -253
- package/lib/__tests__/CommonSchema.test.js.map +0 -1
- package/lib/__tests__/CommonSchema.test.mjs +0 -251
- package/lib/__tests__/CommonSchema.test.mjs.map +0 -1
- package/lib/__tests__/MixTypes.test.d.mts +0 -2
- package/lib/__tests__/MixTypes.test.d.ts +0 -2
- package/lib/__tests__/MixTypes.test.js +0 -165
- package/lib/__tests__/MixTypes.test.js.map +0 -1
- package/lib/__tests__/MixTypes.test.mjs +0 -163
- package/lib/__tests__/MixTypes.test.mjs.map +0 -1
- package/lib/__tests__/NumberSchema.test.d.mts +0 -2
- package/lib/__tests__/NumberSchema.test.d.ts +0 -2
- package/lib/__tests__/NumberSchema.test.js +0 -253
- package/lib/__tests__/NumberSchema.test.js.map +0 -1
- package/lib/__tests__/NumberSchema.test.mjs +0 -251
- package/lib/__tests__/NumberSchema.test.mjs.map +0 -1
- package/lib/__tests__/ObjectSchema.test.d.mts +0 -2
- package/lib/__tests__/ObjectSchema.test.d.ts +0 -2
- package/lib/__tests__/ObjectSchema.test.js +0 -356
- package/lib/__tests__/ObjectSchema.test.js.map +0 -1
- package/lib/__tests__/ObjectSchema.test.mjs +0 -354
- package/lib/__tests__/ObjectSchema.test.mjs.map +0 -1
- package/lib/__tests__/StringSchema.test.d.mts +0 -2
- package/lib/__tests__/StringSchema.test.d.ts +0 -2
- package/lib/__tests__/StringSchema.test.js +0 -228
- package/lib/__tests__/StringSchema.test.js.map +0 -1
- package/lib/__tests__/StringSchema.test.mjs +0 -226
- package/lib/__tests__/StringSchema.test.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/
|
|
1
|
+
{"version":3,"sources":["../../../src/asserts/number/maxExcluded.ts"],"sourcesContent":["import { throwException } from '../../exceptions';\nimport { RequiredValidation } from '../../schemas/CommonSchema';\n\n/**\n * Asserts that a number value is strictly less than a specified maximum value (i.e., the maximum value is excluded).\n *\n * @param {number} expected - The maximum allowable value, which is excluded.\n * @returns {RequiredValidation} - A validation function that takes a received number and a path to the error message. Throws an error if the received value is greater than or equal to the expected maximum value.\n *\n * @example\n * const schema = number().custom(maxExcluded(100));\n * parseSchema(schema, 99); // Valid\n * parseSchema(schema, 100); // Throws an error: 'The received value is greater than or equal to expected'\n * parseSchema(schema, 101); // Throws an error: 'The received value is greater than or equal to expected'\n */\nexport const maxExcluded =\n (expected: number): RequiredValidation =>\n (received: number, pathToError: string) => {\n if (expected <= received)\n throwException(expected, received, pathToError, 'The received value is greater than or equal to expected');\n };\n"],"mappings":";;;;;AAeO,IAAM,cACX,CAAC,aACD,CAAC,UAAkB,gBAAwB;AACzC,MAAI,YAAY;AACd,mBAAe,UAAU,UAAU,aAAa,yDAAyD;AAC7G;","names":[]}
|
|
@@ -1,54 +1,13 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
19
2
|
|
|
20
|
-
|
|
21
|
-
var min_exports = {};
|
|
22
|
-
__export(min_exports, {
|
|
23
|
-
min: () => min
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(min_exports);
|
|
26
|
-
|
|
27
|
-
// src/exceptions.ts
|
|
28
|
-
var ValidationError = class extends Error {
|
|
29
|
-
expected;
|
|
30
|
-
received;
|
|
31
|
-
pathToError;
|
|
32
|
-
message;
|
|
33
|
-
constructor(expected, received, pathToError, message) {
|
|
34
|
-
super();
|
|
35
|
-
this.expected = expected;
|
|
36
|
-
this.received = received;
|
|
37
|
-
this.pathToError = pathToError;
|
|
38
|
-
this.message = message;
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
function throwException(expected, received, pathToError, message) {
|
|
42
|
-
throw new ValidationError(expected, received, pathToError, message);
|
|
43
|
-
}
|
|
3
|
+
var _chunk2AP4OQMTjs = require('../../chunk-2AP4OQMT.js');
|
|
44
4
|
|
|
45
5
|
// src/asserts/number/min.ts
|
|
46
6
|
var min = (expected) => (received, pathToError) => {
|
|
47
7
|
if (expected > received)
|
|
48
|
-
throwException(expected, received, pathToError, "The received value is less than expected");
|
|
8
|
+
_chunk2AP4OQMTjs.throwException.call(void 0, expected, received, pathToError, "The received value is less than expected");
|
|
49
9
|
};
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
});
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
exports.min = min;
|
|
54
13
|
//# sourceMappingURL=min.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/bguard/bguard/lib/asserts/number/min.js","../../../src/asserts/number/min.ts"],"names":[],"mappings":"AAAA;AACE;AACF,0DAAgC;AAChC;AACA;ACWO,IAAM,IAAA,EACX,CAAC,QAAA,EAAA,GACD,CAAC,QAAA,EAAkB,WAAA,EAAA,GAAwB;AACzC,EAAA,GAAA,CAAI,SAAA,EAAW,QAAA;AACb,IAAA,6CAAA,QAAe,EAAU,QAAA,EAAU,WAAA,EAAa,0CAA0C,CAAA;AAC9F,CAAA;ADXF;AACE;AACF,kBAAC","file":"/home/runner/work/bguard/bguard/lib/asserts/number/min.js","sourcesContent":[null,"import { throwException } from '../../exceptions';\nimport type { RequiredValidation } from '../../schemas/CommonSchema';\n\n/**\n * Asserts that a number value is not less than a specified minimum value.\n *\n * @param {number} expected - The minimum allowable value.\n * @returns {RequiredValidation} - A validation function that takes a received number and a path to the error message. Throws an error if the received value is less than the expected minimum value.\n *\n * @example\n * const schema = number().custom(min(10));\n * parseSchema(schema, 11); // Valid\n * parseSchema(schema, 10); // Valid\n * parseSchema(schema, 9); // Throws an error: 'The received value is less than expected'\n */\nexport const min =\n (expected: number): RequiredValidation =>\n (received: number, pathToError: string) => {\n if (expected > received)\n throwException(expected, received, pathToError, 'The received value is less than expected');\n };\n"]}
|
|
@@ -1,20 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
received;
|
|
5
|
-
pathToError;
|
|
6
|
-
message;
|
|
7
|
-
constructor(expected, received, pathToError, message) {
|
|
8
|
-
super();
|
|
9
|
-
this.expected = expected;
|
|
10
|
-
this.received = received;
|
|
11
|
-
this.pathToError = pathToError;
|
|
12
|
-
this.message = message;
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
function throwException(expected, received, pathToError, message) {
|
|
16
|
-
throw new ValidationError(expected, received, pathToError, message);
|
|
17
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
throwException
|
|
3
|
+
} from "../../chunk-QJOXKH7A.mjs";
|
|
18
4
|
|
|
19
5
|
// src/asserts/number/min.ts
|
|
20
6
|
var min = (expected) => (received, pathToError) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/
|
|
1
|
+
{"version":3,"sources":["../../../src/asserts/number/min.ts"],"sourcesContent":["import { throwException } from '../../exceptions';\nimport type { RequiredValidation } from '../../schemas/CommonSchema';\n\n/**\n * Asserts that a number value is not less than a specified minimum value.\n *\n * @param {number} expected - The minimum allowable value.\n * @returns {RequiredValidation} - A validation function that takes a received number and a path to the error message. Throws an error if the received value is less than the expected minimum value.\n *\n * @example\n * const schema = number().custom(min(10));\n * parseSchema(schema, 11); // Valid\n * parseSchema(schema, 10); // Valid\n * parseSchema(schema, 9); // Throws an error: 'The received value is less than expected'\n */\nexport const min =\n (expected: number): RequiredValidation =>\n (received: number, pathToError: string) => {\n if (expected > received)\n throwException(expected, received, pathToError, 'The received value is less than expected');\n };\n"],"mappings":";;;;;AAeO,IAAM,MACX,CAAC,aACD,CAAC,UAAkB,gBAAwB;AACzC,MAAI,WAAW;AACb,mBAAe,UAAU,UAAU,aAAa,0CAA0C;AAC9F;","names":[]}
|
|
@@ -1,54 +1,13 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
19
2
|
|
|
20
|
-
|
|
21
|
-
var minExcluded_exports = {};
|
|
22
|
-
__export(minExcluded_exports, {
|
|
23
|
-
minExcluded: () => minExcluded
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(minExcluded_exports);
|
|
26
|
-
|
|
27
|
-
// src/exceptions.ts
|
|
28
|
-
var ValidationError = class extends Error {
|
|
29
|
-
expected;
|
|
30
|
-
received;
|
|
31
|
-
pathToError;
|
|
32
|
-
message;
|
|
33
|
-
constructor(expected, received, pathToError, message) {
|
|
34
|
-
super();
|
|
35
|
-
this.expected = expected;
|
|
36
|
-
this.received = received;
|
|
37
|
-
this.pathToError = pathToError;
|
|
38
|
-
this.message = message;
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
function throwException(expected, received, pathToError, message) {
|
|
42
|
-
throw new ValidationError(expected, received, pathToError, message);
|
|
43
|
-
}
|
|
3
|
+
var _chunk2AP4OQMTjs = require('../../chunk-2AP4OQMT.js');
|
|
44
4
|
|
|
45
5
|
// src/asserts/number/minExcluded.ts
|
|
46
6
|
var minExcluded = (expected) => (received, pathToError) => {
|
|
47
7
|
if (expected >= received)
|
|
48
|
-
throwException(expected, received, pathToError, "The received value is less than or equal to expected");
|
|
8
|
+
_chunk2AP4OQMTjs.throwException.call(void 0, expected, received, pathToError, "The received value is less than or equal to expected");
|
|
49
9
|
};
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
});
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
exports.minExcluded = minExcluded;
|
|
54
13
|
//# sourceMappingURL=minExcluded.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/bguard/bguard/lib/asserts/number/minExcluded.js","../../../src/asserts/number/minExcluded.ts"],"names":[],"mappings":"AAAA;AACE;AACF,0DAAgC;AAChC;AACA;ACWO,IAAM,YAAA,EACX,CAAC,QAAA,EAAA,GACD,CAAC,QAAA,EAAkB,WAAA,EAAA,GAAwB;AACzC,EAAA,GAAA,CAAI,SAAA,GAAY,QAAA;AACd,IAAA,6CAAA,QAAe,EAAU,QAAA,EAAU,WAAA,EAAa,sDAAsD,CAAA;AAC1G,CAAA;ADXF;AACE;AACF,kCAAC","file":"/home/runner/work/bguard/bguard/lib/asserts/number/minExcluded.js","sourcesContent":[null,"import { throwException } from '../../exceptions';\nimport { RequiredValidation } from '../../schemas/CommonSchema';\n\n/**\n * Asserts that a number value is strictly greater than a specified minimum value (i.e., the minimum value is excluded).\n *\n * @param {number} expected - The minimum allowable value, which is excluded.\n * @returns {RequiredValidation} - A validation function that takes a received number and a path to the error message. Throws an error if the received value is less than or equal to the expected minimum value.\n *\n * @example\n * const schema = number().custom(minExcluded(10));\n * parseSchema(schema, 11); // Valid\n * parseSchema(schema, 10); // Throws an error: 'The received value is less than or equal to expected'\n * parseSchema(schema, 9); // Throws an error: 'The received value is less than or equal to expected'\n */\nexport const minExcluded =\n (expected: number): RequiredValidation =>\n (received: number, pathToError: string) => {\n if (expected >= received)\n throwException(expected, received, pathToError, 'The received value is less than or equal to expected');\n };\n"]}
|
|
@@ -1,20 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
received;
|
|
5
|
-
pathToError;
|
|
6
|
-
message;
|
|
7
|
-
constructor(expected, received, pathToError, message) {
|
|
8
|
-
super();
|
|
9
|
-
this.expected = expected;
|
|
10
|
-
this.received = received;
|
|
11
|
-
this.pathToError = pathToError;
|
|
12
|
-
this.message = message;
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
function throwException(expected, received, pathToError, message) {
|
|
16
|
-
throw new ValidationError(expected, received, pathToError, message);
|
|
17
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
throwException
|
|
3
|
+
} from "../../chunk-QJOXKH7A.mjs";
|
|
18
4
|
|
|
19
5
|
// src/asserts/number/minExcluded.ts
|
|
20
6
|
var minExcluded = (expected) => (received, pathToError) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/
|
|
1
|
+
{"version":3,"sources":["../../../src/asserts/number/minExcluded.ts"],"sourcesContent":["import { throwException } from '../../exceptions';\nimport { RequiredValidation } from '../../schemas/CommonSchema';\n\n/**\n * Asserts that a number value is strictly greater than a specified minimum value (i.e., the minimum value is excluded).\n *\n * @param {number} expected - The minimum allowable value, which is excluded.\n * @returns {RequiredValidation} - A validation function that takes a received number and a path to the error message. Throws an error if the received value is less than or equal to the expected minimum value.\n *\n * @example\n * const schema = number().custom(minExcluded(10));\n * parseSchema(schema, 11); // Valid\n * parseSchema(schema, 10); // Throws an error: 'The received value is less than or equal to expected'\n * parseSchema(schema, 9); // Throws an error: 'The received value is less than or equal to expected'\n */\nexport const minExcluded =\n (expected: number): RequiredValidation =>\n (received: number, pathToError: string) => {\n if (expected >= received)\n throwException(expected, received, pathToError, 'The received value is less than or equal to expected');\n };\n"],"mappings":";;;;;AAeO,IAAM,cACX,CAAC,aACD,CAAC,UAAkB,gBAAwB;AACzC,MAAI,YAAY;AACd,mBAAe,UAAU,UAAU,aAAa,sDAAsD;AAC1G;","names":[]}
|
|
@@ -1,53 +1,12 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
19
2
|
|
|
20
|
-
|
|
21
|
-
var negative_exports = {};
|
|
22
|
-
__export(negative_exports, {
|
|
23
|
-
negative: () => negative
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(negative_exports);
|
|
26
|
-
|
|
27
|
-
// src/exceptions.ts
|
|
28
|
-
var ValidationError = class extends Error {
|
|
29
|
-
expected;
|
|
30
|
-
received;
|
|
31
|
-
pathToError;
|
|
32
|
-
message;
|
|
33
|
-
constructor(expected, received, pathToError, message) {
|
|
34
|
-
super();
|
|
35
|
-
this.expected = expected;
|
|
36
|
-
this.received = received;
|
|
37
|
-
this.pathToError = pathToError;
|
|
38
|
-
this.message = message;
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
function throwException(expected, received, pathToError, message) {
|
|
42
|
-
throw new ValidationError(expected, received, pathToError, message);
|
|
43
|
-
}
|
|
3
|
+
var _chunk2AP4OQMTjs = require('../../chunk-2AP4OQMT.js');
|
|
44
4
|
|
|
45
5
|
// src/asserts/number/negative.ts
|
|
46
6
|
var negative = () => (received, pathToError) => {
|
|
47
|
-
if (received >= 0) throwException("negative", received, pathToError, "The received value is not a negative number");
|
|
7
|
+
if (received >= 0) _chunk2AP4OQMTjs.throwException.call(void 0, "negative", received, pathToError, "The received value is not a negative number");
|
|
48
8
|
};
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
});
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
exports.negative = negative;
|
|
53
12
|
//# sourceMappingURL=negative.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/bguard/bguard/lib/asserts/number/negative.js","../../../src/asserts/number/negative.ts"],"names":[],"mappings":"AAAA;AACE;AACF,0DAAgC;AAChC;AACA;ACUO,IAAM,SAAA,EAAW,CAAA,EAAA,GAA0B,CAAC,QAAA,EAAkB,WAAA,EAAA,GAAwB;AAC3F,EAAA,GAAA,CAAI,SAAA,GAAY,CAAA,EAAG,6CAAA,UAAe,EAAY,QAAA,EAAU,WAAA,EAAa,6CAA6C,CAAA;AACpH,CAAA;ADRA;AACE;AACF,4BAAC","file":"/home/runner/work/bguard/bguard/lib/asserts/number/negative.js","sourcesContent":[null,"import { throwException } from '../../exceptions';\nimport type { RequiredValidation } from '../../schemas/CommonSchema';\n\n/**\n * Asserts that a number value is negative (less than zero).\n *\n * @returns {RequiredValidation} - A validation function that takes a received number and a path to the error message. Throws an error if the received value is not negative.\n *\n * @example\n * const schema = number().custom(negative());\n * parseSchema(schema, -10); // Valid\n * parseSchema(schema, 0); // Throws an error: 'The received value is not a negative number'\n * parseSchema(schema, 5); // Throws an error: 'The received value is not a negative number'\n */\nexport const negative = (): RequiredValidation => (received: number, pathToError: string) => {\n if (received >= 0) throwException('negative', received, pathToError, 'The received value is not a negative number');\n};\n"]}
|
|
@@ -1,20 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
received;
|
|
5
|
-
pathToError;
|
|
6
|
-
message;
|
|
7
|
-
constructor(expected, received, pathToError, message) {
|
|
8
|
-
super();
|
|
9
|
-
this.expected = expected;
|
|
10
|
-
this.received = received;
|
|
11
|
-
this.pathToError = pathToError;
|
|
12
|
-
this.message = message;
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
function throwException(expected, received, pathToError, message) {
|
|
16
|
-
throw new ValidationError(expected, received, pathToError, message);
|
|
17
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
throwException
|
|
3
|
+
} from "../../chunk-QJOXKH7A.mjs";
|
|
18
4
|
|
|
19
5
|
// src/asserts/number/negative.ts
|
|
20
6
|
var negative = () => (received, pathToError) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/
|
|
1
|
+
{"version":3,"sources":["../../../src/asserts/number/negative.ts"],"sourcesContent":["import { throwException } from '../../exceptions';\nimport type { RequiredValidation } from '../../schemas/CommonSchema';\n\n/**\n * Asserts that a number value is negative (less than zero).\n *\n * @returns {RequiredValidation} - A validation function that takes a received number and a path to the error message. Throws an error if the received value is not negative.\n *\n * @example\n * const schema = number().custom(negative());\n * parseSchema(schema, -10); // Valid\n * parseSchema(schema, 0); // Throws an error: 'The received value is not a negative number'\n * parseSchema(schema, 5); // Throws an error: 'The received value is not a negative number'\n */\nexport const negative = (): RequiredValidation => (received: number, pathToError: string) => {\n if (received >= 0) throwException('negative', received, pathToError, 'The received value is not a negative number');\n};\n"],"mappings":";;;;;AAcO,IAAM,WAAW,MAA0B,CAAC,UAAkB,gBAAwB;AAC3F,MAAI,YAAY,EAAG,gBAAe,YAAY,UAAU,aAAa,6CAA6C;AACpH;","names":[]}
|
|
@@ -1,53 +1,12 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
19
2
|
|
|
20
|
-
|
|
21
|
-
var positive_exports = {};
|
|
22
|
-
__export(positive_exports, {
|
|
23
|
-
positive: () => positive
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(positive_exports);
|
|
26
|
-
|
|
27
|
-
// src/exceptions.ts
|
|
28
|
-
var ValidationError = class extends Error {
|
|
29
|
-
expected;
|
|
30
|
-
received;
|
|
31
|
-
pathToError;
|
|
32
|
-
message;
|
|
33
|
-
constructor(expected, received, pathToError, message) {
|
|
34
|
-
super();
|
|
35
|
-
this.expected = expected;
|
|
36
|
-
this.received = received;
|
|
37
|
-
this.pathToError = pathToError;
|
|
38
|
-
this.message = message;
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
function throwException(expected, received, pathToError, message) {
|
|
42
|
-
throw new ValidationError(expected, received, pathToError, message);
|
|
43
|
-
}
|
|
3
|
+
var _chunk2AP4OQMTjs = require('../../chunk-2AP4OQMT.js');
|
|
44
4
|
|
|
45
5
|
// src/asserts/number/positive.ts
|
|
46
6
|
var positive = () => (received, pathToError) => {
|
|
47
|
-
if (received <= 0) throwException("positive", received, pathToError, "The received value is not a positive number");
|
|
7
|
+
if (received <= 0) _chunk2AP4OQMTjs.throwException.call(void 0, "positive", received, pathToError, "The received value is not a positive number");
|
|
48
8
|
};
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
});
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
exports.positive = positive;
|
|
53
12
|
//# sourceMappingURL=positive.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/bguard/bguard/lib/asserts/number/positive.js","../../../src/asserts/number/positive.ts"],"names":[],"mappings":"AAAA;AACE;AACF,0DAAgC;AAChC;AACA;ACUO,IAAM,SAAA,EAAW,CAAA,EAAA,GAA0B,CAAC,QAAA,EAAkB,WAAA,EAAA,GAAwB;AAC3F,EAAA,GAAA,CAAI,SAAA,GAAY,CAAA,EAAG,6CAAA,UAAe,EAAY,QAAA,EAAU,WAAA,EAAa,6CAA6C,CAAA;AACpH,CAAA;ADRA;AACE;AACF,4BAAC","file":"/home/runner/work/bguard/bguard/lib/asserts/number/positive.js","sourcesContent":[null,"import { throwException } from '../../exceptions';\nimport type { RequiredValidation } from '../../schemas/CommonSchema';\n\n/**\n * Asserts that a number value is positive (greater than zero).\n *\n * @returns {RequiredValidation} - A validation function that takes a received number and a path to the error message. Throws an error if the received value is not positive.\n *\n * @example\n * const schema = number().custom(positive());\n * parseSchema(schema, 10); // Valid\n * parseSchema(schema, 0); // Throws an error: 'The received value is not a positive number'\n * parseSchema(schema, -5); // Throws an error: 'The received value is not a positive number'\n */\nexport const positive = (): RequiredValidation => (received: number, pathToError: string) => {\n if (received <= 0) throwException('positive', received, pathToError, 'The received value is not a positive number');\n};\n"]}
|
|
@@ -1,20 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
received;
|
|
5
|
-
pathToError;
|
|
6
|
-
message;
|
|
7
|
-
constructor(expected, received, pathToError, message) {
|
|
8
|
-
super();
|
|
9
|
-
this.expected = expected;
|
|
10
|
-
this.received = received;
|
|
11
|
-
this.pathToError = pathToError;
|
|
12
|
-
this.message = message;
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
function throwException(expected, received, pathToError, message) {
|
|
16
|
-
throw new ValidationError(expected, received, pathToError, message);
|
|
17
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
throwException
|
|
3
|
+
} from "../../chunk-QJOXKH7A.mjs";
|
|
18
4
|
|
|
19
5
|
// src/asserts/number/positive.ts
|
|
20
6
|
var positive = () => (received, pathToError) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/
|
|
1
|
+
{"version":3,"sources":["../../../src/asserts/number/positive.ts"],"sourcesContent":["import { throwException } from '../../exceptions';\nimport type { RequiredValidation } from '../../schemas/CommonSchema';\n\n/**\n * Asserts that a number value is positive (greater than zero).\n *\n * @returns {RequiredValidation} - A validation function that takes a received number and a path to the error message. Throws an error if the received value is not positive.\n *\n * @example\n * const schema = number().custom(positive());\n * parseSchema(schema, 10); // Valid\n * parseSchema(schema, 0); // Throws an error: 'The received value is not a positive number'\n * parseSchema(schema, -5); // Throws an error: 'The received value is not a positive number'\n */\nexport const positive = (): RequiredValidation => (received: number, pathToError: string) => {\n if (received <= 0) throwException('positive', received, pathToError, 'The received value is not a positive number');\n};\n"],"mappings":";;;;;AAcO,IAAM,WAAW,MAA0B,CAAC,UAAkB,gBAAwB;AAC3F,MAAI,YAAY,EAAG,gBAAe,YAAY,UAAU,aAAa,6CAA6C;AACpH;","names":[]}
|
|
@@ -1,94 +1,11 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
19
2
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
module.exports = __toCommonJS(object_exports);
|
|
3
|
+
var _chunkK2S3FS5Kjs = require('../../chunk-K2S3FS5K.js');
|
|
4
|
+
require('../../chunk-IQ3QYABE.js');
|
|
5
|
+
require('../../chunk-APTTIN2L.js');
|
|
6
|
+
require('../../chunk-5NCJN6D2.js');
|
|
7
|
+
require('../../chunk-2AP4OQMT.js');
|
|
26
8
|
|
|
27
|
-
// src/exceptions.ts
|
|
28
|
-
var BuildSchemaError = class extends Error {
|
|
29
|
-
};
|
|
30
9
|
|
|
31
|
-
|
|
32
|
-
var ctxSymbol = Symbol("contextSymbol");
|
|
33
|
-
|
|
34
|
-
// src/schemas/CommonSchema.ts
|
|
35
|
-
var CommonSchema = class {
|
|
36
|
-
[ctxSymbol];
|
|
37
|
-
constructor(ctx) {
|
|
38
|
-
this[ctxSymbol] = ctx;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* @param validators - One or more custom validation functions.
|
|
42
|
-
* @returns {this} The schema instance with the added custom validation.
|
|
43
|
-
*/
|
|
44
|
-
custom(...validators) {
|
|
45
|
-
this[ctxSymbol].requiredValidations.push(...validators);
|
|
46
|
-
return this;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Marks the schema as nullable, allowing the value to be `null`.
|
|
50
|
-
*
|
|
51
|
-
* @returns {WithNull<this>} The schema instance marked as nullable.
|
|
52
|
-
*/
|
|
53
|
-
nullable() {
|
|
54
|
-
this[ctxSymbol].isNullable = true;
|
|
55
|
-
return this;
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Marks the schema as optional, allowing the value to be `undefined`.
|
|
59
|
-
*
|
|
60
|
-
* @returns {WithUndefined<this>}} The schema instance marked as optional.
|
|
61
|
-
*/
|
|
62
|
-
optional() {
|
|
63
|
-
this[ctxSymbol].isOptional = true;
|
|
64
|
-
return this;
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
// src/schemas/ObjectSchema.ts
|
|
69
|
-
var ObjectSchema = class extends CommonSchema {
|
|
70
|
-
_object = 1;
|
|
71
|
-
constructor(ctx, shapeSchema) {
|
|
72
|
-
super(ctx);
|
|
73
|
-
this.validateObjectEntry(shapeSchema);
|
|
74
|
-
this[ctxSymbol].object = shapeSchema;
|
|
75
|
-
}
|
|
76
|
-
validateObjectEntry(shapeSchema) {
|
|
77
|
-
if (!shapeSchema) throw new BuildSchemaError("Missing schema in object method");
|
|
78
|
-
if (shapeSchema instanceof CommonSchema) throw new BuildSchemaError("Invalid schema in object");
|
|
79
|
-
for (const [key, value] of Object.entries(shapeSchema)) {
|
|
80
|
-
if (!(value instanceof CommonSchema))
|
|
81
|
-
throw new BuildSchemaError(`Invalid schema in object method for property '${key}'`);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
// src/asserts/object/index.ts
|
|
87
|
-
function object(shapeSchema) {
|
|
88
|
-
return new ObjectSchema({ type: [], requiredValidations: [] }, shapeSchema);
|
|
89
|
-
}
|
|
90
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
91
|
-
0 && (module.exports = {
|
|
92
|
-
object
|
|
93
|
-
});
|
|
10
|
+
exports.object = _chunkK2S3FS5Kjs.object;
|
|
94
11
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/bguard/bguard/lib/asserts/object/index.js"],"names":[],"mappings":"AAAA;AACE;AACF,0DAAgC;AAChC,mCAAgC;AAChC,mCAAgC;AAChC,mCAAgC;AAChC,mCAAgC;AAChC;AACE;AACF,yCAAC","file":"/home/runner/work/bguard/bguard/lib/asserts/object/index.js"}
|