Skip to content

Commit 0f5d5ab

Browse files
committed
fixed dummy checks
1 parent b8f6d31 commit 0f5d5ab

1 file changed

Lines changed: 2 additions & 9 deletions

File tree

src/Factory.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ import { DEFINED_RULES } from "./ruleManager";
44

55
export const toRuleDefinition = (rule: string): IRuleDefinition => {
66
const [name, paramsAsString] = rule.split(":");
7-
const ruleType = toRuleType(name);
7+
8+
const ruleType = name as RuleType;
89

910
const params = paramsAsString ? paramsAsString.split(",") : [];
1011

@@ -20,11 +21,3 @@ export const toRuleDefinition = (rule: string): IRuleDefinition => {
2021
params,
2122
};
2223
};
23-
24-
export const toRuleType = (name: string): RuleType => {
25-
try {
26-
return name as RuleType;
27-
} catch (error) {
28-
throw new Error(`Undefined rule: ${name}`);
29-
}
30-
};

0 commit comments

Comments
 (0)