MCPcopy Create free account
hub / github.com/nodejs/node / isIgnorableParen

Function isIgnorableParen

test/fixtures/snapshot/typescript.js:26765–26772  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

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)) {

Callers 1

restoreOuterExpressionsFunction · 0.85

Calls 1

someMethod · 0.80

Tested by

no test coverage detected