MCPcopy Index your code
hub / github.com/nodejs/node / updateExternalModule

Function updateExternalModule

test/fixtures/snapshot/typescript.js:107365–107377  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

107363 return node;
107364 }
107365 function updateExternalModule(node) {
107366 var externalHelpersImportDeclaration = ts.createExternalHelpersImportDeclarationIfNeeded(factory, emitHelpers(), node, compilerOptions);
107367 if (externalHelpersImportDeclaration) {
107368 var statements = [];
107369 var statementOffset = factory.copyPrologue(node.statements, statements);
107370 ts.append(statements, externalHelpersImportDeclaration);
107371 ts.addRange(statements, ts.visitNodes(node.statements, visitor, ts.isStatement, statementOffset));
107372 return factory.updateSourceFile(node, ts.setTextRange(factory.createNodeArray(statements), node.statements));
107373 }
107374 else {
107375 return ts.visitEachChild(node, visitor, context);
107376 }
107377 }
107378 function visitor(node) {
107379 switch (node.kind) {
107380 case 265 /* SyntaxKind.ImportEqualsDeclaration */:

Callers 1

transformSourceFileFunction · 0.85

Calls 3

emitHelpersFunction · 0.85
addRangeMethod · 0.80
appendMethod · 0.45

Tested by

no test coverage detected