File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 11import { IRuleDefinition } from "../interfaces/IRuleDefinition" ;
2- import { DefaultRuleStore } from "../store/DefaultRuleStore" ;
2+ import { AdvancedRule } from "../models/AdvancedRule" ;
3+ import { BetaRuleStore , DefaultRuleStore } from "../store/DefaultRuleStore" ;
34
4- export class DynamicRule < T extends IRuleDefinition > {
5+ export class DynamicRule < T extends AdvancedRule | IRuleDefinition > {
56 constructor ( className : string ) {
6- if ( ! DefaultRuleStore . hasOwnProperty ( className ) ) {
7- throw new Error ( `Class type of \' ${ className } \' is not in the store` ) ;
7+ if ( ! DefaultRuleStore . hasOwnProperty ( className ) && BetaRuleStore . hasOwnProperty ( className ) ) {
8+ return new BetaRuleStore [ className ] ( ) as T ;
89 }
910 return new DefaultRuleStore [ className ] ( ) as T ;
1011 }
11- }
12-
12+ }
You can’t perform that action at this time.
0 commit comments