@nest-boot/validator 8.0.0-beta.0 → 8.0.0-beta.2

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 (53) hide show
  1. package/dist/decorators/common/array-length.decorator.d.ts +0 -8
  2. package/dist/decorators/common/array-length.decorator.js +0 -10
  3. package/dist/decorators/common/array-length.decorator.js.map +1 -1
  4. package/dist/decorators/index.js +0 -4
  5. package/dist/decorators/index.js.map +1 -1
  6. package/dist/decorators/number/is-greater-than-or-equal.decorator.d.ts +0 -6
  7. package/dist/decorators/number/is-greater-than-or-equal.decorator.js +0 -6
  8. package/dist/decorators/number/is-greater-than-or-equal.decorator.js.map +1 -1
  9. package/dist/decorators/number/is-greater-than.decorator.d.ts +0 -6
  10. package/dist/decorators/number/is-greater-than.decorator.js +0 -6
  11. package/dist/decorators/number/is-greater-than.decorator.js.map +1 -1
  12. package/dist/decorators/number/is-less-than-or-equal.decorator.d.ts +0 -6
  13. package/dist/decorators/number/is-less-than-or-equal.decorator.js +0 -6
  14. package/dist/decorators/number/is-less-than-or-equal.decorator.js.map +1 -1
  15. package/dist/decorators/number/is-less-than.decorator.d.ts +0 -6
  16. package/dist/decorators/number/is-less-than.decorator.js +0 -6
  17. package/dist/decorators/number/is-less-than.decorator.js.map +1 -1
  18. package/dist/decorators/number/max.decorator.d.ts +0 -6
  19. package/dist/decorators/number/max.decorator.js +0 -6
  20. package/dist/decorators/number/max.decorator.js.map +1 -1
  21. package/dist/decorators/number/min.decorator.d.ts +0 -6
  22. package/dist/decorators/number/min.decorator.js +0 -6
  23. package/dist/decorators/number/min.decorator.js.map +1 -1
  24. package/dist/decorators/number/validate-compare-number.decorator.d.ts +0 -13
  25. package/dist/decorators/number/validate-compare-number.decorator.js +0 -14
  26. package/dist/decorators/number/validate-compare-number.decorator.js.map +1 -1
  27. package/dist/decorators/string/is-domain.decorator.d.ts +0 -5
  28. package/dist/decorators/string/is-domain.decorator.js +0 -5
  29. package/dist/decorators/string/is-domain.decorator.js.map +1 -1
  30. package/dist/decorators/string/is-email.decorator.d.ts +0 -9
  31. package/dist/decorators/string/is-email.decorator.js +2 -12
  32. package/dist/decorators/string/is-email.decorator.js.map +1 -1
  33. package/dist/decorators/string/is-number-string.decorator.d.ts +0 -9
  34. package/dist/decorators/string/is-number-string.decorator.js +2 -12
  35. package/dist/decorators/string/is-number-string.decorator.js.map +1 -1
  36. package/dist/decorators/string/is-timezone.decorator.d.ts +0 -5
  37. package/dist/decorators/string/is-timezone.decorator.js +0 -5
  38. package/dist/decorators/string/is-timezone.decorator.js.map +1 -1
  39. package/dist/decorators/string/is-url.decorator.d.ts +0 -9
  40. package/dist/decorators/string/is-url.decorator.js +2 -12
  41. package/dist/decorators/string/is-url.decorator.js.map +1 -1
  42. package/dist/decorators/string/length.decorator.d.ts +0 -9
  43. package/dist/decorators/string/length.decorator.js +3 -15
  44. package/dist/decorators/string/length.decorator.js.map +1 -1
  45. package/dist/decorators/type-check/is-date.decorator.d.ts +0 -7
  46. package/dist/decorators/type-check/is-date.decorator.js +0 -7
  47. package/dist/decorators/type-check/is-date.decorator.js.map +1 -1
  48. package/dist/index.js +0 -1
  49. package/dist/index.js.map +1 -1
  50. package/dist/utils/build-i18n-message.d.ts +0 -10
  51. package/dist/utils/build-i18n-message.js +0 -10
  52. package/dist/utils/build-i18n-message.js.map +1 -1
  53. package/package.json +31 -14
@@ -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;
@@ -9,14 +9,12 @@ function arrayLengthMessage(value, property, min, max) {
9
9
  max,
10
10
  });
11
11
  }
12
- // Length is less than required
13
12
  if (typeof min !== "undefined" && value.length < min) {
14
13
  return t("validation:arrayLength.gte", {
15
14
  property: t(`property:${property}`),
16
15
  compareProperty: String(min),
17
16
  });
18
17
  }
19
- // Length exceeds required
20
18
  if (typeof max !== "undefined" && value.length > max) {
21
19
  return t("validation:arrayLength.lte", {
22
20
  property: t(`property:${property}`),
@@ -24,16 +22,10 @@ function arrayLengthMessage(value, property, min, max) {
24
22
  });
25
23
  }
26
24
  }
27
- // Not an array
28
25
  return t("validation:is-array", {
29
26
  property: t(`property:${property}`),
30
27
  });
31
28
  }
32
- /**
33
- * Validates that the array length falls within the specified range.
34
- * @param validationOptions - Array length constraints and validation options
35
- * @returns Property decorator
36
- */
37
29
  export function ArrayLength(validationOptions) {
38
30
  return (target, propertyName) => {
39
31
  if (typeof propertyName === "string") {
@@ -52,11 +44,9 @@ export function ArrayLength(validationOptions) {
52
44
  }
53
45
  return true;
54
46
  }
55
- // Not an array
56
47
  return false;
57
48
  },
58
49
  defaultMessage(args) {
59
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
60
50
  const { value, property } = args;
61
51
  const { min, max } = validationOptions;
62
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":"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;QAED,+BAA+B;QAC/B,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;QAED,0BAA0B;QAC1B,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;IAED,eAAe;IACf,OAAO,CAAC,CAAC,qBAAqB,EAAE;QAC9B,QAAQ,EAAE,CAAC,CAAC,YAAY,QAAQ,EAAE,CAAC;KACpC,CAAC,CAAC;AACL,CAAC;AAED;;;;GAIG;AACH,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;wBAED,eAAe;wBACf,OAAO,KAAK,CAAC;oBACf,CAAC;oBACD,cAAc,CAAC,IAAI;wBACjB,oEAAoE;wBACpE,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
+ {"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,19 +1,15 @@
1
- // Common
2
1
  export * from "./common/array-length.decorator.js";
3
- // String
4
2
  export * from "./string/is-domain.decorator.js";
5
3
  export * from "./string/is-email.decorator.js";
6
4
  export * from "./string/is-number-string.decorator.js";
7
5
  export * from "./string/is-timezone.decorator.js";
8
6
  export * from "./string/is-url.decorator.js";
9
7
  export * from "./string/length.decorator.js";
10
- // Number
11
8
  export * from "./number/is-greater-than.decorator.js";
12
9
  export * from "./number/is-greater-than-or-equal.decorator.js";
13
10
  export * from "./number/is-less-than.decorator.js";
14
11
  export * from "./number/is-less-than-or-equal.decorator.js";
15
12
  export * from "./number/max.decorator.js";
16
13
  export * from "./number/min.decorator.js";
17
- // Type check
18
14
  export * from "./type-check/is-date.decorator.js";
19
15
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/decorators/index.ts"],"names":[],"mappings":"AAAA,SAAS;AACT,cAAc,oCAAoC,CAAC;AAEnD,SAAS;AACT,cAAc,iCAAiC,CAAC;AAChD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,wCAAwC,CAAC;AACvD,cAAc,mCAAmC,CAAC;AAClD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAE7C,SAAS;AACT,cAAc,uCAAuC,CAAC;AACtD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,oCAAoC,CAAC;AACnD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAE1C,aAAa;AACb,cAAc,mCAAmC,CAAC"}
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,10 +1,4 @@
1
1
  import { Comparator, ValidateCompareNumber, } from "./validate-compare-number.decorator.js";
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 function IsGreaterThanOrEqual(field, validationOptions) {
9
3
  return ValidateCompareNumber(Comparator.GTE, field, validationOptions);
10
4
  }
@@ -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":"AAEA,OAAO,EACL,UAAU,EACV,qBAAqB,GACtB,MAAM,wCAAwC,CAAC;AAEhD;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAClC,KAAa,EACb,iBAAqC;IAErC,OAAO,qBAAqB,CAAC,UAAU,CAAC,GAAG,EAAE,KAAK,EAAE,iBAAiB,CAAC,CAAC;AACzE,CAAC"}
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,10 +1,4 @@
1
1
  import { Comparator, ValidateCompareNumber, } from "./validate-compare-number.decorator.js";
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 function IsGreaterThan(field, validationOptions) {
9
3
  return ValidateCompareNumber(Comparator.GT, field, validationOptions);
10
4
  }
@@ -1 +1 @@
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;AAEhD;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAC3B,KAAa,EACb,iBAAqC;IAErC,OAAO,qBAAqB,CAAC,UAAU,CAAC,EAAE,EAAE,KAAK,EAAE,iBAAiB,CAAC,CAAC;AACxE,CAAC"}
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,10 +1,4 @@
1
1
  import { Comparator, ValidateCompareNumber, } from "./validate-compare-number.decorator.js";
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 function IsLessThanOrEqual(field, validationOptions) {
9
3
  return ValidateCompareNumber(Comparator.LTE, field, validationOptions);
10
4
  }
@@ -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":"AAEA,OAAO,EACL,UAAU,EACV,qBAAqB,GACtB,MAAM,wCAAwC,CAAC;AAEhD;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAC/B,KAAa,EACb,iBAAqC;IAErC,OAAO,qBAAqB,CAAC,UAAU,CAAC,GAAG,EAAE,KAAK,EAAE,iBAAiB,CAAC,CAAC;AACzE,CAAC"}
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,10 +1,4 @@
1
1
  import { Comparator, ValidateCompareNumber, } from "./validate-compare-number.decorator.js";
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 function IsLessThan(field, validationOptions) {
9
3
  return ValidateCompareNumber(Comparator.LT, field, validationOptions);
10
4
  }
@@ -1 +1 @@
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;AAEhD;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CACxB,KAAa,EACb,iBAAqC;IAErC,OAAO,qBAAqB,CAAC,UAAU,CAAC,EAAE,EAAE,KAAK,EAAE,iBAAiB,CAAC,CAAC;AACxE,CAAC"}
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,11 +1,5 @@
1
1
  import { ValidateBy } from "class-validator";
2
2
  import { buildI18nMessage } from "../../utils/index.js";
3
- /**
4
- * Validates that the property value is less than or equal to the specified maximum.
5
- * @param maxValue - The maximum allowed value
6
- * @param validationOptions - Optional class-validator validation options
7
- * @returns Property decorator
8
- */
9
3
  export function Max(maxValue, validationOptions) {
10
4
  return ValidateBy({
11
5
  name: "max",
@@ -1 +1 @@
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;AAExD;;;;;GAKG;AACH,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
+ {"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,11 +1,5 @@
1
1
  import { ValidateBy } from "class-validator";
2
2
  import { buildI18nMessage } from "../../utils/index.js";
3
- /**
4
- * Validates that the property value is greater than or equal to the specified minimum.
5
- * @param minValue - The minimum allowed value
6
- * @param validationOptions - Optional class-validator validation options
7
- * @returns Property decorator
8
- */
9
3
  export function Min(minValue, validationOptions) {
10
4
  return ValidateBy({
11
5
  name: "min",
@@ -1 +1 @@
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;AAExD;;;;;GAKG;AACH,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
+ {"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,26 +1,13 @@
1
1
  import { t } from "@nest-boot/i18n";
2
2
  import { registerDecorator, } from "class-validator";
3
- /** Comparison operators for number validation. */
4
3
  export var Comparator;
5
4
  (function (Comparator) {
6
- /** Equal to. */
7
5
  Comparator["EQ"] = "EQ";
8
- /** Greater than. */
9
6
  Comparator["GT"] = "GT";
10
- /** Greater than or equal to. */
11
7
  Comparator["GTE"] = "GTE";
12
- /** Less than. */
13
8
  Comparator["LT"] = "LT";
14
- /** Less than or equal to. */
15
9
  Comparator["LTE"] = "LTE";
16
10
  })(Comparator || (Comparator = {}));
17
- /**
18
- * Validates that a numeric property satisfies a comparison against another property's value.
19
- * @param comparator - The comparison operator to use
20
- * @param compareProperty - The name of the property to compare against
21
- * @param validationOptions - Optional class-validator validation options
22
- * @returns Property decorator
23
- */
24
11
  export function ValidateCompareNumber(comparator, compareProperty, validationOptions) {
25
12
  return (target, propertyName) => {
26
13
  if (typeof propertyName === "string") {
@@ -56,7 +43,6 @@ export function ValidateCompareNumber(comparator, compareProperty, validationOpt
56
43
  }
57
44
  },
58
45
  defaultMessage(args) {
59
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
60
46
  const { property, constraints } = args;
61
47
  const [innerComparator, innerCompareProperty] = constraints;
62
48
  return t(`validation:is-${innerComparator.toLowerCase()}`, {
@@ -1 +1 @@
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;AAEzB,kDAAkD;AAClD,MAAM,CAAN,IAAY,UAWX;AAXD,WAAY,UAAU;IACpB,gBAAgB;IAChB,uBAAS,CAAA;IACT,oBAAoB;IACpB,uBAAS,CAAA;IACT,gCAAgC;IAChC,yBAAW,CAAA;IACX,iBAAiB;IACjB,uBAAS,CAAA;IACT,6BAA6B;IAC7B,yBAAW,CAAA;AACb,CAAC,EAXW,UAAU,KAAV,UAAU,QAWrB;AAED;;;;;;GAMG;AACH,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;wBACjB,oEAAoE;wBACpE,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
+ {"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,10 +1,5 @@
1
1
  import { ValidateBy } from "class-validator";
2
2
  import { buildI18nMessage } from "../../utils/index.js";
3
- /**
4
- * Validates that the string value is a valid domain name.
5
- * @param validationOptions - Optional class-validator validation options
6
- * @returns Property decorator
7
- */
8
3
  export function IsDomain(validationOptions) {
9
4
  return ValidateBy({
10
5
  name: "IsDomain",
@@ -1 +1 @@
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;AAExD;;;;GAIG;AACH,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
+ {"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
2
  import { type IsEmailOptions } from "validator";
3
- /** Validation name constant for the IsEmail 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;
@@ -1,21 +1,11 @@
1
- import { createRequire } from "node:module";
2
1
  import { ValidateBy } from "class-validator";
2
+ import isEmailModule from "validator/lib/isEmail.js";
3
3
  import { buildI18nMessage } from "../../utils/index.js";
4
- const require = createRequire(import.meta.url);
5
- const isEmailValidator = require("validator/lib/isEmail.js");
6
- /** Validation name constant for the IsEmail validator. */
4
+ const isEmailValidator = isEmailModule;
7
5
  export const IS_EMAIL = "isEmail";
8
- /**
9
- * Checks if the string is an email.
10
- * If given value is not a string, then it returns false.
11
- */
12
6
  export function isEmail(value, options) {
13
7
  return typeof value === "string" && isEmailValidator(value, options);
14
8
  }
15
- /**
16
- * Checks if the string is an email.
17
- * If given value is not a string, then it returns false.
18
- */
19
9
  export function IsEmail(options, validationOptions) {
20
10
  return ValidateBy({
21
11
  name: IS_EMAIL,
@@ -1 +1 @@
1
- {"version":3,"file":"is-email.decorator.js","sourceRoot":"","sources":["../../../src/decorators/string/is-email.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,OAAO,EAAE,UAAU,EAA0B,MAAM,iBAAiB,CAAC;AAGrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/C,MAAM,gBAAgB,GAAG,OAAO,CAAC,0BAA0B,CAG/C,CAAC;AAEb,0DAA0D;AAC1D,MAAM,CAAC,MAAM,QAAQ,GAAG,SAAS,CAAC;AAElC;;;GAGG;AACH,MAAM,UAAU,OAAO,CAAC,KAAc,EAAE,OAAwB;IAC9D,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,gBAAgB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;AACvE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,OAAO,CACrB,OAAwB,EACxB,iBAAqC;IAErC,OAAO,UAAU,CACf;QACE,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,CAAC,OAAO,CAAC;QACtB,SAAS,EAAE;YACT,QAAQ,EAAE,CAAC,KAAK,EAAE,IAAI,EAAW,EAAE,CACjC,OAAO,IAAI,KAAK,WAAW,IAAI,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;YACpE,cAAc,EAAE,gBAAgB,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC;SACnD;KACF,EACD,iBAAiB,CAClB,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"is-email.decorator.js","sourceRoot":"","sources":["../../../src/decorators/string/is-email.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAA0B,MAAM,iBAAiB,CAAC;AAErE,OAAO,aAAa,MAAM,0BAA0B,CAAC;AAErD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,MAAM,gBAAgB,GAAG,aAGb,CAAC;AAGb,MAAM,CAAC,MAAM,QAAQ,GAAG,SAAS,CAAC;AAMlC,MAAM,UAAU,OAAO,CAAC,KAAc,EAAE,OAAwB;IAC9D,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,gBAAgB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;AACvE,CAAC;AAMD,MAAM,UAAU,OAAO,CACrB,OAAwB,EACxB,iBAAqC;IAErC,OAAO,UAAU,CACf;QACE,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,CAAC,OAAO,CAAC;QACtB,SAAS,EAAE;YACT,QAAQ,EAAE,CAAC,KAAK,EAAE,IAAI,EAAW,EAAE,CACjC,OAAO,IAAI,KAAK,WAAW,IAAI,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;YACpE,cAAc,EAAE,gBAAgB,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC;SACnD;KACF,EACD,iBAAiB,CAClB,CAAC;AACJ,CAAC"}
@@ -1,14 +1,5 @@
1
1
  import { type ValidationOptions } from "class-validator";
2
2
  import { type IsNumericOptions } from "validator";
3
- /** Validation name constant for the IsNumberString validator. */
4
3
  export declare const IS_NUMBER_STRING = "isNumberString";
5
- /**
6
- * Checks if the string is numeric.
7
- * If given value is not a string, then it returns false.
8
- */
9
4
  export declare function isNumberString(value: unknown, options?: IsNumericOptions): boolean;
10
- /**
11
- * Checks if the string is numeric.
12
- * If given value is not a string, then it returns false.
13
- */
14
5
  export declare function IsNumberString(options?: IsNumericOptions, validationOptions?: ValidationOptions): PropertyDecorator;
@@ -1,21 +1,11 @@
1
- import { createRequire } from "node:module";
2
1
  import { ValidateBy } from "class-validator";
2
+ import isNumericModule from "validator/lib/isNumeric.js";
3
3
  import { buildI18nMessage } from "../../utils/index.js";
4
- const require = createRequire(import.meta.url);
5
- const isNumericValidator = require("validator/lib/isNumeric.js");
6
- /** Validation name constant for the IsNumberString validator. */
4
+ const isNumericValidator = isNumericModule;
7
5
  export const IS_NUMBER_STRING = "isNumberString";
8
- /**
9
- * Checks if the string is numeric.
10
- * If given value is not a string, then it returns false.
11
- */
12
6
  export function isNumberString(value, options) {
13
7
  return typeof value === "string" && isNumericValidator(value, options);
14
8
  }
15
- /**
16
- * Checks if the string is numeric.
17
- * If given value is not a string, then it returns false.
18
- */
19
9
  export function IsNumberString(options, validationOptions) {
20
10
  return ValidateBy({
21
11
  name: IS_NUMBER_STRING,
@@ -1 +1 @@
1
- {"version":3,"file":"is-number-string.decorator.js","sourceRoot":"","sources":["../../../src/decorators/string/is-number-string.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,OAAO,EAAE,UAAU,EAA0B,MAAM,iBAAiB,CAAC;AAGrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/C,MAAM,kBAAkB,GAAG,OAAO,CAAC,4BAA4B,CAGnD,CAAC;AAEb,iEAAiE;AACjE,MAAM,CAAC,MAAM,gBAAgB,GAAG,gBAAgB,CAAC;AAEjD;;;GAGG;AACH,MAAM,UAAU,cAAc,CAC5B,KAAc,EACd,OAA0B;IAE1B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,kBAAkB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;AACzE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,cAAc,CAC5B,OAA0B,EAC1B,iBAAqC;IAErC,OAAO,UAAU,CACf;QACE,IAAI,EAAE,gBAAgB;QACtB,WAAW,EAAE,CAAC,OAAO,CAAC;QACtB,SAAS,EAAE;YACT,QAAQ,EAAE,CAAC,KAAK,EAAE,IAAI,EAAW,EAAE,CACjC,OAAO,IAAI,KAAK,WAAW;gBAC3B,cAAc,CAAC,KAAK,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;YAC5C,cAAc,EAAE,gBAAgB,CAAC,GAAG,EAAE,CAAC,kBAAkB,CAAC;SAC3D;KACF,EACD,iBAAiB,CAClB,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"is-number-string.decorator.js","sourceRoot":"","sources":["../../../src/decorators/string/is-number-string.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAA0B,MAAM,iBAAiB,CAAC;AAErE,OAAO,eAAe,MAAM,4BAA4B,CAAC;AAEzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,MAAM,kBAAkB,GAAG,eAGf,CAAC;AAGb,MAAM,CAAC,MAAM,gBAAgB,GAAG,gBAAgB,CAAC;AAMjD,MAAM,UAAU,cAAc,CAC5B,KAAc,EACd,OAA0B;IAE1B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,kBAAkB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;AACzE,CAAC;AAMD,MAAM,UAAU,cAAc,CAC5B,OAA0B,EAC1B,iBAAqC;IAErC,OAAO,UAAU,CACf;QACE,IAAI,EAAE,gBAAgB;QACtB,WAAW,EAAE,CAAC,OAAO,CAAC;QACtB,SAAS,EAAE;YACT,QAAQ,EAAE,CAAC,KAAK,EAAE,IAAI,EAAW,EAAE,CACjC,OAAO,IAAI,KAAK,WAAW;gBAC3B,cAAc,CAAC,KAAK,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;YAC5C,cAAc,EAAE,gBAAgB,CAAC,GAAG,EAAE,CAAC,kBAAkB,CAAC;SAC3D;KACF,EACD,iBAAiB,CAClB,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 IANA timezone identifier.
4
- * @param validationOptions - Optional class-validator validation options
5
- * @returns Property decorator
6
- */
7
2
  export declare function IsTimezone(validationOptions?: ValidationOptions): PropertyDecorator;
@@ -1,11 +1,6 @@
1
1
  import { ValidateBy } from "class-validator";
2
2
  import moment from "moment-timezone";
3
3
  import { buildI18nMessage } from "../../utils/index.js";
4
- /**
5
- * Validates that the string value is a valid IANA timezone identifier.
6
- * @param validationOptions - Optional class-validator validation options
7
- * @returns Property decorator
8
- */
9
4
  export function IsTimezone(validationOptions) {
10
5
  return ValidateBy({
11
6
  name: "isTimezone",
@@ -1 +1 @@
1
- {"version":3,"file":"is-timezone.decorator.js","sourceRoot":"","sources":["../../../src/decorators/string/is-timezone.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAA0B,MAAM,iBAAiB,CAAC;AACrE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD;;;;GAIG;AACH,MAAM,UAAU,UAAU,CACxB,iBAAqC;IAErC,OAAO,UAAU,CACf;QACE,IAAI,EAAE,YAAY;QAClB,SAAS,EAAE;YACT,QAAQ,EAAE,CAAC,KAAK,EAAW,EAAE,CAC3B,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC;YAC/D,cAAc,EAAE,gBAAgB,CAAC,GAAG,EAAE,CAAC,aAAa,CAAC;SACtD;KACF,EACD,iBAAiB,CAClB,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"is-timezone.decorator.js","sourceRoot":"","sources":["../../../src/decorators/string/is-timezone.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAA0B,MAAM,iBAAiB,CAAC;AACrE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAOxD,MAAM,UAAU,UAAU,CACxB,iBAAqC;IAErC,OAAO,UAAU,CACf;QACE,IAAI,EAAE,YAAY;QAClB,SAAS,EAAE;YACT,QAAQ,EAAE,CAAC,KAAK,EAAW,EAAE,CAC3B,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC;YAC/D,cAAc,EAAE,gBAAgB,CAAC,GAAG,EAAE,CAAC,aAAa,CAAC;SACtD;KACF,EACD,iBAAiB,CAClB,CAAC;AACJ,CAAC"}
@@ -1,14 +1,5 @@
1
1
  import { type ValidationOptions } from "class-validator";
2
2
  import { type IsURLOptions } from "validator";
3
- /** Validation name constant for the IsUrl validator. */
4
3
  export declare const IS_URL = "isUrl";
5
- /**
6
- * Checks if the string is an url.
7
- * If given value is not a string, then it returns false.
8
- */
9
4
  export declare function isURL(value: string, options?: IsURLOptions): boolean;
10
- /**
11
- * Checks if the string is an url.
12
- * If given value is not a string, then it returns false.
13
- */
14
5
  export declare function IsUrl(options?: IsURLOptions, validationOptions?: ValidationOptions): PropertyDecorator;
@@ -1,21 +1,11 @@
1
- import { createRequire } from "node:module";
2
1
  import { ValidateBy } from "class-validator";
2
+ import isUrlModule from "validator/lib/isURL.js";
3
3
  import { buildI18nMessage } from "../../utils/index.js";
4
- const require = createRequire(import.meta.url);
5
- const isUrlValidator = require("validator/lib/isURL.js");
6
- /** Validation name constant for the IsUrl validator. */
4
+ const isUrlValidator = isUrlModule;
7
5
  export const IS_URL = "isUrl";
8
- /**
9
- * Checks if the string is an url.
10
- * If given value is not a string, then it returns false.
11
- */
12
6
  export function isURL(value, options) {
13
7
  return typeof value === "string" && isUrlValidator(value, options);
14
8
  }
15
- /**
16
- * Checks if the string is an url.
17
- * If given value is not a string, then it returns false.
18
- */
19
9
  export function IsUrl(options, validationOptions) {
20
10
  return ValidateBy({
21
11
  name: IS_URL,
@@ -1 +1 @@
1
- {"version":3,"file":"is-url.decorator.js","sourceRoot":"","sources":["../../../src/decorators/string/is-url.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,OAAO,EAAE,UAAU,EAA0B,MAAM,iBAAiB,CAAC;AAGrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/C,MAAM,cAAc,GAAG,OAAO,CAAC,wBAAwB,CAG3C,CAAC;AAEb,wDAAwD;AACxD,MAAM,CAAC,MAAM,MAAM,GAAG,OAAO,CAAC;AAE9B;;;GAGG;AACH,MAAM,UAAU,KAAK,CAAC,KAAa,EAAE,OAAsB;IACzD,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,cAAc,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;AACrE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,KAAK,CACnB,OAAsB,EACtB,iBAAqC;IAErC,OAAO,UAAU,CACf;QACE,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,CAAC,OAAO,CAAC;QACtB,SAAS,EAAE;YACT,QAAQ,EAAE,CAAC,KAAK,EAAE,IAAI,EAAW,EAAE,CACjC,OAAO,IAAI,KAAK,WAAW,IAAI,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;YAClE,cAAc,EAAE,gBAAgB,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC;SACjD;KACF,EACD,iBAAiB,CAClB,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"is-url.decorator.js","sourceRoot":"","sources":["../../../src/decorators/string/is-url.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAA0B,MAAM,iBAAiB,CAAC;AAErE,OAAO,WAAW,MAAM,wBAAwB,CAAC;AAEjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,MAAM,cAAc,GAAG,WAGX,CAAC;AAGb,MAAM,CAAC,MAAM,MAAM,GAAG,OAAO,CAAC;AAM9B,MAAM,UAAU,KAAK,CAAC,KAAa,EAAE,OAAsB;IACzD,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,cAAc,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;AACrE,CAAC;AAMD,MAAM,UAAU,KAAK,CACnB,OAAsB,EACtB,iBAAqC;IAErC,OAAO,UAAU,CACf;QACE,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,CAAC,OAAO,CAAC;QACtB,SAAS,EAAE;YACT,QAAQ,EAAE,CAAC,KAAK,EAAE,IAAI,EAAW,EAAE,CACjC,OAAO,IAAI,KAAK,WAAW,IAAI,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;YAClE,cAAc,EAAE,gBAAgB,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC;SACjD;KACF,EACD,iBAAiB,CAClB,CAAC;AACJ,CAAC"}
@@ -1,13 +1,4 @@
1
1
  import { type ValidationOptions } from "class-validator";
2
- /** Validation name constant for the Length validator. */
3
2
  export declare const IS_LENGTH = "isLength";
4
- /**
5
- * Checks if the string's length falls in a range. Note: this function takes into account surrogate pairs.
6
- * If given value is not a string, then it returns false.
7
- */
8
3
  export declare function length(value: unknown, min: number, max?: number): boolean;
9
- /**
10
- * Checks if the string's length falls in a range. Note: this function takes into account surrogate pairs.
11
- * If given value is not a string, then it returns false.
12
- */
13
4
  export declare function Length(min: number, max?: number, validationOptions?: ValidationOptions): PropertyDecorator;
@@ -1,21 +1,11 @@
1
- import { createRequire } from "node:module";
2
1
  import { ValidateBy } from "class-validator";
2
+ import isLengthModule from "validator/lib/isLength.js";
3
3
  import { buildI18nMessage } from "../../utils/build-i18n-message.js";
4
- const require = createRequire(import.meta.url);
5
- const isLengthValidator = require("validator/lib/isLength.js");
6
- /** Validation name constant for the Length validator. */
4
+ const isLengthValidator = isLengthModule;
7
5
  export const IS_LENGTH = "isLength";
8
- /**
9
- * Checks if the string's length falls in a range. Note: this function takes into account surrogate pairs.
10
- * If given value is not a string, then it returns false.
11
- */
12
6
  export function length(value, min, max) {
13
7
  return typeof value === "string" && isLengthValidator(value, { min, max });
14
8
  }
15
- /**
16
- * Checks if the string's length falls in a range. Note: this function takes into account surrogate pairs.
17
- * If given value is not a string, then it returns false.
18
- */
19
9
  export function Length(min, max, validationOptions) {
20
10
  return ValidateBy({
21
11
  name: IS_LENGTH,
@@ -27,9 +17,7 @@ export function Length(min, max, validationOptions) {
27
17
  if (typeof args !== "undefined") {
28
18
  const isMinLength = args.constraints[0] !== null && args.constraints[0] !== undefined;
29
19
  const isMaxLength = args.constraints[1] !== null && args.constraints[1] !== undefined;
30
- if (isMinLength &&
31
- !isMaxLength &&
32
- args.value.length < args.constraints[0]) {
20
+ if (isMinLength && !isMaxLength) {
33
21
  return "length.gte";
34
22
  }
35
23
  }
@@ -1 +1 @@
1
- {"version":3,"file":"length.decorator.js","sourceRoot":"","sources":["../../../src/decorators/string/length.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,OAAO,EAAE,UAAU,EAA0B,MAAM,iBAAiB,CAAC;AAErE,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAErE,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/C,MAAM,iBAAiB,GAAG,OAAO,CAAC,2BAA2B,CAGjD,CAAC;AAEb,yDAAyD;AACzD,MAAM,CAAC,MAAM,SAAS,GAAG,UAAU,CAAC;AAEpC;;;GAGG;AACH,MAAM,UAAU,MAAM,CAAC,KAAc,EAAE,GAAW,EAAE,GAAY;IAC9D,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,iBAAiB,CAAC,KAAK,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;AAC7E,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,MAAM,CACpB,GAAW,EACX,GAAY,EACZ,iBAAqC;IAErC,OAAO,UAAU,CACf;QACE,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC;QACvB,SAAS,EAAE;YACT,QAAQ,EAAE,CAAC,KAAK,EAAE,IAAI,EAAW,EAAE,CACjC,OAAO,IAAI,KAAK,WAAW;gBAC3B,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;YACzD,cAAc,EAAE,gBAAgB,CAAC,CAAC,IAAI,EAAE,EAAE;gBACxC,IAAI,OAAO,IAAI,KAAK,WAAW,EAAE,CAAC;oBAChC,MAAM,WAAW,GACf,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,IAAI,IAAI,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC;oBACpE,MAAM,WAAW,GACf,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,IAAI,IAAI,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC;oBAEpE,IACE,WAAW;wBACX,CAAC,WAAW;wBACZ,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,EACvC,CAAC;wBACD,OAAO,YAAY,CAAC;oBACtB,CAAC;gBACH,CAAC;gBAED,OAAO,gBAAgB,CAAC;YAC1B,CAAC,CAAC;SACH;KACF,EACD,iBAAiB,CAClB,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"length.decorator.js","sourceRoot":"","sources":["../../../src/decorators/string/length.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAA0B,MAAM,iBAAiB,CAAC;AACrE,OAAO,cAAc,MAAM,2BAA2B,CAAC;AAEvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAErE,MAAM,iBAAiB,GAAG,cAGd,CAAC;AAGb,MAAM,CAAC,MAAM,SAAS,GAAG,UAAU,CAAC;AAMpC,MAAM,UAAU,MAAM,CAAC,KAAc,EAAE,GAAW,EAAE,GAAY;IAC9D,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,iBAAiB,CAAC,KAAK,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;AAC7E,CAAC;AAMD,MAAM,UAAU,MAAM,CACpB,GAAW,EACX,GAAY,EACZ,iBAAqC;IAErC,OAAO,UAAU,CACf;QACE,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC;QACvB,SAAS,EAAE;YACT,QAAQ,EAAE,CAAC,KAAK,EAAE,IAAI,EAAW,EAAE,CACjC,OAAO,IAAI,KAAK,WAAW;gBAC3B,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;YACzD,cAAc,EAAE,gBAAgB,CAAC,CAAC,IAAI,EAAE,EAAE;gBACxC,IAAI,OAAO,IAAI,KAAK,WAAW,EAAE,CAAC;oBAChC,MAAM,WAAW,GACf,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,IAAI,IAAI,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC;oBACpE,MAAM,WAAW,GACf,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,IAAI,IAAI,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC;oBAEpE,IAAI,WAAW,IAAI,CAAC,WAAW,EAAE,CAAC;wBAChC,OAAO,YAAY,CAAC;oBACtB,CAAC;gBACH,CAAC;gBAED,OAAO,gBAAgB,CAAC;YAC1B,CAAC,CAAC;SACH;KACF,EACD,iBAAiB,CAClB,CAAC;AACJ,CAAC"}
@@ -1,11 +1,4 @@
1
1
  import { type ValidationOptions } from "class-validator";
2
- /** Validation name constant for the IsDate validator. */
3
2
  export declare const IS_DATE = "isDate";
4
- /**
5
- * Checks if a given value is a date.
6
- */
7
3
  export declare function isDate(value: unknown): boolean;
8
- /**
9
- * Checks if a value is a date.
10
- */
11
4
  export declare function IsDate(validationOptions?: ValidationOptions): PropertyDecorator;
@@ -1,16 +1,9 @@
1
1
  import { ValidateBy } from "class-validator";
2
2
  import { buildI18nMessage } from "../../utils/index.js";
3
- /** Validation name constant for the IsDate validator. */
4
3
  export const IS_DATE = "isDate";
5
- /**
6
- * Checks if a given value is a date.
7
- */
8
4
  export function isDate(value) {
9
5
  return value instanceof Date && !Number.isNaN(value.getTime());
10
6
  }
11
- /**
12
- * Checks if a value is a date.
13
- */
14
7
  export function IsDate(validationOptions) {
15
8
  return ValidateBy({
16
9
  name: IS_DATE,
@@ -1 +1 @@
1
- {"version":3,"file":"is-date.decorator.js","sourceRoot":"","sources":["../../../src/decorators/type-check/is-date.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAA0B,MAAM,iBAAiB,CAAC;AAErE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,yDAAyD;AACzD,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC;AAEhC;;GAEG;AACH,MAAM,UAAU,MAAM,CAAC,KAAc;IACnC,OAAO,KAAK,YAAY,IAAI,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;AACjE,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,MAAM,CACpB,iBAAqC;IAErC,OAAO,UAAU,CACf;QACE,IAAI,EAAE,OAAO;QACb,SAAS,EAAE;YACT,QAAQ,EAAE,CAAC,KAAK,EAAW,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC;YAC3C,cAAc,EAAE,gBAAgB,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC;SAClD;KACF,EACD,iBAAiB,CAClB,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"is-date.decorator.js","sourceRoot":"","sources":["../../../src/decorators/type-check/is-date.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAA0B,MAAM,iBAAiB,CAAC;AAErE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAGxD,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC;AAKhC,MAAM,UAAU,MAAM,CAAC,KAAc;IACnC,OAAO,KAAK,YAAY,IAAI,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;AACjE,CAAC;AAKD,MAAM,UAAU,MAAM,CACpB,iBAAqC;IAErC,OAAO,UAAU,CACf;QACE,IAAI,EAAE,OAAO;QACb,SAAS,EAAE;YACT,QAAQ,EAAE,CAAC,KAAK,EAAW,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC;YAC3C,cAAc,EAAE,gBAAgB,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC;SAClD;KACF,EACD,iBAAiB,CAClB,CAAC;AACJ,CAAC"}
package/dist/index.js CHANGED
@@ -1,6 +1,5 @@
1
1
  import { IsOptional, ValidateNested } from "class-validator";
2
2
  export * from "./decorators/index.js";
3
3
  export * from "./utils/index.js";
4
- // class-validator
5
4
  export { IsOptional, ValidateNested };
6
5
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAE7D,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AAEjC,kBAAkB;AAClB,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAE7D,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AAGjC,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,CAAC"}
@@ -1,12 +1,2 @@
1
1
  import { type ValidationArguments } from "class-validator";
2
- /**
3
- * Creates an i18n-aware validation message factory.
4
- *
5
- * @remarks
6
- * Wraps a callback that returns a translation key, automatically
7
- * providing constraint values and property translation to the message.
8
- *
9
- * @param callback - Function that receives validation args and returns the translation key suffix
10
- * @returns A function usable as the `defaultMessage` in class-validator decorators
11
- */
12
2
  export declare function buildI18nMessage(callback: (args: ValidationArguments) => string): (args: ValidationArguments) => string;
@@ -1,14 +1,4 @@
1
1
  import { t } from "@nest-boot/i18n";
2
- /**
3
- * Creates an i18n-aware validation message factory.
4
- *
5
- * @remarks
6
- * Wraps a callback that returns a translation key, automatically
7
- * providing constraint values and property translation to the message.
8
- *
9
- * @param callback - Function that receives validation args and returns the translation key suffix
10
- * @returns A function usable as the `defaultMessage` in class-validator decorators
11
- */
12
2
  export function buildI18nMessage(callback) {
13
3
  return (args) => {
14
4
  return t(`validation:${callback(args)}`, {
@@ -1 +1 @@
1
- {"version":3,"file":"build-i18n-message.js","sourceRoot":"","sources":["../../src/utils/build-i18n-message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,iBAAiB,CAAC;AAGpC;;;;;;;;;GASG;AACH,MAAM,UAAU,gBAAgB,CAC9B,QAA+C;IAE/C,OAAO,CAAC,IAAyB,EAAU,EAAE;QAC3C,OAAO,CAAC,CAAC,cAAc,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE;YACvC,GAAG,IAAI;YACP,GAAG,IAAI,CAAC,WAAW,EAAE,MAAM,CACzB,CAAC,WAAW,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;gBAC9B,GAAG,WAAW;gBACd,CAAC,aAAa,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,KAAK;aACtC,CAAC,EACF,EAAE,CACH;YACD,QAAQ,EAAE,CAAC,CAAC,YAAY,IAAI,CAAC,QAAQ,EAAE,CAAC;SACzC,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"build-i18n-message.js","sourceRoot":"","sources":["../../src/utils/build-i18n-message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,iBAAiB,CAAC;AAapC,MAAM,UAAU,gBAAgB,CAC9B,QAA+C;IAE/C,OAAO,CAAC,IAAyB,EAAU,EAAE;QAC3C,OAAO,CAAC,CAAC,cAAc,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE;YACvC,GAAG,IAAI;YACP,GAAG,IAAI,CAAC,WAAW,EAAE,MAAM,CACzB,CAAC,WAAW,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;gBAC9B,GAAG,WAAW;gBACd,CAAC,aAAa,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,KAAK;aACtC,CAAC,EACF,EAAE,CACH;YACD,QAAQ,EAAE,CAAC,CAAC,YAAY,IAAI,CAAC,QAAQ,EAAE,CAAC;SACzC,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nest-boot/validator",
3
- "version": "8.0.0-beta.0",
3
+ "version": "8.0.0-beta.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/nest-boot/nest-boot.git",
@@ -14,8 +14,8 @@
14
14
  },
15
15
  "homepage": "",
16
16
  "license": "MIT",
17
- "main": "dist/index.js",
18
- "types": "dist/index.d.ts",
17
+ "main": "./dist/index.js",
18
+ "types": "./dist/index.d.ts",
19
19
  "directories": {
20
20
  "lib": "dist"
21
21
  },
@@ -23,35 +23,38 @@
23
23
  "dist"
24
24
  ],
25
25
  "dependencies": {
26
- "lodash": "^4.17.21",
26
+ "lodash-es": "^4.17.21",
27
27
  "moment": "^2.30.1",
28
28
  "moment-timezone": "^0.6.0",
29
29
  "validator": "^13.15.15"
30
30
  },
31
31
  "devDependencies": {
32
- "@nestjs/common": "next",
33
- "@nestjs/core": "next",
32
+ "@nestjs/common": "^12.0.1",
33
+ "@nestjs/core": "^12.0.1",
34
34
  "@types/node": "^26.0.0",
35
35
  "@types/validator": "^13.15.3",
36
+ "@vitest/coverage-v8": "^4.1.11",
36
37
  "class-transformer": "^0.5.1",
37
38
  "class-validator": "^0.14.2",
38
39
  "eslint": "^9.39.3",
39
40
  "reflect-metadata": "^0.2.2",
40
41
  "rxjs": "^7.8.2",
41
42
  "typescript": "^6.0.3",
42
- "@nest-boot/eslint-plugin": "^8.0.0-beta.0",
43
- "@nest-boot/eslint-config": "^8.0.0-beta.0",
44
- "@nest-boot/tsconfig": "^8.0.0-beta.0",
45
- "@nest-boot/i18n": "^8.0.0-beta.0"
43
+ "vite-tsconfig-paths": "^5.1.4",
44
+ "vitest": "^4.1.11",
45
+ "@nest-boot/eslint-config": "^8.0.0-beta.2",
46
+ "@nest-boot/eslint-plugin": "^8.0.0-beta.2",
47
+ "@nest-boot/i18n": "^8.0.0-beta.2",
48
+ "@nest-boot/tsconfig": "^8.0.0-beta.2"
46
49
  },
47
50
  "peerDependencies": {
48
- "@nestjs/common": "^12.0.0-alpha.5",
49
- "@nestjs/core": "^12.0.0-alpha.5",
51
+ "@nestjs/common": "^12.0.0",
52
+ "@nestjs/core": "^12.0.0",
50
53
  "class-transformer": "^0.5.1",
51
54
  "class-validator": "^0.13.0",
52
55
  "reflect-metadata": "^0.2.2",
53
56
  "rxjs": "^7.0.0",
54
- "@nest-boot/i18n": "^8.0.0-beta.0"
57
+ "@nest-boot/i18n": "^8.0.0-beta.2"
55
58
  },
56
59
  "publishConfig": {
57
60
  "access": "public"
@@ -63,11 +66,25 @@
63
66
  ]
64
67
  },
65
68
  "type": "module",
69
+ "engines": {
70
+ "node": ">=26.0.0"
71
+ },
72
+ "exports": {
73
+ ".": {
74
+ "types": "./dist/index.d.ts",
75
+ "import": "./dist/index.js"
76
+ },
77
+ "./package.json": "./package.json"
78
+ },
66
79
  "scripts": {
67
80
  "build": "tsc -p tsconfig.build.json",
68
81
  "clean": "rm -rf .nx && rm -rf node_modules && rm -rf dist",
69
82
  "dev": "tsc -w -p tsconfig.build.json",
70
83
  "lint": "eslint \"{src,test}/**/*.ts\"",
71
- "lint:fix": "eslint \"{src,test}/**/*.ts\" --fix"
84
+ "lint:fix": "eslint \"{src,test}/**/*.ts\" --fix",
85
+ "test": "vitest run",
86
+ "test:cov": "vitest run --coverage",
87
+ "test:watch": "vitest",
88
+ "test:debug": "vitest --inspect-brk --no-file-parallelism"
72
89
  }
73
90
  }