Skip to content

Commit a367b85

Browse files
committed
restore betarules
1 parent ba5dff4 commit a367b85

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/main/libs/DynamicRule.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import { 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+
}

0 commit comments

Comments
 (0)