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

Function flatMapChildren

test/fixtures/snapshot/typescript.js:135680–135689  ·  view source on GitHub ↗
(node, cb)

Source from the content-addressed store, hash-verified

135678 return ts.isBreakOrContinueStatement(node) ? [node] : ts.isFunctionLike(node) ? undefined : flatMapChildren(node, aggregateAllBreakAndContinueStatements);
135679 }
135680 function flatMapChildren(node, cb) {
135681 var result = [];
135682 node.forEachChild(function (child) {
135683 var value = cb(child);
135684 if (value !== undefined) {
135685 result.push.apply(result, ts.toArray(value));
135686 }
135687 });
135688 return result;
135689 }
135690 function ownsBreakOrContinueStatement(owner, statement) {
135691 var actualOwner = getBreakOrContinueOwner(statement);
135692 return !!actualOwner && actualOwner === owner;

Calls 4

forEachChildMethod · 0.80
toArrayMethod · 0.65
cbFunction · 0.50
applyMethod · 0.45

Tested by

no test coverage detected