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

Function insertStatementsAfterPrologue

test/fixtures/snapshot/typescript.js:14621–14633  ·  view source on GitHub ↗
(to, from, isPrologueDirective)

Source from the content-addressed store, hash-verified

14619 }
14620 ts.nodeIsPresent = nodeIsPresent;
14621 function insertStatementsAfterPrologue(to, from, isPrologueDirective) {
14622 if (from === undefined || from.length === 0)
14623 return to;
14624 var statementIndex = 0;
14625 // skip all prologue directives to insert at the correct position
14626 for (; statementIndex < to.length; ++statementIndex) {
14627 if (!isPrologueDirective(to[statementIndex])) {
14628 break;
14629 }
14630 }
14631 to.splice.apply(to, __spreadArray([statementIndex, 0], from, false));
14632 return to;
14633 }
14634 function insertStatementAfterPrologue(to, statement, isPrologueDirective) {
14635 if (statement === undefined)
14636 return to;

Calls 2

isPrologueDirectiveFunction · 0.85
applyMethod · 0.45

Tested by

no test coverage detected