Created
August 28, 2021 20:02
-
-
Save buildmotion/7a5621e66e94bbe50ee70a63349b74d3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class IsTrue extends SimpleRule { | |
target: boolean; | |
constructor(name: string, message: string, target: boolean, isDisplayable: boolean = true) { | |
super(name, message, isDisplayable); | |
this.target = target; | |
} | |
render() { | |
this.isValid = true; | |
if (this.target === false) {//if(not true)-->false; | |
this.isValid = false; | |
} | |
return new RuleResult(this, this.target); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment