File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -306,7 +306,7 @@ export interface BooleanValidatorType extends Validator<boolean> {
306
306
}
307
307
308
308
export interface EnumValidatorType < T extends string | number > extends Validator < T > {
309
- allowedValues : readonly T [ ]
309
+ getAllowedValues : ( ) => readonly T [ ]
310
310
custom : ( fn : ( value : T ) => boolean , message : string ) => EnumValidator < T >
311
311
}
312
312
Original file line number Diff line number Diff line change @@ -17,6 +17,10 @@ export class EnumValidator<T extends string | number> extends BaseValidator<T> i
17
17
} )
18
18
}
19
19
20
+ getAllowedValues ( ) : readonly T [ ] {
21
+ return this . allowedValues
22
+ }
23
+
20
24
custom ( fn : ( value : T ) => boolean , message : string ) : this {
21
25
return this . addRule ( {
22
26
name : 'custom' ,
You can’t perform that action at this time.
0 commit comments