knight-validation 4.0.3 → 4.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/lib/Constraint.js +4 -4
- package/lib/lib/Validator.d.ts +2 -2
- package/lib/lib/Validator.js +1 -1
- package/package.json +1 -1
package/lib/lib/Constraint.js
CHANGED
|
@@ -35,7 +35,7 @@ class Constraint {
|
|
|
35
35
|
let fits = properties.length - misfits.length;
|
|
36
36
|
if (this.exactFits != undefined) {
|
|
37
37
|
if (fits != this.exactFits) {
|
|
38
|
-
return new knight_misfit_1.Misfit(this.name
|
|
38
|
+
return new knight_misfit_1.Misfit(this.name, undefined, {
|
|
39
39
|
atLeastFits: this.minFits,
|
|
40
40
|
atMostFits: this.maxFits,
|
|
41
41
|
exactFits: this.exactFits,
|
|
@@ -45,7 +45,7 @@ class Constraint {
|
|
|
45
45
|
}
|
|
46
46
|
else if (this.minFits != undefined && this.maxFits != undefined) {
|
|
47
47
|
if (fits < this.minFits || fits > this.maxFits) {
|
|
48
|
-
return new knight_misfit_1.Misfit(this.name
|
|
48
|
+
return new knight_misfit_1.Misfit(this.name, undefined, {
|
|
49
49
|
atLeastFits: this.minFits,
|
|
50
50
|
atMostFits: this.maxFits,
|
|
51
51
|
exactFits: this.exactFits,
|
|
@@ -55,7 +55,7 @@ class Constraint {
|
|
|
55
55
|
}
|
|
56
56
|
else if (this.minFits != undefined) {
|
|
57
57
|
if (fits < this.minFits) {
|
|
58
|
-
return new knight_misfit_1.Misfit(this.name
|
|
58
|
+
return new knight_misfit_1.Misfit(this.name, undefined, {
|
|
59
59
|
atLeastFits: this.minFits,
|
|
60
60
|
atMostFits: this.maxFits,
|
|
61
61
|
exactFits: this.exactFits,
|
|
@@ -65,7 +65,7 @@ class Constraint {
|
|
|
65
65
|
}
|
|
66
66
|
else if (this.maxFits != undefined) {
|
|
67
67
|
if (fits > this.maxFits) {
|
|
68
|
-
return new knight_misfit_1.Misfit(this.name
|
|
68
|
+
return new knight_misfit_1.Misfit(this.name, undefined, {
|
|
69
69
|
atLeastFits: this.minFits,
|
|
70
70
|
atMostFits: this.maxFits,
|
|
71
71
|
exactFits: this.exactFits,
|
package/lib/lib/Validator.d.ts
CHANGED
|
@@ -15,8 +15,8 @@ export interface ValidatorEntry<T = any> {
|
|
|
15
15
|
}
|
|
16
16
|
export declare class ValidatorFactory<T = any> {
|
|
17
17
|
validatorId: string;
|
|
18
|
-
createFn: (validators: ValidatorMap) => Validator<T>;
|
|
19
|
-
constructor(validatorId: string | (new (...args: any[]) => any), createFn: (validators: ValidatorMap) => Validator<T>);
|
|
18
|
+
createFn: (validators: ValidatorMap, validatorId: string) => Validator<T>;
|
|
19
|
+
constructor(validatorId: string | (new (...args: any[]) => any), createFn: (validators: ValidatorMap, validatorId: string) => Validator<T>);
|
|
20
20
|
createOrGetExisting(validators: ValidatorMap): Validator<T>;
|
|
21
21
|
}
|
|
22
22
|
export declare class Validator<T = any> {
|
package/lib/lib/Validator.js
CHANGED