We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8e09a33 commit c303b72Copy full SHA for c303b72
src/function-rule.ts
@@ -15,11 +15,11 @@ const functionRule: Rule<FunctionRule> = (
15
when: RuleConfigCondition = 'always',
16
value: FunctionRule | undefined,
17
) => {
18
- if (typeof value === 'function') {
19
- return value(parsed, when);
+ if (typeof value !== 'function') {
+ throw new Error('Not a valid function!');
20
}
21
22
- throw new Error('Not a valid function!');
+ return value(parsed, when);
23
};
24
25
export default functionRule;
0 commit comments