@nest-boot/validator 7.3.7 → 8.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/decorators/common/array-length.decorator.d.ts +0 -8
- package/dist/decorators/common/array-length.decorator.js +12 -25
- package/dist/decorators/common/array-length.decorator.js.map +1 -1
- package/dist/decorators/index.d.ts +14 -14
- package/dist/decorators/index.js +14 -34
- package/dist/decorators/index.js.map +1 -1
- package/dist/decorators/number/is-greater-than-or-equal.decorator.d.ts +0 -6
- package/dist/decorators/number/is-greater-than-or-equal.decorator.js +3 -12
- package/dist/decorators/number/is-greater-than-or-equal.decorator.js.map +1 -1
- package/dist/decorators/number/is-greater-than.decorator.d.ts +0 -6
- package/dist/decorators/number/is-greater-than.decorator.js +3 -12
- package/dist/decorators/number/is-greater-than.decorator.js.map +1 -1
- package/dist/decorators/number/is-less-than-or-equal.decorator.d.ts +0 -6
- package/dist/decorators/number/is-less-than-or-equal.decorator.js +3 -12
- package/dist/decorators/number/is-less-than-or-equal.decorator.js.map +1 -1
- package/dist/decorators/number/is-less-than.decorator.d.ts +0 -6
- package/dist/decorators/number/is-less-than.decorator.js +3 -12
- package/dist/decorators/number/is-less-than.decorator.js.map +1 -1
- package/dist/decorators/number/max.decorator.d.ts +0 -6
- package/dist/decorators/number/max.decorator.js +5 -14
- package/dist/decorators/number/max.decorator.js.map +1 -1
- package/dist/decorators/number/min.decorator.d.ts +0 -6
- package/dist/decorators/number/min.decorator.js +5 -14
- package/dist/decorators/number/min.decorator.js.map +1 -1
- package/dist/decorators/number/validate-compare-number.decorator.d.ts +0 -13
- package/dist/decorators/number/validate-compare-number.decorator.js +9 -27
- package/dist/decorators/number/validate-compare-number.decorator.js.map +1 -1
- package/dist/decorators/string/is-domain.decorator.d.ts +0 -5
- package/dist/decorators/string/is-domain.decorator.js +5 -13
- package/dist/decorators/string/is-domain.decorator.js.map +1 -1
- package/dist/decorators/string/is-email.decorator.d.ts +1 -10
- package/dist/decorators/string/is-email.decorator.js +11 -27
- package/dist/decorators/string/is-email.decorator.js.map +1 -1
- package/dist/decorators/string/is-number-string.decorator.d.ts +1 -10
- package/dist/decorators/string/is-number-string.decorator.js +11 -27
- package/dist/decorators/string/is-number-string.decorator.js.map +1 -1
- package/dist/decorators/string/is-timezone.decorator.d.ts +0 -5
- package/dist/decorators/string/is-timezone.decorator.js +7 -18
- package/dist/decorators/string/is-timezone.decorator.js.map +1 -1
- package/dist/decorators/string/is-url.decorator.d.ts +1 -10
- package/dist/decorators/string/is-url.decorator.js +11 -27
- package/dist/decorators/string/is-url.decorator.js.map +1 -1
- package/dist/decorators/string/length.decorator.d.ts +0 -9
- package/dist/decorators/string/length.decorator.js +11 -27
- package/dist/decorators/string/length.decorator.js.map +1 -1
- package/dist/decorators/type-check/is-date.decorator.d.ts +0 -7
- package/dist/decorators/type-check/is-date.decorator.js +8 -20
- package/dist/decorators/type-check/is-date.decorator.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +4 -22
- package/dist/index.js.map +1 -1
- package/dist/utils/build-i18n-message.d.ts +0 -10
- package/dist/utils/build-i18n-message.js +4 -17
- package/dist/utils/build-i18n-message.js.map +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +1 -17
- package/dist/utils/index.js.map +1 -1
- package/package.json +34 -22
- package/dist/decorators/common/array-length.decorator.spec.d.ts +0 -1
- package/dist/decorators/common/array-length.decorator.spec.js +0 -46
- package/dist/decorators/common/array-length.decorator.spec.js.map +0 -1
- package/dist/decorators/number/number-decorators.spec.d.ts +0 -1
- package/dist/decorators/number/number-decorators.spec.js +0 -99
- package/dist/decorators/number/number-decorators.spec.js.map +0 -1
- package/dist/decorators/string/length.decorator.spec.d.ts +0 -1
- package/dist/decorators/string/length.decorator.spec.js +0 -51
- package/dist/decorators/string/length.decorator.spec.js.map +0 -1
- package/dist/decorators/string/string-decorators.spec.d.ts +0 -1
- package/dist/decorators/string/string-decorators.spec.js +0 -105
- package/dist/decorators/string/string-decorators.spec.js.map +0 -1
- package/dist/tsconfig.build.tsbuildinfo +0 -1
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
import { type ValidationOptions } from "class-validator";
|
|
2
|
-
/** Options for the {@link ArrayLength} decorator. */
|
|
3
2
|
export interface ArrayLengthOptions extends ValidationOptions {
|
|
4
|
-
/** Minimum array length. */
|
|
5
3
|
min?: number;
|
|
6
|
-
/** Maximum array length. */
|
|
7
4
|
max?: number;
|
|
8
5
|
}
|
|
9
|
-
/**
|
|
10
|
-
* Validates that the array length falls within the specified range.
|
|
11
|
-
* @param validationOptions - Array length constraints and validation options
|
|
12
|
-
* @returns Property decorator
|
|
13
|
-
*/
|
|
14
6
|
export declare function ArrayLength(validationOptions: ArrayLengthOptions): PropertyDecorator;
|
|
@@ -1,46 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.ArrayLength = ArrayLength;
|
|
4
|
-
const i18n_1 = require("@nest-boot/i18n");
|
|
5
|
-
const class_validator_1 = require("class-validator");
|
|
1
|
+
import { t } from "@nest-boot/i18n";
|
|
2
|
+
import { registerDecorator } from "class-validator";
|
|
6
3
|
function arrayLengthMessage(value, property, min, max) {
|
|
7
4
|
if (Array.isArray(value)) {
|
|
8
5
|
if (typeof min !== "undefined" && typeof max !== "undefined") {
|
|
9
|
-
return
|
|
10
|
-
property:
|
|
6
|
+
return t("validation:arrayLength.between", {
|
|
7
|
+
property: t(`property:${property}`),
|
|
11
8
|
min,
|
|
12
9
|
max,
|
|
13
10
|
});
|
|
14
11
|
}
|
|
15
|
-
// Length is less than required
|
|
16
12
|
if (typeof min !== "undefined" && value.length < min) {
|
|
17
|
-
return
|
|
18
|
-
property:
|
|
13
|
+
return t("validation:arrayLength.gte", {
|
|
14
|
+
property: t(`property:${property}`),
|
|
19
15
|
compareProperty: String(min),
|
|
20
16
|
});
|
|
21
17
|
}
|
|
22
|
-
// Length exceeds required
|
|
23
18
|
if (typeof max !== "undefined" && value.length > max) {
|
|
24
|
-
return
|
|
25
|
-
property:
|
|
19
|
+
return t("validation:arrayLength.lte", {
|
|
20
|
+
property: t(`property:${property}`),
|
|
26
21
|
compareProperty: String(max),
|
|
27
22
|
});
|
|
28
23
|
}
|
|
29
24
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
property: (0, i18n_1.t)(`property:${property}`),
|
|
25
|
+
return t("validation:is-array", {
|
|
26
|
+
property: t(`property:${property}`),
|
|
33
27
|
});
|
|
34
28
|
}
|
|
35
|
-
|
|
36
|
-
* Validates that the array length falls within the specified range.
|
|
37
|
-
* @param validationOptions - Array length constraints and validation options
|
|
38
|
-
* @returns Property decorator
|
|
39
|
-
*/
|
|
40
|
-
function ArrayLength(validationOptions) {
|
|
29
|
+
export function ArrayLength(validationOptions) {
|
|
41
30
|
return (target, propertyName) => {
|
|
42
31
|
if (typeof propertyName === "string") {
|
|
43
|
-
|
|
32
|
+
registerDecorator({
|
|
44
33
|
name: "arrayLength",
|
|
45
34
|
target: target.constructor,
|
|
46
35
|
propertyName,
|
|
@@ -55,11 +44,9 @@ function ArrayLength(validationOptions) {
|
|
|
55
44
|
}
|
|
56
45
|
return true;
|
|
57
46
|
}
|
|
58
|
-
// Not an array
|
|
59
47
|
return false;
|
|
60
48
|
},
|
|
61
49
|
defaultMessage(args) {
|
|
62
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
63
50
|
const { value, property } = args;
|
|
64
51
|
const { min, max } = validationOptions;
|
|
65
52
|
return arrayLengthMessage(value, property, min, max);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"array-length.decorator.js","sourceRoot":"","sources":["../../../src/decorators/common/array-length.decorator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"array-length.decorator.js","sourceRoot":"","sources":["../../../src/decorators/common/array-length.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,iBAAiB,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAA0B,MAAM,iBAAiB,CAAC;AAU5E,SAAS,kBAAkB,CACzB,KAAc,EACd,QAAgB,EAChB,GAAY,EACZ,GAAY;IAEZ,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,IAAI,OAAO,GAAG,KAAK,WAAW,IAAI,OAAO,GAAG,KAAK,WAAW,EAAE,CAAC;YAC7D,OAAO,CAAC,CAAC,gCAAgC,EAAE;gBACzC,QAAQ,EAAE,CAAC,CAAC,YAAY,QAAQ,EAAE,CAAC;gBACnC,GAAG;gBACH,GAAG;aACJ,CAAC,CAAC;QACL,CAAC;QAGD,IAAI,OAAO,GAAG,KAAK,WAAW,IAAI,KAAK,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC;YACrD,OAAO,CAAC,CAAC,4BAA4B,EAAE;gBACrC,QAAQ,EAAE,CAAC,CAAC,YAAY,QAAQ,EAAE,CAAC;gBACnC,eAAe,EAAE,MAAM,CAAC,GAAG,CAAC;aAC7B,CAAC,CAAC;QACL,CAAC;QAGD,IAAI,OAAO,GAAG,KAAK,WAAW,IAAI,KAAK,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC;YACrD,OAAO,CAAC,CAAC,4BAA4B,EAAE;gBACrC,QAAQ,EAAE,CAAC,CAAC,YAAY,QAAQ,EAAE,CAAC;gBACnC,eAAe,EAAE,MAAM,CAAC,GAAG,CAAC;aAC7B,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAGD,OAAO,CAAC,CAAC,qBAAqB,EAAE;QAC9B,QAAQ,EAAE,CAAC,CAAC,YAAY,QAAQ,EAAE,CAAC;KACpC,CAAC,CAAC;AACL,CAAC;AAOD,MAAM,UAAU,WAAW,CACzB,iBAAqC;IAErC,OAAO,CAAC,MAAc,EAAE,YAA6B,EAAE,EAAE;QACvD,IAAI,OAAO,YAAY,KAAK,QAAQ,EAAE,CAAC;YACrC,iBAAiB,CAAC;gBAChB,IAAI,EAAE,aAAa;gBACnB,MAAM,EAAE,MAAM,CAAC,WAAW;gBAC1B,YAAY;gBACZ,OAAO,EAAE,iBAAiB;gBAC1B,SAAS,EAAE;oBACT,QAAQ,CAAC,KAAc;wBACrB,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;4BACzB,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,iBAAiB,CAAC;4BAEvC,IACE,CAAC,OAAO,GAAG,KAAK,WAAW,IAAI,KAAK,CAAC,MAAM,GAAG,GAAG,CAAC;gCAClD,CAAC,OAAO,GAAG,KAAK,WAAW,IAAI,KAAK,CAAC,MAAM,GAAG,GAAG,CAAC,EAClD,CAAC;gCACD,OAAO,KAAK,CAAC;4BACf,CAAC;4BAED,OAAO,IAAI,CAAC;wBACd,CAAC;wBAGD,OAAO,KAAK,CAAC;oBACf,CAAC;oBACD,cAAc,CAAC,IAAI;wBAEjB,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,IAAK,CAAC;wBAClC,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,iBAAiB,CAAC;wBACvC,OAAO,kBAAkB,CAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;oBACvD,CAAC;iBACF;aACF,CAAC,CAAC;QACL,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
export * from "./common/array-length.decorator";
|
|
2
|
-
export * from "./string/is-domain.decorator";
|
|
3
|
-
export * from "./string/is-email.decorator";
|
|
4
|
-
export * from "./string/is-number-string.decorator";
|
|
5
|
-
export * from "./string/is-timezone.decorator";
|
|
6
|
-
export * from "./string/is-url.decorator";
|
|
7
|
-
export * from "./string/length.decorator";
|
|
8
|
-
export * from "./number/is-greater-than.decorator";
|
|
9
|
-
export * from "./number/is-greater-than-or-equal.decorator";
|
|
10
|
-
export * from "./number/is-less-than.decorator";
|
|
11
|
-
export * from "./number/is-less-than-or-equal.decorator";
|
|
12
|
-
export * from "./number/max.decorator";
|
|
13
|
-
export * from "./number/min.decorator";
|
|
14
|
-
export * from "./type-check/is-date.decorator";
|
|
1
|
+
export * from "./common/array-length.decorator.js";
|
|
2
|
+
export * from "./string/is-domain.decorator.js";
|
|
3
|
+
export * from "./string/is-email.decorator.js";
|
|
4
|
+
export * from "./string/is-number-string.decorator.js";
|
|
5
|
+
export * from "./string/is-timezone.decorator.js";
|
|
6
|
+
export * from "./string/is-url.decorator.js";
|
|
7
|
+
export * from "./string/length.decorator.js";
|
|
8
|
+
export * from "./number/is-greater-than.decorator.js";
|
|
9
|
+
export * from "./number/is-greater-than-or-equal.decorator.js";
|
|
10
|
+
export * from "./number/is-less-than.decorator.js";
|
|
11
|
+
export * from "./number/is-less-than-or-equal.decorator.js";
|
|
12
|
+
export * from "./number/max.decorator.js";
|
|
13
|
+
export * from "./number/min.decorator.js";
|
|
14
|
+
export * from "./type-check/is-date.decorator.js";
|
package/dist/decorators/index.js
CHANGED
|
@@ -1,35 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
// Common
|
|
18
|
-
__exportStar(require("./common/array-length.decorator"), exports);
|
|
19
|
-
// String
|
|
20
|
-
__exportStar(require("./string/is-domain.decorator"), exports);
|
|
21
|
-
__exportStar(require("./string/is-email.decorator"), exports);
|
|
22
|
-
__exportStar(require("./string/is-number-string.decorator"), exports);
|
|
23
|
-
__exportStar(require("./string/is-timezone.decorator"), exports);
|
|
24
|
-
__exportStar(require("./string/is-url.decorator"), exports);
|
|
25
|
-
__exportStar(require("./string/length.decorator"), exports);
|
|
26
|
-
// Number
|
|
27
|
-
__exportStar(require("./number/is-greater-than.decorator"), exports);
|
|
28
|
-
__exportStar(require("./number/is-greater-than-or-equal.decorator"), exports);
|
|
29
|
-
__exportStar(require("./number/is-less-than.decorator"), exports);
|
|
30
|
-
__exportStar(require("./number/is-less-than-or-equal.decorator"), exports);
|
|
31
|
-
__exportStar(require("./number/max.decorator"), exports);
|
|
32
|
-
__exportStar(require("./number/min.decorator"), exports);
|
|
33
|
-
// Type check
|
|
34
|
-
__exportStar(require("./type-check/is-date.decorator"), exports);
|
|
1
|
+
export * from "./common/array-length.decorator.js";
|
|
2
|
+
export * from "./string/is-domain.decorator.js";
|
|
3
|
+
export * from "./string/is-email.decorator.js";
|
|
4
|
+
export * from "./string/is-number-string.decorator.js";
|
|
5
|
+
export * from "./string/is-timezone.decorator.js";
|
|
6
|
+
export * from "./string/is-url.decorator.js";
|
|
7
|
+
export * from "./string/length.decorator.js";
|
|
8
|
+
export * from "./number/is-greater-than.decorator.js";
|
|
9
|
+
export * from "./number/is-greater-than-or-equal.decorator.js";
|
|
10
|
+
export * from "./number/is-less-than.decorator.js";
|
|
11
|
+
export * from "./number/is-less-than-or-equal.decorator.js";
|
|
12
|
+
export * from "./number/max.decorator.js";
|
|
13
|
+
export * from "./number/min.decorator.js";
|
|
14
|
+
export * from "./type-check/is-date.decorator.js";
|
|
35
15
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/decorators/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/decorators/index.ts"],"names":[],"mappings":"AACA,cAAc,oCAAoC,CAAC;AAGnD,cAAc,iCAAiC,CAAC;AAChD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,wCAAwC,CAAC;AACvD,cAAc,mCAAmC,CAAC;AAClD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAG7C,cAAc,uCAAuC,CAAC;AACtD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,oCAAoC,CAAC;AACnD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAG1C,cAAc,mCAAmC,CAAC"}
|
|
@@ -1,8 +1,2 @@
|
|
|
1
1
|
import { type ValidationOptions } from "class-validator";
|
|
2
|
-
/**
|
|
3
|
-
* Validates that the property value is greater than or equal to the given field's value.
|
|
4
|
-
* @param field - The name of the property to compare against
|
|
5
|
-
* @param validationOptions - Optional class-validator validation options
|
|
6
|
-
* @returns Property decorator
|
|
7
|
-
*/
|
|
8
2
|
export declare function IsGreaterThanOrEqual(field: string, validationOptions?: ValidationOptions): PropertyDecorator;
|
|
@@ -1,14 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const validate_compare_number_decorator_1 = require("./validate-compare-number.decorator");
|
|
5
|
-
/**
|
|
6
|
-
* Validates that the property value is greater than or equal to the given field's value.
|
|
7
|
-
* @param field - The name of the property to compare against
|
|
8
|
-
* @param validationOptions - Optional class-validator validation options
|
|
9
|
-
* @returns Property decorator
|
|
10
|
-
*/
|
|
11
|
-
function IsGreaterThanOrEqual(field, validationOptions) {
|
|
12
|
-
return (0, validate_compare_number_decorator_1.ValidateCompareNumber)(validate_compare_number_decorator_1.Comparator.GTE, field, validationOptions);
|
|
1
|
+
import { Comparator, ValidateCompareNumber, } from "./validate-compare-number.decorator.js";
|
|
2
|
+
export function IsGreaterThanOrEqual(field, validationOptions) {
|
|
3
|
+
return ValidateCompareNumber(Comparator.GTE, field, validationOptions);
|
|
13
4
|
}
|
|
14
5
|
//# sourceMappingURL=is-greater-than-or-equal.decorator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-greater-than-or-equal.decorator.js","sourceRoot":"","sources":["../../../src/decorators/number/is-greater-than-or-equal.decorator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"is-greater-than-or-equal.decorator.js","sourceRoot":"","sources":["../../../src/decorators/number/is-greater-than-or-equal.decorator.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,UAAU,EACV,qBAAqB,GACtB,MAAM,wCAAwC,CAAC;AAQhD,MAAM,UAAU,oBAAoB,CAClC,KAAa,EACb,iBAAqC;IAErC,OAAO,qBAAqB,CAAC,UAAU,CAAC,GAAG,EAAE,KAAK,EAAE,iBAAiB,CAAC,CAAC;AACzE,CAAC"}
|
|
@@ -1,8 +1,2 @@
|
|
|
1
1
|
import { type ValidationOptions } from "class-validator";
|
|
2
|
-
/**
|
|
3
|
-
* Validates that the property value is greater than the given field's value.
|
|
4
|
-
* @param field - The name of the property to compare against
|
|
5
|
-
* @param validationOptions - Optional class-validator validation options
|
|
6
|
-
* @returns Property decorator
|
|
7
|
-
*/
|
|
8
2
|
export declare function IsGreaterThan(field: string, validationOptions?: ValidationOptions): PropertyDecorator;
|
|
@@ -1,14 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const validate_compare_number_decorator_1 = require("./validate-compare-number.decorator");
|
|
5
|
-
/**
|
|
6
|
-
* Validates that the property value is greater than the given field's value.
|
|
7
|
-
* @param field - The name of the property to compare against
|
|
8
|
-
* @param validationOptions - Optional class-validator validation options
|
|
9
|
-
* @returns Property decorator
|
|
10
|
-
*/
|
|
11
|
-
function IsGreaterThan(field, validationOptions) {
|
|
12
|
-
return (0, validate_compare_number_decorator_1.ValidateCompareNumber)(validate_compare_number_decorator_1.Comparator.GT, field, validationOptions);
|
|
1
|
+
import { Comparator, ValidateCompareNumber, } from "./validate-compare-number.decorator.js";
|
|
2
|
+
export function IsGreaterThan(field, validationOptions) {
|
|
3
|
+
return ValidateCompareNumber(Comparator.GT, field, validationOptions);
|
|
13
4
|
}
|
|
14
5
|
//# sourceMappingURL=is-greater-than.decorator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-greater-than.decorator.js","sourceRoot":"","sources":["../../../src/decorators/number/is-greater-than.decorator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"is-greater-than.decorator.js","sourceRoot":"","sources":["../../../src/decorators/number/is-greater-than.decorator.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,UAAU,EACV,qBAAqB,GACtB,MAAM,wCAAwC,CAAC;AAQhD,MAAM,UAAU,aAAa,CAC3B,KAAa,EACb,iBAAqC;IAErC,OAAO,qBAAqB,CAAC,UAAU,CAAC,EAAE,EAAE,KAAK,EAAE,iBAAiB,CAAC,CAAC;AACxE,CAAC"}
|
|
@@ -1,8 +1,2 @@
|
|
|
1
1
|
import { type ValidationOptions } from "class-validator";
|
|
2
|
-
/**
|
|
3
|
-
* Validates that the property value is less than or equal to the given field's value.
|
|
4
|
-
* @param field - The name of the property to compare against
|
|
5
|
-
* @param validationOptions - Optional class-validator validation options
|
|
6
|
-
* @returns Property decorator
|
|
7
|
-
*/
|
|
8
2
|
export declare function IsLessThanOrEqual(field: string, validationOptions?: ValidationOptions): PropertyDecorator;
|
|
@@ -1,14 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const validate_compare_number_decorator_1 = require("./validate-compare-number.decorator");
|
|
5
|
-
/**
|
|
6
|
-
* Validates that the property value is less than or equal to the given field's value.
|
|
7
|
-
* @param field - The name of the property to compare against
|
|
8
|
-
* @param validationOptions - Optional class-validator validation options
|
|
9
|
-
* @returns Property decorator
|
|
10
|
-
*/
|
|
11
|
-
function IsLessThanOrEqual(field, validationOptions) {
|
|
12
|
-
return (0, validate_compare_number_decorator_1.ValidateCompareNumber)(validate_compare_number_decorator_1.Comparator.LTE, field, validationOptions);
|
|
1
|
+
import { Comparator, ValidateCompareNumber, } from "./validate-compare-number.decorator.js";
|
|
2
|
+
export function IsLessThanOrEqual(field, validationOptions) {
|
|
3
|
+
return ValidateCompareNumber(Comparator.LTE, field, validationOptions);
|
|
13
4
|
}
|
|
14
5
|
//# sourceMappingURL=is-less-than-or-equal.decorator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-less-than-or-equal.decorator.js","sourceRoot":"","sources":["../../../src/decorators/number/is-less-than-or-equal.decorator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"is-less-than-or-equal.decorator.js","sourceRoot":"","sources":["../../../src/decorators/number/is-less-than-or-equal.decorator.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,UAAU,EACV,qBAAqB,GACtB,MAAM,wCAAwC,CAAC;AAQhD,MAAM,UAAU,iBAAiB,CAC/B,KAAa,EACb,iBAAqC;IAErC,OAAO,qBAAqB,CAAC,UAAU,CAAC,GAAG,EAAE,KAAK,EAAE,iBAAiB,CAAC,CAAC;AACzE,CAAC"}
|
|
@@ -1,8 +1,2 @@
|
|
|
1
1
|
import { type ValidationOptions } from "class-validator";
|
|
2
|
-
/**
|
|
3
|
-
* Validates that the property value is less than the given field's value.
|
|
4
|
-
* @param field - The name of the property to compare against
|
|
5
|
-
* @param validationOptions - Optional class-validator validation options
|
|
6
|
-
* @returns Property decorator
|
|
7
|
-
*/
|
|
8
2
|
export declare function IsLessThan(field: string, validationOptions?: ValidationOptions): PropertyDecorator;
|
|
@@ -1,14 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const validate_compare_number_decorator_1 = require("./validate-compare-number.decorator");
|
|
5
|
-
/**
|
|
6
|
-
* Validates that the property value is less than the given field's value.
|
|
7
|
-
* @param field - The name of the property to compare against
|
|
8
|
-
* @param validationOptions - Optional class-validator validation options
|
|
9
|
-
* @returns Property decorator
|
|
10
|
-
*/
|
|
11
|
-
function IsLessThan(field, validationOptions) {
|
|
12
|
-
return (0, validate_compare_number_decorator_1.ValidateCompareNumber)(validate_compare_number_decorator_1.Comparator.LT, field, validationOptions);
|
|
1
|
+
import { Comparator, ValidateCompareNumber, } from "./validate-compare-number.decorator.js";
|
|
2
|
+
export function IsLessThan(field, validationOptions) {
|
|
3
|
+
return ValidateCompareNumber(Comparator.LT, field, validationOptions);
|
|
13
4
|
}
|
|
14
5
|
//# sourceMappingURL=is-less-than.decorator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-less-than.decorator.js","sourceRoot":"","sources":["../../../src/decorators/number/is-less-than.decorator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"is-less-than.decorator.js","sourceRoot":"","sources":["../../../src/decorators/number/is-less-than.decorator.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,UAAU,EACV,qBAAqB,GACtB,MAAM,wCAAwC,CAAC;AAQhD,MAAM,UAAU,UAAU,CACxB,KAAa,EACb,iBAAqC;IAErC,OAAO,qBAAqB,CAAC,UAAU,CAAC,EAAE,EAAE,KAAK,EAAE,iBAAiB,CAAC,CAAC;AACxE,CAAC"}
|
|
@@ -1,8 +1,2 @@
|
|
|
1
1
|
import { type ValidationOptions } from "class-validator";
|
|
2
|
-
/**
|
|
3
|
-
* Validates that the property value is less than or equal to the specified maximum.
|
|
4
|
-
* @param maxValue - The maximum allowed value
|
|
5
|
-
* @param validationOptions - Optional class-validator validation options
|
|
6
|
-
* @returns Property decorator
|
|
7
|
-
*/
|
|
8
2
|
export declare function Max(maxValue: number, validationOptions?: ValidationOptions): PropertyDecorator;
|
|
@@ -1,22 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const utils_1 = require("../../utils");
|
|
6
|
-
/**
|
|
7
|
-
* Validates that the property value is less than or equal to the specified maximum.
|
|
8
|
-
* @param maxValue - The maximum allowed value
|
|
9
|
-
* @param validationOptions - Optional class-validator validation options
|
|
10
|
-
* @returns Property decorator
|
|
11
|
-
*/
|
|
12
|
-
function Max(maxValue, validationOptions) {
|
|
13
|
-
return (0, class_validator_1.ValidateBy)({
|
|
1
|
+
import { ValidateBy } from "class-validator";
|
|
2
|
+
import { buildI18nMessage } from "../../utils/index.js";
|
|
3
|
+
export function Max(maxValue, validationOptions) {
|
|
4
|
+
return ValidateBy({
|
|
14
5
|
name: "max",
|
|
15
6
|
constraints: [maxValue],
|
|
16
7
|
validator: {
|
|
17
8
|
validate: (value, args) => typeof args !== "undefined" &&
|
|
18
9
|
Number(value) <= Number(args.constraints[0]),
|
|
19
|
-
defaultMessage:
|
|
10
|
+
defaultMessage: buildI18nMessage(() => "max"),
|
|
20
11
|
},
|
|
21
12
|
}, validationOptions);
|
|
22
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"max.decorator.js","sourceRoot":"","sources":["../../../src/decorators/number/max.decorator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"max.decorator.js","sourceRoot":"","sources":["../../../src/decorators/number/max.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAA0B,MAAM,iBAAiB,CAAC;AAErE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAQxD,MAAM,UAAU,GAAG,CACjB,QAAgB,EAChB,iBAAqC;IAErC,OAAO,UAAU,CACf;QACE,IAAI,EAAE,KAAK;QACX,WAAW,EAAE,CAAC,QAAQ,CAAC;QACvB,SAAS,EAAE;YACT,QAAQ,EAAE,CAAC,KAAK,EAAE,IAAI,EAAW,EAAE,CACjC,OAAO,IAAI,KAAK,WAAW;gBAC3B,MAAM,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;YAC9C,cAAc,EAAE,gBAAgB,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC;SAC9C;KACF,EACD,iBAAiB,CAClB,CAAC;AACJ,CAAC"}
|
|
@@ -1,8 +1,2 @@
|
|
|
1
1
|
import { type ValidationOptions } from "class-validator";
|
|
2
|
-
/**
|
|
3
|
-
* Validates that the property value is greater than or equal to the specified minimum.
|
|
4
|
-
* @param minValue - The minimum allowed value
|
|
5
|
-
* @param validationOptions - Optional class-validator validation options
|
|
6
|
-
* @returns Property decorator
|
|
7
|
-
*/
|
|
8
2
|
export declare function Min(minValue: number, validationOptions?: ValidationOptions): PropertyDecorator;
|
|
@@ -1,22 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const utils_1 = require("../../utils");
|
|
6
|
-
/**
|
|
7
|
-
* Validates that the property value is greater than or equal to the specified minimum.
|
|
8
|
-
* @param minValue - The minimum allowed value
|
|
9
|
-
* @param validationOptions - Optional class-validator validation options
|
|
10
|
-
* @returns Property decorator
|
|
11
|
-
*/
|
|
12
|
-
function Min(minValue, validationOptions) {
|
|
13
|
-
return (0, class_validator_1.ValidateBy)({
|
|
1
|
+
import { ValidateBy } from "class-validator";
|
|
2
|
+
import { buildI18nMessage } from "../../utils/index.js";
|
|
3
|
+
export function Min(minValue, validationOptions) {
|
|
4
|
+
return ValidateBy({
|
|
14
5
|
name: "min",
|
|
15
6
|
constraints: [minValue],
|
|
16
7
|
validator: {
|
|
17
8
|
validate: (value, args) => typeof args !== "undefined" &&
|
|
18
9
|
Number(value) >= Number(args.constraints[0]),
|
|
19
|
-
defaultMessage:
|
|
10
|
+
defaultMessage: buildI18nMessage(() => "min"),
|
|
20
11
|
},
|
|
21
12
|
}, validationOptions);
|
|
22
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"min.decorator.js","sourceRoot":"","sources":["../../../src/decorators/number/min.decorator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"min.decorator.js","sourceRoot":"","sources":["../../../src/decorators/number/min.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAA0B,MAAM,iBAAiB,CAAC;AAErE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAQxD,MAAM,UAAU,GAAG,CACjB,QAAgB,EAChB,iBAAqC;IAErC,OAAO,UAAU,CACf;QACE,IAAI,EAAE,KAAK;QACX,WAAW,EAAE,CAAC,QAAQ,CAAC;QACvB,SAAS,EAAE;YACT,QAAQ,EAAE,CAAC,KAAK,EAAE,IAAI,EAAW,EAAE,CACjC,OAAO,IAAI,KAAK,WAAW;gBAC3B,MAAM,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;YAC9C,cAAc,EAAE,gBAAgB,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC;SAC9C;KACF,EACD,iBAAiB,CAClB,CAAC;AACJ,CAAC"}
|
|
@@ -1,22 +1,9 @@
|
|
|
1
1
|
import { type ValidationOptions } from "class-validator";
|
|
2
|
-
/** Comparison operators for number validation. */
|
|
3
2
|
export declare enum Comparator {
|
|
4
|
-
/** Equal to. */
|
|
5
3
|
EQ = "EQ",
|
|
6
|
-
/** Greater than. */
|
|
7
4
|
GT = "GT",
|
|
8
|
-
/** Greater than or equal to. */
|
|
9
5
|
GTE = "GTE",
|
|
10
|
-
/** Less than. */
|
|
11
6
|
LT = "LT",
|
|
12
|
-
/** Less than or equal to. */
|
|
13
7
|
LTE = "LTE"
|
|
14
8
|
}
|
|
15
|
-
/**
|
|
16
|
-
* Validates that a numeric property satisfies a comparison against another property's value.
|
|
17
|
-
* @param comparator - The comparison operator to use
|
|
18
|
-
* @param compareProperty - The name of the property to compare against
|
|
19
|
-
* @param validationOptions - Optional class-validator validation options
|
|
20
|
-
* @returns Property decorator
|
|
21
|
-
*/
|
|
22
9
|
export declare function ValidateCompareNumber(comparator: Comparator, compareProperty: string, validationOptions?: ValidationOptions): PropertyDecorator;
|
|
@@ -1,34 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
exports.ValidateCompareNumber = ValidateCompareNumber;
|
|
5
|
-
const i18n_1 = require("@nest-boot/i18n");
|
|
6
|
-
const class_validator_1 = require("class-validator");
|
|
7
|
-
/** Comparison operators for number validation. */
|
|
8
|
-
var Comparator;
|
|
1
|
+
import { t } from "@nest-boot/i18n";
|
|
2
|
+
import { registerDecorator, } from "class-validator";
|
|
3
|
+
export var Comparator;
|
|
9
4
|
(function (Comparator) {
|
|
10
|
-
/** Equal to. */
|
|
11
5
|
Comparator["EQ"] = "EQ";
|
|
12
|
-
/** Greater than. */
|
|
13
6
|
Comparator["GT"] = "GT";
|
|
14
|
-
/** Greater than or equal to. */
|
|
15
7
|
Comparator["GTE"] = "GTE";
|
|
16
|
-
/** Less than. */
|
|
17
8
|
Comparator["LT"] = "LT";
|
|
18
|
-
/** Less than or equal to. */
|
|
19
9
|
Comparator["LTE"] = "LTE";
|
|
20
|
-
})(Comparator || (
|
|
21
|
-
|
|
22
|
-
* Validates that a numeric property satisfies a comparison against another property's value.
|
|
23
|
-
* @param comparator - The comparison operator to use
|
|
24
|
-
* @param compareProperty - The name of the property to compare against
|
|
25
|
-
* @param validationOptions - Optional class-validator validation options
|
|
26
|
-
* @returns Property decorator
|
|
27
|
-
*/
|
|
28
|
-
function ValidateCompareNumber(comparator, compareProperty, validationOptions) {
|
|
10
|
+
})(Comparator || (Comparator = {}));
|
|
11
|
+
export function ValidateCompareNumber(comparator, compareProperty, validationOptions) {
|
|
29
12
|
return (target, propertyName) => {
|
|
30
13
|
if (typeof propertyName === "string") {
|
|
31
|
-
|
|
14
|
+
registerDecorator({
|
|
32
15
|
name: "isGreaterThanOrEqual",
|
|
33
16
|
target: target.constructor,
|
|
34
17
|
propertyName,
|
|
@@ -60,13 +43,12 @@ function ValidateCompareNumber(comparator, compareProperty, validationOptions) {
|
|
|
60
43
|
}
|
|
61
44
|
},
|
|
62
45
|
defaultMessage(args) {
|
|
63
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
64
46
|
const { property, constraints } = args;
|
|
65
47
|
const [innerComparator, innerCompareProperty] = constraints;
|
|
66
|
-
return
|
|
48
|
+
return t(`validation:is-${innerComparator.toLowerCase()}`, {
|
|
67
49
|
...args,
|
|
68
|
-
property:
|
|
69
|
-
compareProperty:
|
|
50
|
+
property: t(`property:${property}`),
|
|
51
|
+
compareProperty: t(`property:${innerCompareProperty}`),
|
|
70
52
|
});
|
|
71
53
|
},
|
|
72
54
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate-compare-number.decorator.js","sourceRoot":"","sources":["../../../src/decorators/number/validate-compare-number.decorator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"validate-compare-number.decorator.js","sourceRoot":"","sources":["../../../src/decorators/number/validate-compare-number.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,iBAAiB,CAAC;AACpC,OAAO,EACL,iBAAiB,GAGlB,MAAM,iBAAiB,CAAC;AAGzB,MAAM,CAAN,IAAY,UAWX;AAXD,WAAY,UAAU;IAEpB,uBAAS,CAAA;IAET,uBAAS,CAAA;IAET,yBAAW,CAAA;IAEX,uBAAS,CAAA;IAET,yBAAW,CAAA;AACb,CAAC,EAXW,UAAU,KAAV,UAAU,QAWrB;AASD,MAAM,UAAU,qBAAqB,CACnC,UAAsB,EACtB,eAAuB,EACvB,iBAAqC;IAErC,OAAO,CAAC,MAAc,EAAE,YAA6B,EAAE,EAAE;QACvD,IAAI,OAAO,YAAY,KAAK,QAAQ,EAAE,CAAC;YACrC,iBAAiB,CAAC;gBAChB,IAAI,EAAE,sBAAsB;gBAC5B,MAAM,EAAE,MAAM,CAAC,WAAW;gBAC1B,YAAY;gBACZ,WAAW,EAAE,CAAC,UAAU,EAAE,eAAe,CAAC;gBAC1C,OAAO,EAAE,iBAAiB;gBAC1B,SAAS,EAAE;oBACT,QAAQ,CAAC,KAAc,EAAE,IAAyB;wBAChD,IAAI,OAAO,IAAI,KAAK,WAAW,EAAE,CAAC;4BAChC,OAAO,KAAK,CAAC;wBACf,CAAC;wBAED,MAAM,CAAC,eAAe,EAAE,oBAAoB,CAAC,GAC3C,IAAI,CAAC,WAAmC,CAAC;wBAE3C,MAAM,YAAY,GAAI,IAAI,CAAC,MAAc,CAAC,oBAAoB,CAAC,CAAC;wBAEhE,IAAI,YAAY,KAAK,SAAS,IAAI,YAAY,KAAK,IAAI,EAAE,CAAC;4BACxD,OAAO,IAAI,CAAC;wBACd,CAAC;wBAED,QAAQ,eAAe,EAAE,CAAC;4BACxB,KAAK,UAAU,CAAC,EAAE;gCAChB,OAAO,MAAM,CAAC,KAAK,CAAC,KAAK,MAAM,CAAC,YAAY,CAAC,CAAC;4BAChD,KAAK,UAAU,CAAC,EAAE;gCAChB,OAAO,MAAM,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC;4BAC9C,KAAK,UAAU,CAAC,GAAG;gCACjB,OAAO,MAAM,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,YAAY,CAAC,CAAC;4BAC/C,KAAK,UAAU,CAAC,EAAE;gCAChB,OAAO,MAAM,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC;4BAC9C,KAAK,UAAU,CAAC,GAAG;gCACjB,OAAO,MAAM,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,YAAY,CAAC,CAAC;4BAC/C;gCACE,OAAO,KAAK,CAAC;wBACjB,CAAC;oBACH,CAAC;oBACD,cAAc,CAAC,IAAI;wBAEjB,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,IAAK,CAAC;wBACxC,MAAM,CAAC,eAAe,EAAE,oBAAoB,CAAC,GAAG,WAG/C,CAAC;wBAEF,OAAO,CAAC,CAAC,iBAAiB,eAAe,CAAC,WAAW,EAAE,EAAE,EAAE;4BACzD,GAAG,IAAI;4BACP,QAAQ,EAAE,CAAC,CAAC,YAAY,QAAQ,EAAE,CAAC;4BACnC,eAAe,EAAE,CAAC,CAAC,YAAY,oBAAoB,EAAE,CAAC;yBACvD,CAAC,CAAC;oBACL,CAAC;iBACF;aACF,CAAC,CAAC;QACL,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1,7 +1,2 @@
|
|
|
1
1
|
import { type ValidationOptions } from "class-validator";
|
|
2
|
-
/**
|
|
3
|
-
* Validates that the string value is a valid domain name.
|
|
4
|
-
* @param validationOptions - Optional class-validator validation options
|
|
5
|
-
* @returns Property decorator
|
|
6
|
-
*/
|
|
7
2
|
export declare function IsDomain(validationOptions?: ValidationOptions): PropertyDecorator;
|
|
@@ -1,20 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const utils_1 = require("../../utils");
|
|
6
|
-
/**
|
|
7
|
-
* Validates that the string value is a valid domain name.
|
|
8
|
-
* @param validationOptions - Optional class-validator validation options
|
|
9
|
-
* @returns Property decorator
|
|
10
|
-
*/
|
|
11
|
-
function IsDomain(validationOptions) {
|
|
12
|
-
return (0, class_validator_1.ValidateBy)({
|
|
1
|
+
import { ValidateBy } from "class-validator";
|
|
2
|
+
import { buildI18nMessage } from "../../utils/index.js";
|
|
3
|
+
export function IsDomain(validationOptions) {
|
|
4
|
+
return ValidateBy({
|
|
13
5
|
name: "IsDomain",
|
|
14
6
|
validator: {
|
|
15
7
|
validate: (value) => typeof value === "string" &&
|
|
16
8
|
/^(?=^.{3,255}$)[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+$/.test(value),
|
|
17
|
-
defaultMessage:
|
|
9
|
+
defaultMessage: buildI18nMessage(() => "is-domain"),
|
|
18
10
|
},
|
|
19
11
|
}, validationOptions);
|
|
20
12
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-domain.decorator.js","sourceRoot":"","sources":["../../../src/decorators/string/is-domain.decorator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"is-domain.decorator.js","sourceRoot":"","sources":["../../../src/decorators/string/is-domain.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAA0B,MAAM,iBAAiB,CAAC;AAErE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAOxD,MAAM,UAAU,QAAQ,CACtB,iBAAqC;IAErC,OAAO,UAAU,CACf;QACE,IAAI,EAAE,UAAU;QAChB,SAAS,EAAE;YACT,QAAQ,EAAE,CAAC,KAAK,EAAW,EAAE,CAC3B,OAAO,KAAK,KAAK,QAAQ;gBACzB,iFAAiF,CAAC,IAAI,CACpF,KAAK,CACN;YACH,cAAc,EAAE,gBAAgB,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC;SACpD;KACF,EACD,iBAAiB,CAClB,CAAC;AACJ,CAAC"}
|
|
@@ -1,14 +1,5 @@
|
|
|
1
1
|
import { type ValidationOptions } from "class-validator";
|
|
2
|
-
import { IsEmailOptions } from "validator";
|
|
3
|
-
/** Validation name constant for the IsEmail validator. */
|
|
2
|
+
import { type IsEmailOptions } from "validator";
|
|
4
3
|
export declare const IS_EMAIL = "isEmail";
|
|
5
|
-
/**
|
|
6
|
-
* Checks if the string is an email.
|
|
7
|
-
* If given value is not a string, then it returns false.
|
|
8
|
-
*/
|
|
9
4
|
export declare function isEmail(value: unknown, options?: IsEmailOptions): boolean;
|
|
10
|
-
/**
|
|
11
|
-
* Checks if the string is an email.
|
|
12
|
-
* If given value is not a string, then it returns false.
|
|
13
|
-
*/
|
|
14
5
|
export declare function IsEmail(options?: IsEmailOptions, validationOptions?: ValidationOptions): PropertyDecorator;
|