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

Function getAliasForSymbolInContainer

test/fixtures/snapshot/typescript.js:51676–51697  ·  view source on GitHub ↗
(container, symbol)

Source from the content-addressed store, hash-verified

51674 return exported && getSymbolIfSameReference(exported, container) ? fileSymbol : undefined;
51675 }
51676 function getAliasForSymbolInContainer(container, symbol) {
51677 if (container === getParentOfSymbol(symbol)) {
51678 // fast path, `symbol` is either already the alias or isn't aliased
51679 return symbol;
51680 }
51681 // Check if container is a thing with an `export=` which points directly at `symbol`, and if so, return
51682 // the container itself as the alias for the symbol
51683 var exportEquals = container.exports && container.exports.get("export=" /* InternalSymbolName.ExportEquals */);
51684 if (exportEquals && getSymbolIfSameReference(exportEquals, symbol)) {
51685 return container;
51686 }
51687 var exports = getExportsOfSymbol(container);
51688 var quick = exports.get(symbol.escapedName);
51689 if (quick && getSymbolIfSameReference(quick, symbol)) {
51690 return quick;
51691 }
51692 return ts.forEachEntry(exports, function (exported) {
51693 if (getSymbolIfSameReference(exported, symbol)) {
51694 return exported;
51695 }
51696 });
51697 }
51698 /**
51699 * Checks if two symbols, through aliasing and/or merging, refer to the same thing
51700 */

Callers 3

getContainersOfSymbolFunction · 0.85
getSymbolChainFunction · 0.85

Calls 4

getParentOfSymbolFunction · 0.85
getSymbolIfSameReferenceFunction · 0.85
getExportsOfSymbolFunction · 0.85
getMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…