File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- import { ValidationArguments } from "./ValidationArguments" ;
1+ import { ValidationArguments } from "./ValidationArguments" ;
22
33/**
44 * Validation types.
@@ -102,15 +102,15 @@ export class ValidationTypes {
102102 * Checks if validation type is valid.
103103 */
104104 static isValid ( type : string ) {
105- return type !== "isValid" &&
105+ return type !== "isValid" &&
106106 type !== "getMessage" &&
107107 Object . keys ( this ) . map ( key => ( this as any ) [ key ] ) . indexOf ( type ) !== - 1 ;
108108 }
109109
110110 /**
111111 * Gets default validation error message for the given validation type.
112112 */
113- static getMessage ( type : string , isEach : boolean ) : string | ( ( args : ValidationArguments ) => string ) {
113+ static getMessage ( type : string , isEach : boolean ) : string | ( ( args : ValidationArguments ) => string ) {
114114 const eachPrefix = isEach ? "each value in " : "" ;
115115 switch ( type ) {
116116
@@ -132,6 +132,8 @@ export class ValidationTypes {
132132 return eachPrefix + "$property must be one of the following values: $constraint1" ;
133133 case this . IS_NOT_IN :
134134 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" ;
135137
136138 /* type checkers */
137139 case this . IS_BOOLEAN :
You can’t perform that action at this time.
0 commit comments