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

Function collectExportRenames

test/fixtures/snapshot/typescript.js:152156–152167  ·  view source on GitHub ↗
(sourceFile, checker, identifiers)

Source from the content-addressed store, hash-verified

152154 return moduleExportsChangedToDefault;
152155 }
152156 function collectExportRenames(sourceFile, checker, identifiers) {
152157 var res = new ts.Map();
152158 forEachExportReference(sourceFile, function (node) {
152159 var _a = node.name, text = _a.text, originalKeywordKind = _a.originalKeywordKind;
152160 if (!res.has(text) && (originalKeywordKind !== undefined && ts.isNonContextualKeyword(originalKeywordKind)
152161 || checker.resolveName(text, node, 111551 /* SymbolFlags.Value */, /*excludeGlobals*/ true))) {
152162 // Unconditionally add an underscore in case `text` is a keyword.
152163 res.set(text, makeUniqueName("_".concat(text), identifiers));
152164 }
152165 });
152166 return res;
152167 }
152168 function convertExportsAccesses(sourceFile, exports, changes) {
152169 forEachExportReference(sourceFile, function (node, isAssignmentLhs) {
152170 if (isAssignmentLhs) {

Callers 1

convertFileToEsModuleFunction · 0.85

Calls 5

forEachExportReferenceFunction · 0.85
makeUniqueNameFunction · 0.85
concatMethod · 0.80
hasMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected