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

Function getExportEqualsLocalSymbol

test/fixtures/snapshot/typescript.js:136709–136724  ·  view source on GitHub ↗
(importedSymbol, checker)

Source from the content-addressed store, hash-verified

136707 }
136708 FindAllReferences.getImportOrExportSymbol = getImportOrExportSymbol;
136709 function getExportEqualsLocalSymbol(importedSymbol, checker) {
136710 if (importedSymbol.flags & 2097152 /* SymbolFlags.Alias */) {
136711 return ts.Debug.checkDefined(checker.getImmediateAliasedSymbol(importedSymbol));
136712 }
136713 var decl = ts.Debug.checkDefined(importedSymbol.valueDeclaration);
136714 if (ts.isExportAssignment(decl)) { // `export = class {}`
136715 return ts.Debug.checkDefined(decl.expression.symbol);
136716 }
136717 else if (ts.isBinaryExpression(decl)) { // `module.exports = class {}`
136718 return ts.Debug.checkDefined(decl.right.symbol);
136719 }
136720 else if (ts.isSourceFile(decl)) { // json module
136721 return ts.Debug.checkDefined(decl.symbol);
136722 }
136723 return ts.Debug.fail();
136724 }
136725 // If a reference is a class expression, the exported node would be its parent.
136726 // If a reference is a variable declaration, the exported node would be the variable statement.
136727 function getExportNode(parent, node) {

Callers 1

getImportFunction · 0.85

Calls 1

failMethod · 0.45

Tested by

no test coverage detected