File tree Expand file tree Collapse file tree 3 files changed +30
-1
lines changed
MADE.Data.Validation/src/validators Expand file tree Collapse file tree 3 files changed +30
-1
lines changed Original file line number Diff line number Diff line change
1
+ import { IValidator } from "./IValidator" ;
2
+
3
+ export class ContainsValidator implements IValidator {
4
+ key : string ;
5
+ isInvalid : boolean ;
6
+ isDirty : boolean ;
7
+ feedbackMessage : string ;
8
+ options : any [ ] ;
9
+
10
+ constructor ( options : any [ ] ) {
11
+ this . key = "BetweenValidator" ;
12
+ this . isInvalid = false ;
13
+ this . isDirty = false ;
14
+ this . feedbackMessage = `The value is not a valid option.` ;
15
+ this . options = options ;
16
+ }
17
+
18
+ validate ( value : any ) : void {
19
+ this . isInvalid = this . options . indexOf ( value ) === - 1 ;
20
+ this . isDirty = true ;
21
+ }
22
+ }
Original file line number Diff line number Diff line change
1
+ import { ValidatorArray } from "./ValidatorArray" ;
2
+
3
+ export interface IValidatorMap {
4
+ [ key : string ] : ValidatorArray ;
5
+ }
Original file line number Diff line number Diff line change @@ -4,11 +4,13 @@ export * from './RegexValidator';
4
4
export * from './AlphaNumericValidator' ;
5
5
export * from './AlphaValidator' ;
6
6
export * from './BetweenValidator' ;
7
+ export * from './ContainsValidator' ;
7
8
export * from './EmailValidator' ;
8
9
export * from './IpAddressValidator' ;
9
10
export * from './MaxLengthValidator' ;
10
11
export * from './MaxValueValidator' ;
11
12
export * from './MinLengthValidator' ;
12
13
export * from './MinValueValidator' ;
13
14
export * from './RequiredValidator' ;
14
- export * from './ValidatorArray' ;
15
+ export * from './ValidatorArray' ;
16
+ export * from './IValidatorMap' ;
You can’t perform that action at this time.
0 commit comments