File tree 1 file changed +26
-24
lines changed
1 file changed +26
-24
lines changed Original file line number Diff line number Diff line change @@ -589,34 +589,36 @@ class Transformer extends Source {
589
589
}
590
590
591
591
// istanbul ignore next
592
- throw Object . assign ( new Error ( ' Unexpected node' ) , { node } ) ;
592
+ throw new Error ( ` Unexpected node type ' ${ node . constructor . name } '` ) ;
593
593
}
594
594
}
595
595
596
596
// See `convertAst` in `@angular/compiler`
597
- // ASTWithSource (Not handled)
598
- // PropertyRead
599
- // PropertyWrite
600
- // KeyedWrite
601
- // Call
602
- // LiteralPrimitive
603
- // Unary
604
- // Binary
605
- // ThisReceiver (Not handled)
606
- // KeyedRead
607
- // Chain
608
- // LiteralMap
609
- // LiteralArray
610
- // Conditional
611
- // NonNullAssert
612
- // BindingPipe
613
- // SafeKeyedRead
614
- // SafePropertyRead
615
- // SafeCall
616
- // EmptyExpr
617
- // PrefixNot
618
- // TypeofExpression
619
- function transform ( node : angular . AST , text : string ) : NGNode {
597
+ type SupportedNodes =
598
+ | angular . ASTWithSource // Not handled
599
+ | angular . PropertyRead
600
+ | angular . PropertyWrite
601
+ | angular . KeyedWrite
602
+ | angular . Call
603
+ | angular . LiteralPrimitive
604
+ | angular . Unary
605
+ | angular . Binary
606
+ | angular . ThisReceiver // Not handled
607
+ | angular . KeyedRead
608
+ | angular . Chain
609
+ | angular . LiteralMap
610
+ | angular . LiteralArray
611
+ | angular . Conditional
612
+ | angular . NonNullAssert
613
+ | angular . BindingPipe
614
+ | angular . SafeKeyedRead
615
+ | angular . SafePropertyRead
616
+ | angular . SafeCall
617
+ | angular . EmptyExpr
618
+ | angular . PrefixNot
619
+ | angular . TypeofExpression
620
+ | angular . TemplateLiteral ; // Including `TemplateLiteralElement`
621
+ function transform ( node : SupportedNodes , text : string ) : NGNode {
620
622
return new Transformer ( node , text ) . node ;
621
623
}
622
624
You can’t perform that action at this time.
0 commit comments