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

Function getCommonJsExportEquals

test/fixtures/snapshot/typescript.js:51323–51343  ·  view source on GitHub ↗
(exported, moduleSymbol)

Source from the content-addressed store, hash-verified

51321 return undefined;
51322 }
51323 function getCommonJsExportEquals(exported, moduleSymbol) {
51324 if (!exported || exported === unknownSymbol || exported === moduleSymbol || moduleSymbol.exports.size === 1 || exported.flags & 2097152 /* SymbolFlags.Alias */) {
51325 return exported;
51326 }
51327 var links = getSymbolLinks(exported);
51328 if (links.cjsExportMerged) {
51329 return links.cjsExportMerged;
51330 }
51331 var merged = exported.flags & 33554432 /* SymbolFlags.Transient */ ? exported : cloneSymbol(exported);
51332 merged.flags = merged.flags | 512 /* SymbolFlags.ValueModule */;
51333 if (merged.exports === undefined) {
51334 merged.exports = ts.createSymbolTable();
51335 }
51336 moduleSymbol.exports.forEach(function (s, name) {
51337 if (name === "export=" /* InternalSymbolName.ExportEquals */)
51338 return;
51339 merged.exports.set(name, merged.exports.has(name) ? mergeSymbol(merged.exports.get(name), s) : s);
51340 });
51341 getSymbolLinks(merged).cjsExportMerged = merged;
51342 return links.cjsExportMerged = merged;
51343 }
51344 // An external module with an 'export =' declaration may be referenced as an ES6 module provided the 'export ='
51345 // references a symbol that is at least declared as a module or a variable. The target of the 'export =' may
51346 // combine other declarations with the module or variable (e.g. a class/module, function/module, interface/variable).

Callers 1

Calls 7

getSymbolLinksFunction · 0.85
cloneSymbolFunction · 0.85
mergeSymbolFunction · 0.85
forEachMethod · 0.65
hasMethod · 0.65
getMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…