Skip to content

Commit 919bb83

Browse files
committed
refactor(rules:if): throw on unsupported node type in _nodeToAtom
Replaces the silent `return ""` default with an explicit error, making unexpected AST node types fail loudly instead of producing a wrong result.
1 parent aaef604 commit 919bb83

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ export class Utils {
230230
const n = node as jsep.BinaryExpression;
231231
return `${Utils._nodeToAtom(n.left)} ${n.operator} ${Utils._nodeToAtom(n.right)}`;
232232
}
233-
default: return "";
233+
default: throw new Error(`Unsupported expression node type: ${(node as any).type}`);
234234
}
235235
}
236236

0 commit comments

Comments
 (0)