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

Function convertExportsAccesses

test/fixtures/snapshot/typescript.js:152168–152176  ·  view source on GitHub ↗
(sourceFile, exports, changes)

Source from the content-addressed store, hash-verified

152166 return res;
152167 }
152168 function convertExportsAccesses(sourceFile, exports, changes) {
152169 forEachExportReference(sourceFile, function (node, isAssignmentLhs) {
152170 if (isAssignmentLhs) {
152171 return;
152172 }
152173 var text = node.name.text;
152174 changes.replaceNode(sourceFile, node, ts.factory.createIdentifier(exports.get(text) || text));
152175 });
152176 }
152177 function forEachExportReference(sourceFile, cb) {
152178 sourceFile.forEachChild(function recur(node) {
152179 if (ts.isPropertyAccessExpression(node) && ts.isExportsOrModuleExportsOrAlias(sourceFile, node.expression) && ts.isIdentifier(node.name)) {

Callers 1

convertFileToEsModuleFunction · 0.85

Calls 2

forEachExportReferenceFunction · 0.85
getMethod · 0.65

Tested by

no test coverage detected