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

Function getValidParentNodeOfEmptySpan

test/fixtures/snapshot/typescript.js:159695–159703  ·  view source on GitHub ↗

* Finds an ancestor of the input node that is a valid type for extraction, skipping subexpressions.

(node)

Source from the content-addressed store, hash-verified

159693 * Finds an ancestor of the input node that is a valid type for extraction, skipping subexpressions.
159694 */
159695 function getValidParentNodeOfEmptySpan(node) {
159696 while (node.parent) {
159697 if (isValidExpressionOrStatement(node) && !isValidExpressionOrStatement(node.parent)) {
159698 return node;
159699 }
159700 node = node.parent;
159701 }
159702 return undefined;
159703 }
159704 /**
159705 * Gets an expression of valid extraction type from a valid statement or expression.
159706 */

Callers 1

getInfoFunction · 0.85

Calls 1

Tested by

no test coverage detected