After reviewing this method, I can't help but wonder why it uses
Object.keys(this).map(key => (this as any)[key])
. Is there any reason why Object.keys(this).indexOf(type) !== -1
wouldn't work just as well?
/**
* Checks if validation type is valid.
*/
static isValid(type: string) {
return type !== "isValid" &&
type !== "getMessage" &&
Object.keys(this).map(key => (this as any)[key]).indexOf(type) !== -1;
}