File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 1
- import { ValidationArguments } from "./ValidationArguments" ;
1
+ import { ValidationArguments } from "./ValidationArguments" ;
2
2
3
3
/**
4
4
* Validation types.
@@ -102,15 +102,15 @@ export class ValidationTypes {
102
102
* Checks if validation type is valid.
103
103
*/
104
104
static isValid ( type : string ) {
105
- return type !== "isValid" &&
105
+ return type !== "isValid" &&
106
106
type !== "getMessage" &&
107
107
Object . keys ( this ) . map ( key => ( this as any ) [ key ] ) . indexOf ( type ) !== - 1 ;
108
108
}
109
109
110
110
/**
111
111
* Gets default validation error message for the given validation type.
112
112
*/
113
- static getMessage ( type : string , isEach : boolean ) : string | ( ( args : ValidationArguments ) => string ) {
113
+ static getMessage ( type : string , isEach : boolean ) : string | ( ( args : ValidationArguments ) => string ) {
114
114
const eachPrefix = isEach ? "each value in " : "" ;
115
115
switch ( type ) {
116
116
@@ -132,6 +132,8 @@ export class ValidationTypes {
132
132
return eachPrefix + "$property must be one of the following values: $constraint1" ;
133
133
case this . IS_NOT_IN :
134
134
return eachPrefix + "$property should not be one of the following values: $constraint1" ;
135
+ case this . IS_PORT :
136
+ return eachPrefix + "$property must be a port" ;
135
137
136
138
/* type checkers */
137
139
case this . IS_BOOLEAN :
You can’t perform that action at this time.
0 commit comments