Determines whether a node is the expression preceding an optional chain (i.e. `a` in `a?.b`).
(node *Node)
| 381 | |
| 382 | // Determines whether a node is the expression preceding an optional chain (i.e. `a` in `a?.b`). |
| 383 | func IsExpressionOfOptionalChainRoot(node *Node) bool { |
| 384 | return IsOptionalChainRoot(node.Parent) && node.Parent.Expression() == node |
| 385 | } |
| 386 | |
| 387 | func IsNullishCoalesce(node *Node) bool { |
| 388 | return node.Kind == KindBinaryExpression && node.AsBinaryExpression().OperatorToken.Kind == KindQuestionQuestionToken |
no test coverage detected