@decaf-ts/decorator-validation 1.5.7 → 1.5.9

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 (117) hide show
  1. package/dist/decorator-validation.bundle.min.js +2 -0
  2. package/dist/esm/decorator-validation.bundle.min.esm.js +2 -0
  3. package/lib/esm/index.d.ts +1 -1
  4. package/lib/esm/index.js +1 -1
  5. package/lib/esm/model/Model.d.ts +66 -0
  6. package/lib/esm/model/Model.js +93 -2
  7. package/lib/esm/model/index.d.ts +0 -2
  8. package/lib/esm/model/index.js +0 -2
  9. package/lib/esm/model/validation.js +2 -2
  10. package/lib/esm/utils/hashing.d.ts +0 -14
  11. package/lib/esm/utils/hashing.js +0 -17
  12. package/lib/esm/utils/index.d.ts +1 -0
  13. package/lib/esm/utils/index.js +1 -0
  14. package/lib/esm/utils/serialization.d.ts +4 -30
  15. package/lib/esm/utils/serialization.js +2 -1
  16. package/lib/esm/utils/types.d.ts +29 -0
  17. package/lib/esm/validation/Validation.d.ts +1 -1
  18. package/lib/esm/validation/Validators/DateValidator.d.ts +1 -1
  19. package/lib/esm/validation/Validators/EmailValidator.d.ts +1 -1
  20. package/lib/esm/validation/Validators/ListValidator.d.ts +1 -1
  21. package/lib/esm/validation/Validators/MaxLengthValidator.d.ts +1 -1
  22. package/lib/esm/validation/Validators/MaxValidator.d.ts +1 -1
  23. package/lib/esm/validation/Validators/MinLengthValidator.d.ts +1 -1
  24. package/lib/esm/validation/Validators/MinValidator.d.ts +1 -1
  25. package/lib/esm/validation/Validators/PasswordValidator.d.ts +1 -1
  26. package/lib/esm/validation/Validators/PatternValidator.d.ts +1 -1
  27. package/lib/esm/validation/Validators/RequiredValidator.d.ts +1 -1
  28. package/lib/esm/validation/Validators/StepValidator.d.ts +1 -1
  29. package/lib/esm/validation/Validators/TypeValidator.d.ts +1 -1
  30. package/lib/esm/validation/Validators/URLValidator.d.ts +1 -1
  31. package/lib/esm/validation/Validators/Validator.d.ts +1 -1
  32. package/lib/esm/validation/Validators/ValidatorRegistry.d.ts +2 -2
  33. package/lib/esm/validation/Validators/index.d.ts +0 -1
  34. package/lib/esm/validation/Validators/index.js +0 -1
  35. package/lib/esm/validation/types.d.ts +88 -0
  36. package/lib/{index.js → index.cjs} +4 -4
  37. package/lib/index.d.ts +1 -1
  38. package/lib/model/{Model.js → Model.cjs} +107 -12
  39. package/lib/model/Model.d.ts +66 -0
  40. package/lib/model/{construction.js → construction.cjs} +1 -1
  41. package/lib/model/{decorators.js → decorators.cjs} +3 -3
  42. package/lib/{utils/index.js → model/index.cjs} +7 -7
  43. package/lib/model/index.d.ts +0 -2
  44. package/lib/model/{validation.js → validation.cjs} +9 -9
  45. package/lib/utils/{dates.js → dates.cjs} +2 -2
  46. package/lib/utils/{decorators.js → decorators.cjs} +1 -1
  47. package/lib/utils/{hashing.js → hashing.cjs} +0 -18
  48. package/lib/utils/hashing.d.ts +0 -14
  49. package/lib/{model/index.js → utils/index.cjs} +8 -9
  50. package/lib/utils/index.d.ts +1 -0
  51. package/lib/utils/{serialization.js → serialization.cjs} +5 -4
  52. package/lib/utils/serialization.d.ts +4 -30
  53. package/lib/utils/types.d.ts +29 -0
  54. package/lib/validation/{Validation.js → Validation.cjs} +2 -2
  55. package/lib/validation/Validation.d.ts +1 -1
  56. package/lib/validation/Validators/{DateValidator.js → DateValidator.cjs} +3 -3
  57. package/lib/validation/Validators/DateValidator.d.ts +1 -1
  58. package/lib/validation/Validators/{EmailValidator.js → EmailValidator.cjs} +3 -3
  59. package/lib/validation/Validators/EmailValidator.d.ts +1 -1
  60. package/lib/validation/Validators/{ListValidator.js → ListValidator.cjs} +3 -3
  61. package/lib/validation/Validators/ListValidator.d.ts +1 -1
  62. package/lib/validation/Validators/{MaxLengthValidator.js → MaxLengthValidator.cjs} +3 -3
  63. package/lib/validation/Validators/MaxLengthValidator.d.ts +1 -1
  64. package/lib/validation/Validators/{MaxValidator.js → MaxValidator.cjs} +3 -3
  65. package/lib/validation/Validators/MaxValidator.d.ts +1 -1
  66. package/lib/validation/Validators/{MinLengthValidator.js → MinLengthValidator.cjs} +3 -3
  67. package/lib/validation/Validators/MinLengthValidator.d.ts +1 -1
  68. package/lib/validation/Validators/{MinValidator.js → MinValidator.cjs} +3 -3
  69. package/lib/validation/Validators/MinValidator.d.ts +1 -1
  70. package/lib/validation/Validators/{PasswordValidator.js → PasswordValidator.cjs} +3 -3
  71. package/lib/validation/Validators/PasswordValidator.d.ts +1 -1
  72. package/lib/validation/Validators/{PatternValidator.js → PatternValidator.cjs} +3 -3
  73. package/lib/validation/Validators/PatternValidator.d.ts +1 -1
  74. package/lib/validation/Validators/{RequiredValidator.js → RequiredValidator.cjs} +3 -3
  75. package/lib/validation/Validators/RequiredValidator.d.ts +1 -1
  76. package/lib/validation/Validators/{StepValidator.js → StepValidator.cjs} +3 -3
  77. package/lib/validation/Validators/StepValidator.d.ts +1 -1
  78. package/lib/validation/Validators/{TypeValidator.js → TypeValidator.cjs} +5 -5
  79. package/lib/validation/Validators/TypeValidator.d.ts +1 -1
  80. package/lib/validation/Validators/{URLValidator.js → URLValidator.cjs} +3 -3
  81. package/lib/validation/Validators/URLValidator.d.ts +1 -1
  82. package/lib/validation/Validators/{Validator.js → Validator.cjs} +2 -2
  83. package/lib/validation/Validators/Validator.d.ts +1 -1
  84. package/lib/validation/Validators/ValidatorRegistry.d.ts +2 -2
  85. package/lib/validation/Validators/{constants.js → constants.cjs} +1 -1
  86. package/lib/validation/Validators/{decorators.js → decorators.cjs} +2 -2
  87. package/lib/validation/Validators/index.cjs +68 -0
  88. package/lib/validation/{decorators.js → decorators.cjs} +5 -5
  89. package/lib/validation/{index.js → index.cjs} +4 -4
  90. package/lib/validation/types.d.ts +88 -0
  91. package/package.json +1 -1
  92. package/dist/decorator-validation.js +0 -2
  93. package/dist/esm/decorator-validation.js +0 -2
  94. package/lib/esm/model/Registry.d.ts +0 -59
  95. package/lib/esm/model/Registry.js +0 -73
  96. package/lib/esm/model/utils.d.ts +0 -11
  97. package/lib/esm/model/utils.js +0 -25
  98. package/lib/esm/validation/Validators/types.d.ts +0 -88
  99. package/lib/model/Registry.d.ts +0 -59
  100. package/lib/model/Registry.js +0 -78
  101. package/lib/model/utils.d.ts +0 -11
  102. package/lib/model/utils.js +0 -29
  103. package/lib/validation/Validators/decorators.d.ts +0 -12
  104. package/lib/validation/Validators/index.d.ts +0 -52
  105. package/lib/validation/Validators/index.js +0 -69
  106. /package/dist/{decorator-validation.js.LICENSE.txt → decorator-validation.bundle.min.js.LICENSE.txt} +0 -0
  107. /package/dist/esm/{decorator-validation.js.LICENSE.txt → decorator-validation.bundle.min.esm.js.LICENSE.txt} +0 -0
  108. /package/lib/esm/{validation/Validators → utils}/types.js +0 -0
  109. /package/lib/model/{ModelErrorDefinition.js → ModelErrorDefinition.cjs} +0 -0
  110. /package/lib/model/{constants.js → constants.cjs} +0 -0
  111. /package/lib/model/{types.js → types.cjs} +0 -0
  112. /package/lib/utils/{constants.js → constants.cjs} +0 -0
  113. /package/lib/utils/{registry.js → registry.cjs} +0 -0
  114. /package/lib/utils/{strings.js → strings.cjs} +0 -0
  115. /package/lib/{validation/Validators/types.js → utils/types.cjs} +0 -0
  116. /package/lib/validation/Validators/{ValidatorRegistry.js → ValidatorRegistry.cjs} +0 -0
  117. /package/lib/validation/{types.js → types.cjs} +0 -0
@@ -1,14 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.validate = validate;
4
- const ModelErrorDefinition_1 = require("./ModelErrorDefinition");
4
+ const ModelErrorDefinition_1 = require("./ModelErrorDefinition.cjs");
5
5
  const reflection_1 = require("@decaf-ts/reflection");
6
- const constants_1 = require("../utils/constants");
7
- const strings_1 = require("../utils/strings");
8
- const constants_2 = require("./constants");
9
- const Validation_1 = require("../validation/Validation");
10
- const constants_3 = require("../validation/Validators/constants");
11
- const utils_1 = require("./utils");
6
+ const constants_1 = require("../utils/constants.cjs");
7
+ const strings_1 = require("../utils/strings.cjs");
8
+ const constants_2 = require("./constants.cjs");
9
+ const Model_1 = require("./Model.cjs");
10
+ const Validation_1 = require("../validation/Validation.cjs");
11
+ const constants_3 = require("../validation/Validators/constants.cjs");
12
12
  /**
13
13
  * @summary Analyses the decorations of the properties and validates the obj according to them
14
14
  *
@@ -48,7 +48,7 @@ function validate(obj, ...propsToIgnore) {
48
48
  }
49
49
  const decoratorProps = decorator.key === constants_1.ModelKeys.TYPE
50
50
  ? [decorator.props]
51
- : (decorator.props || {});
51
+ : decorator.props || {};
52
52
  const err = validator.hasErrors(obj[prop.toString()], decoratorProps);
53
53
  if (err) {
54
54
  errs = errs || {};
@@ -93,7 +93,7 @@ function validate(obj, ...propsToIgnore) {
93
93
  }
94
94
  const validate = (prop, value) => {
95
95
  if (typeof value === "object" || typeof value === "function")
96
- return (0, utils_1.isModel)(value)
96
+ return (0, Model_1.isModel)(value)
97
97
  ? value.hasErrors()
98
98
  : allowedTypes.includes(typeof value)
99
99
  ? undefined
@@ -7,8 +7,8 @@ exports.twoDigitPad = twoDigitPad;
7
7
  exports.formatDate = formatDate;
8
8
  exports.parseDate = parseDate;
9
9
  require("reflect-metadata");
10
- const constants_1 = require("../validation/Validators/constants");
11
- const strings_1 = require("./strings");
10
+ const constants_1 = require("../validation/Validators/constants.cjs");
11
+ const strings_1 = require("./strings.cjs");
12
12
  /**
13
13
  * @summary Reverses the process from {@link formatDate}
14
14
  *
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.prop = prop;
4
4
  exports.propMetadata = propMetadata;
5
5
  const reflection_1 = require("@decaf-ts/reflection");
6
- const constants_1 = require("./constants");
6
+ const constants_1 = require("./constants.cjs");
7
7
  function prop(key = constants_1.ModelKeys.ATTRIBUTE) {
8
8
  return (model, propertyKey) => {
9
9
  let props;
@@ -2,9 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Hashing = exports.DefaultHashingMethod = void 0;
4
4
  exports.hashCode = hashCode;
5
- exports.hashSerialization = hashSerialization;
6
5
  exports.hashObj = hashObj;
7
- const serialization_1 = require("./serialization");
8
6
  /**
9
7
  * @summary Mimics Java's String's Hash implementation
10
8
  *
@@ -25,22 +23,6 @@ function hashCode(obj) {
25
23
  }
26
24
  return hash.toString();
27
25
  }
28
- /**
29
- * @summary Hashes an object serializing it and then hashing the string
30
- * @description The Serialization algorithm used by default (JSON.stringify)
31
- * is not deterministic and should not be used for hashing
32
- *
33
- * @param {Record<string, any>} obj
34
- * @return {string} the resulting hash
35
- *
36
- * @function hashSerialization
37
- * @memberOf module:decorator-validation.Utils.Hashing
38
- *
39
- * @category Hashing
40
- */
41
- function hashSerialization(obj) {
42
- return hashCode(serialization_1.Serialization.serialize(obj));
43
- }
44
26
  /**
45
27
  * @summary Hashes an object by combining the hash of all its properties
46
28
  *
@@ -15,20 +15,6 @@ export declare function hashCode(obj: string | number | symbol | Date): string;
15
15
  * @category Hashing
16
16
  */
17
17
  export type HashingFunction = (value: any, ...args: any[]) => string;
18
- /**
19
- * @summary Hashes an object serializing it and then hashing the string
20
- * @description The Serialization algorithm used by default (JSON.stringify)
21
- * is not deterministic and should not be used for hashing
22
- *
23
- * @param {Record<string, any>} obj
24
- * @return {string} the resulting hash
25
- *
26
- * @function hashSerialization
27
- * @memberOf module:decorator-validation.Utils.Hashing
28
- *
29
- * @category Hashing
30
- */
31
- export declare function hashSerialization(obj: Record<string, any> | any[]): string;
32
18
  /**
33
19
  * @summary Hashes an object by combining the hash of all its properties
34
20
  *
@@ -14,12 +14,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./constants"), exports);
18
- __exportStar(require("./construction"), exports);
19
- __exportStar(require("./decorators"), exports);
20
- __exportStar(require("./Model"), exports);
21
- __exportStar(require("./ModelErrorDefinition"), exports);
22
- __exportStar(require("./Registry"), exports);
23
- __exportStar(require("./types"), exports);
24
- __exportStar(require("./utils"), exports);
25
- __exportStar(require("./validation"), exports);
17
+ __exportStar(require("./constants.cjs"), exports);
18
+ __exportStar(require("./dates.cjs"), exports);
19
+ __exportStar(require("./decorators.cjs"), exports);
20
+ __exportStar(require("./hashing.cjs"), exports);
21
+ __exportStar(require("./registry.cjs"), exports);
22
+ __exportStar(require("./serialization.cjs"), exports);
23
+ __exportStar(require("./strings.cjs"), exports);
24
+ __exportStar(require("./types.cjs"), exports);
@@ -5,3 +5,4 @@ export * from "./hashing";
5
5
  export * from "./registry";
6
6
  export * from "./serialization";
7
7
  export * from "./strings";
8
+ export * from "./types";
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Serialization = exports.DefaultSerializationMethod = exports.JSONSerializer = void 0;
4
- const Model_1 = require("../model/Model");
5
- const constants_1 = require("./constants");
3
+ exports.Serialization = exports.JSONSerializer = exports.DefaultSerializationMethod = void 0;
4
+ const Model_1 = require("../model/Model.cjs");
5
+ const constants_1 = require("./constants.cjs");
6
+ exports.DefaultSerializationMethod = "json";
6
7
  /**
7
8
  * @summary Concrete implementation of a {@link Serializer} in JSON format
8
9
  * @description JS's native JSON.stringify (used here) is not deterministic
@@ -17,6 +18,7 @@ const constants_1 = require("./constants");
17
18
  * @category Serialization
18
19
  */
19
20
  class JSONSerializer {
21
+ constructor() { }
20
22
  /**
21
23
  * @summary prepares the model for serialization
22
24
  * @description returns a shallow copy of the object, containing an enumerable {@link ModelKeys#ANCHOR} property
@@ -57,7 +59,6 @@ class JSONSerializer {
57
59
  }
58
60
  }
59
61
  exports.JSONSerializer = JSONSerializer;
60
- exports.DefaultSerializationMethod = "json";
61
62
  class Serialization {
62
63
  static { this.current = exports.DefaultSerializationMethod; }
63
64
  static { this.cache = {
@@ -1,33 +1,7 @@
1
- import { Model } from "../model/Model";
2
1
  import { Constructor } from "../model/types";
3
- /**
4
- * @summary Helper in serialization
5
- *
6
- * @interface Serializer
7
- * @category Serialization
8
- */
9
- export interface Serializer<T extends Model> {
10
- /**
11
- * @summary Serializes a model
12
- * @param {T} model
13
- *
14
- * @param args
15
- * @method
16
- *
17
- * @throws {Error}
18
- */
19
- serialize(model: T, ...args: any[]): string;
20
- /**
21
- * @summary Rebuilds a model from serialization
22
- * @param {string} str
23
- *
24
- * @param args
25
- * @method
26
- *
27
- * @throws {Error}
28
- */
29
- deserialize(str: string, ...args: any[]): T;
30
- }
2
+ import { Serializer } from "./types";
3
+ import { Model } from "../model/Model";
4
+ export declare const DefaultSerializationMethod = "json";
31
5
  /**
32
6
  * @summary Concrete implementation of a {@link Serializer} in JSON format
33
7
  * @description JS's native JSON.stringify (used here) is not deterministic
@@ -42,6 +16,7 @@ export interface Serializer<T extends Model> {
42
16
  * @category Serialization
43
17
  */
44
18
  export declare class JSONSerializer<T extends Model> implements Serializer<T> {
19
+ constructor();
45
20
  /**
46
21
  * @summary prepares the model for serialization
47
22
  * @description returns a shallow copy of the object, containing an enumerable {@link ModelKeys#ANCHOR} property
@@ -66,7 +41,6 @@ export declare class JSONSerializer<T extends Model> implements Serializer<T> {
66
41
  */
67
42
  serialize(model: T): string;
68
43
  }
69
- export declare const DefaultSerializationMethod = "json";
70
44
  export declare class Serialization {
71
45
  private static current;
72
46
  private static cache;
@@ -0,0 +1,29 @@
1
+ import { Model } from "../model";
2
+ /**
3
+ * @summary Helper in serialization
4
+ *
5
+ * @interface Serializer
6
+ * @category Serialization
7
+ */
8
+ export interface Serializer<T extends Model> {
9
+ /**
10
+ * @summary Serializes a model
11
+ * @param {T} model
12
+ *
13
+ * @param args
14
+ * @method
15
+ *
16
+ * @throws {Error}
17
+ */
18
+ serialize(model: T, ...args: any[]): string;
19
+ /**
20
+ * @summary Rebuilds a model from serialization
21
+ * @param {string} str
22
+ *
23
+ * @param args
24
+ * @method
25
+ *
26
+ * @throws {Error}
27
+ */
28
+ deserialize(str: string, ...args: any[]): T;
29
+ }
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Validation = void 0;
4
- const ValidatorRegistry_1 = require("./Validators/ValidatorRegistry");
5
- const constants_1 = require("./Validators/constants");
4
+ const ValidatorRegistry_1 = require("./Validators/ValidatorRegistry.cjs");
5
+ const constants_1 = require("./Validators/constants.cjs");
6
6
  /**
7
7
  * @summary Static class acting as a namespace for the Validation
8
8
  *
@@ -1,5 +1,5 @@
1
1
  import { Validator } from "./Validators/Validator";
2
- import { IValidatorRegistry, ValidatorDefinition } from "./Validators/types";
2
+ import { IValidatorRegistry, ValidatorDefinition } from "./types";
3
3
  /**
4
4
  * @summary Static class acting as a namespace for the Validation
5
5
  *
@@ -10,9 +10,9 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.DateValidator = void 0;
13
- const Validator_1 = require("./Validator");
14
- const constants_1 = require("./constants");
15
- const decorators_1 = require("./decorators");
13
+ const Validator_1 = require("./Validator.cjs");
14
+ const constants_1 = require("./constants.cjs");
15
+ const decorators_1 = require("./decorators.cjs");
16
16
  /**
17
17
  * @summary Date Validator
18
18
  *
@@ -1,5 +1,5 @@
1
1
  import { Validator } from "./Validator";
2
- import { DateValidatorOptions } from "./types";
2
+ import { DateValidatorOptions } from "../types";
3
3
  /**
4
4
  * @summary Date Validator
5
5
  *
@@ -10,9 +10,9 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.EmailValidator = void 0;
13
- const constants_1 = require("./constants");
14
- const PatternValidator_1 = require("./PatternValidator");
15
- const decorators_1 = require("./decorators");
13
+ const constants_1 = require("./constants.cjs");
14
+ const PatternValidator_1 = require("./PatternValidator.cjs");
15
+ const decorators_1 = require("./decorators.cjs");
16
16
  /**
17
17
  * @summary Email Validator
18
18
  *
@@ -1,5 +1,5 @@
1
1
  import { PatternValidator } from "./PatternValidator";
2
- import { PatternValidatorOptions } from "./types";
2
+ import { PatternValidatorOptions } from "../types";
3
3
  /**
4
4
  * @summary Email Validator
5
5
  *
@@ -10,9 +10,9 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.ListValidator = void 0;
13
- const Validator_1 = require("./Validator");
14
- const constants_1 = require("./constants");
15
- const decorators_1 = require("./decorators");
13
+ const Validator_1 = require("./Validator.cjs");
14
+ const constants_1 = require("./constants.cjs");
15
+ const decorators_1 = require("./decorators.cjs");
16
16
  /**
17
17
  * @summary List Validator
18
18
  *
@@ -1,5 +1,5 @@
1
1
  import { Validator } from "./Validator";
2
- import { ListValidatorOptions } from "./types";
2
+ import { ListValidatorOptions } from "../types";
3
3
  /**
4
4
  * @summary List Validator
5
5
  *
@@ -10,9 +10,9 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.MaxLengthValidator = void 0;
13
- const Validator_1 = require("./Validator");
14
- const constants_1 = require("./constants");
15
- const decorators_1 = require("./decorators");
13
+ const Validator_1 = require("./Validator.cjs");
14
+ const constants_1 = require("./constants.cjs");
15
+ const decorators_1 = require("./decorators.cjs");
16
16
  /**
17
17
  * @summary Maximum Length Validator
18
18
  * @description Validates strings and Arrays on their maximum length
@@ -1,5 +1,5 @@
1
1
  import { Validator } from "./Validator";
2
- import { MaxLengthValidatorOptions } from "./types";
2
+ import { MaxLengthValidatorOptions } from "../types";
3
3
  /**
4
4
  * @summary Maximum Length Validator
5
5
  * @description Validates strings and Arrays on their maximum length
@@ -10,9 +10,9 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.MaxValidator = void 0;
13
- const Validator_1 = require("./Validator");
14
- const constants_1 = require("./constants");
15
- const decorators_1 = require("./decorators");
13
+ const Validator_1 = require("./Validator.cjs");
14
+ const constants_1 = require("./constants.cjs");
15
+ const decorators_1 = require("./decorators.cjs");
16
16
  /**
17
17
  * @summary Max Validator
18
18
  *
@@ -1,5 +1,5 @@
1
1
  import { Validator } from "./Validator";
2
- import { MaxValidatorOptions } from "./types";
2
+ import { MaxValidatorOptions } from "../types";
3
3
  /**
4
4
  * @summary Max Validator
5
5
  *
@@ -10,9 +10,9 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.MinLengthValidator = void 0;
13
- const Validator_1 = require("./Validator");
14
- const constants_1 = require("./constants");
15
- const decorators_1 = require("./decorators");
13
+ const Validator_1 = require("./Validator.cjs");
14
+ const constants_1 = require("./constants.cjs");
15
+ const decorators_1 = require("./decorators.cjs");
16
16
  /**
17
17
  * @summary Minimum Length Validator
18
18
  * @description Validates strings and Arrays on their minimum length
@@ -1,5 +1,5 @@
1
1
  import { Validator } from "./Validator";
2
- import { MinLengthValidatorOptions } from "./types";
2
+ import { MinLengthValidatorOptions } from "../types";
3
3
  /**
4
4
  * @summary Minimum Length Validator
5
5
  * @description Validates strings and Arrays on their minimum length
@@ -10,9 +10,9 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.MinValidator = void 0;
13
- const Validator_1 = require("./Validator");
14
- const constants_1 = require("./constants");
15
- const decorators_1 = require("./decorators");
13
+ const Validator_1 = require("./Validator.cjs");
14
+ const constants_1 = require("./constants.cjs");
15
+ const decorators_1 = require("./decorators.cjs");
16
16
  /**
17
17
  * @summary Min Validator
18
18
  *
@@ -1,5 +1,5 @@
1
1
  import { Validator } from "./Validator";
2
- import { MinValidatorOptions } from "./types";
2
+ import { MinValidatorOptions } from "../types";
3
3
  /**
4
4
  * @summary Min Validator
5
5
  *
@@ -10,9 +10,9 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.PasswordValidator = void 0;
13
- const PatternValidator_1 = require("./PatternValidator");
14
- const constants_1 = require("./constants");
15
- const decorators_1 = require("./decorators");
13
+ const PatternValidator_1 = require("./PatternValidator.cjs");
14
+ const constants_1 = require("./constants.cjs");
15
+ const decorators_1 = require("./decorators.cjs");
16
16
  /**
17
17
  * @summary Handles Password Validation
18
18
  *
@@ -1,5 +1,5 @@
1
1
  import { PatternValidator } from "./PatternValidator";
2
- import { PatternValidatorOptions } from "./types";
2
+ import { PatternValidatorOptions } from "../types";
3
3
  /**
4
4
  * @summary Handles Password Validation
5
5
  *
@@ -10,9 +10,9 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.PatternValidator = exports.regexpParser = void 0;
13
- const Validator_1 = require("./Validator");
14
- const constants_1 = require("./constants");
15
- const decorators_1 = require("./decorators");
13
+ const Validator_1 = require("./Validator.cjs");
14
+ const constants_1 = require("./constants.cjs");
15
+ const decorators_1 = require("./decorators.cjs");
16
16
  exports.regexpParser = new RegExp("^/(.+)/([gimus]*)$");
17
17
  /**
18
18
  * @summary Pattern Validator
@@ -1,5 +1,5 @@
1
1
  import { Validator } from "./Validator";
2
- import { PatternValidatorOptions } from "./types";
2
+ import { PatternValidatorOptions } from "../types";
3
3
  export declare const regexpParser: RegExp;
4
4
  /**
5
5
  * @summary Pattern Validator
@@ -10,9 +10,9 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.RequiredValidator = void 0;
13
- const Validator_1 = require("./Validator");
14
- const constants_1 = require("./constants");
15
- const decorators_1 = require("./decorators");
13
+ const Validator_1 = require("./Validator.cjs");
14
+ const constants_1 = require("./constants.cjs");
15
+ const decorators_1 = require("./decorators.cjs");
16
16
  /**
17
17
  * @summary Required Validator
18
18
  *
@@ -1,5 +1,5 @@
1
1
  import { Validator } from "./Validator";
2
- import { ValidatorOptions } from "./types";
2
+ import { ValidatorOptions } from "../types";
3
3
  /**
4
4
  * @summary Required Validator
5
5
  *
@@ -10,9 +10,9 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.StepValidator = void 0;
13
- const Validator_1 = require("./Validator");
14
- const constants_1 = require("./constants");
15
- const decorators_1 = require("./decorators");
13
+ const Validator_1 = require("./Validator.cjs");
14
+ const constants_1 = require("./constants.cjs");
15
+ const decorators_1 = require("./decorators.cjs");
16
16
  /**
17
17
  * @summary Step Validator
18
18
  *
@@ -1,5 +1,5 @@
1
1
  import { Validator } from "./Validator";
2
- import { StepValidatorOptions } from "./types";
2
+ import { StepValidatorOptions } from "../types";
3
3
  /**
4
4
  * @summary Step Validator
5
5
  *
@@ -10,11 +10,11 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.TypeValidator = void 0;
13
- const Validator_1 = require("./Validator");
14
- const constants_1 = require("./constants");
15
- const decorators_1 = require("./decorators");
16
- const Validation_1 = require("../Validation");
17
- const constants_2 = require("../../utils/constants");
13
+ const Validator_1 = require("./Validator.cjs");
14
+ const constants_1 = require("./constants.cjs");
15
+ const decorators_1 = require("./decorators.cjs");
16
+ const Validation_1 = require("../Validation.cjs");
17
+ const constants_2 = require("../../utils/constants.cjs");
18
18
  const reflection_1 = require("@decaf-ts/reflection");
19
19
  /**
20
20
  * @summary Required Validator
@@ -1,5 +1,5 @@
1
1
  import { Validator } from "./Validator";
2
- import { TypeValidatorOptions } from "./types";
2
+ import { TypeValidatorOptions } from "../types";
3
3
  /**
4
4
  * @summary Required Validator
5
5
  *
@@ -10,9 +10,9 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.URLValidator = void 0;
13
- const constants_1 = require("./constants");
14
- const PatternValidator_1 = require("./PatternValidator");
15
- const decorators_1 = require("./decorators");
13
+ const constants_1 = require("./constants.cjs");
14
+ const PatternValidator_1 = require("./PatternValidator.cjs");
15
+ const decorators_1 = require("./decorators.cjs");
16
16
  /**
17
17
  * @summary URL Validator
18
18
  * @description Pattern from {@link https://gist.github.com/dperini/729294}
@@ -1,5 +1,5 @@
1
1
  import { PatternValidator } from "./PatternValidator";
2
- import { PatternValidatorOptions } from "./types";
2
+ import { PatternValidatorOptions } from "../types";
3
3
  /**
4
4
  * @summary URL Validator
5
5
  * @description Pattern from {@link https://gist.github.com/dperini/729294}
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Validator = void 0;
4
- const constants_1 = require("./constants");
5
- const strings_1 = require("../../utils/strings");
4
+ const constants_1 = require("./constants.cjs");
5
+ const strings_1 = require("../../utils/strings.cjs");
6
6
  const reflection_1 = require("@decaf-ts/reflection");
7
7
  /**
8
8
  * @summary Base Implementation for Validators
@@ -1,4 +1,4 @@
1
- import { ValidatorOptions } from "./types";
1
+ import { ValidatorOptions } from "../types";
2
2
  /**
3
3
  * @summary Base Implementation for Validators
4
4
  * @description Provides the underlying functionality for {@link Validator}s
@@ -1,5 +1,5 @@
1
- import { ValidatorDefinition } from "./types";
2
- import { IValidatorRegistry } from "./types";
1
+ import { ValidatorDefinition } from "../types";
2
+ import { IValidatorRegistry } from "../types";
3
3
  import type { Validator } from "./Validator";
4
4
  /**
5
5
  * @summary Duck typing for Validators
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DEFAULT_PATTERNS = exports.DEFAULT_ERROR_MESSAGES = exports.DAYS_OF_WEEK_NAMES = exports.MONTH_NAMES = exports.ValidationKeys = void 0;
4
- const constants_1 = require("../../utils/constants");
4
+ const constants_1 = require("../../utils/constants.cjs");
5
5
  /**
6
6
  * @summary The keys used for validation
7
7
  *
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.validator = validator;
4
- const Validation_1 = require("../Validation");
5
- const constants_1 = require("./constants");
4
+ const Validation_1 = require("../Validation.cjs");
5
+ const constants_1 = require("./constants.cjs");
6
6
  const reflection_1 = require("@decaf-ts/reflection");
7
7
  /**
8
8
  * @summary Marks the class as a validator for a certain key.