Skip to content

Commit 2c940d3

Browse files
committed
Make isExpression slightly stricter/more correct
1 parent fd400b3 commit 2c940d3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/language/semantics/expression.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const isExpression = (
1111
): node is Expression =>
1212
typeof node === 'object' &&
1313
typeof node[0] === 'string' &&
14-
node[0][0] === '@' &&
14+
/^@[^@]/.test(node['0']) &&
1515
(!('1' in node) || typeof node[1] === 'object' || typeof node[1] === 'string')
1616

1717
export const isExpressionWithArgument = <Keyword extends `@${string}`>(

0 commit comments

Comments
 (0)