Skip to content

Commit adfc78b

Browse files
committed
Fix test
1 parent 2aadfbc commit adfc78b

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/transform-node.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,10 @@ class Transformer extends Source {
605605
);
606606
}
607607

608+
if (node instanceof angular.ParenthesizedExpression) {
609+
return this.#transformNode(node.expression);
610+
}
611+
608612
/* c8 ignore next */
609613
throw new Error(`Unexpected node type '${node.constructor.name}'`);
610614
}
@@ -636,7 +640,8 @@ type SupportedNodes =
636640
| angular.TypeofExpression
637641
| angular.VoidExpression
638642
| angular.TemplateLiteral // Including `TemplateLiteralElement`
639-
| angular.TaggedTemplateLiteral;
643+
| angular.TaggedTemplateLiteral
644+
| angular.ParenthesizedExpression;
640645
function transform(node: SupportedNodes, text: string): NGNode {
641646
return new Transformer(node, text).node;
642647
}

tests/helpers.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,17 @@ const KNOWN_AST_TYPES = [
169169
'SafePropertyRead',
170170
'ThisReceiver',
171171
'Interpolation',
172+
'VoidExpression',
173+
'TemplateLiteral',
174+
'TaggedTemplateLiteral',
175+
'ParenthesizedExpression',
172176
] as const;
173177

174178
export function getAngularNodeType(node: angular.AST) {
179+
if (node instanceof angular.ParenthesizedExpression) {
180+
return getAngularNodeType(node.expression);
181+
}
182+
175183
return (
176184
KNOWN_AST_TYPES.find((type) => node instanceof angular[type]) ??
177185
node.constructor.name

0 commit comments

Comments
 (0)