Skip to content

Instantly share code, notes, and snippets.

@buildmotion
Created August 28, 2021 19:59
Show Gist options
  • Save buildmotion/8017e00c37412cdffda4cb1283ea854c to your computer and use it in GitHub Desktop.
Save buildmotion/8017e00c37412cdffda4cb1283ea854c to your computer and use it in GitHub Desktop.
import {RulePolicy} from './index';
import {CompositeRule} from './index';
export class RuleResult {
isValid: boolean = false;
rulePolicy: RulePolicy;
message: string;
target: any;
constructor(rulePolicy: RulePolicy, target: any);
constructor(rulePolicy: CompositeRule);
constructor(rulePolicy: RulePolicy, target?: any) {
if (rulePolicy != null) {
this.rulePolicy = rulePolicy;
this.isValid = rulePolicy.isValid;
this.message = rulePolicy.message;
}
this.target = target;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment