* Determines whether a node is a parenthesized expression that can be ignored when recreating outer expressions. * * A parenthesized expression can be ignored when all of the following are true: * * - It's `pos` and `end` are not -1 * - It does not have a
(node)
| 26763 | * the containing expression is created/updated. |
| 26764 | */ |
| 26765 | function isIgnorableParen(node) { |
| 26766 | return ts.isParenthesizedExpression(node) |
| 26767 | && ts.nodeIsSynthesized(node) |
| 26768 | && ts.nodeIsSynthesized(ts.getSourceMapRange(node)) |
| 26769 | && ts.nodeIsSynthesized(ts.getCommentRange(node)) |
| 26770 | && !ts.some(ts.getSyntheticLeadingComments(node)) |
| 26771 | && !ts.some(ts.getSyntheticTrailingComments(node)); |
| 26772 | } |
| 26773 | function restoreOuterExpressions(outerExpression, innerExpression, kinds) { |
| 26774 | if (kinds === void 0) { kinds = 15 /* OuterExpressionKinds.All */; } |
| 26775 | if (outerExpression && ts.isOuterExpression(outerExpression, kinds) && !isIgnorableParen(outerExpression)) { |
no test coverage detected