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

Function addExportToChanges

test/fixtures/snapshot/typescript.js:162639–162651  ·  view source on GitHub ↗
(sourceFile, decl, name, changes, useEs6Exports)

Source from the content-addressed store, hash-verified

162637 }
162638 }
162639 function addExportToChanges(sourceFile, decl, name, changes, useEs6Exports) {
162640 if (isExported(sourceFile, decl, useEs6Exports, name))
162641 return;
162642 if (useEs6Exports) {
162643 if (!ts.isExpressionStatement(decl))
162644 changes.insertExportModifier(sourceFile, decl);
162645 }
162646 else {
162647 var names = getNamesToExportInCommonJS(decl);
162648 if (names.length !== 0)
162649 changes.insertNodesAfter(sourceFile, decl, names.map(createExportAssignment));
162650 }
162651 }
162652 function isExported(sourceFile, decl, useEs6Exports, name) {
162653 var _a;
162654 if (useEs6Exports) {

Calls 3

isExportedFunction · 0.85
mapMethod · 0.65

Tested by

no test coverage detected