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

Function skipExportSpecifierSymbol

test/fixtures/snapshot/typescript.js:136765–136785  ·  view source on GitHub ↗

If at an export specifier, go to the symbol it refers to.

(symbol, checker)

Source from the content-addressed store, hash-verified

136763 FindAllReferences.getExportInfo = getExportInfo;
136764 /** If at an export specifier, go to the symbol it refers to. */
136765 function skipExportSpecifierSymbol(symbol, checker) {
136766 // For `export { foo } from './bar", there's nothing to skip, because it does not create a new alias. But `export { foo } does.
136767 if (symbol.declarations) {
136768 for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {
136769 var declaration = _a[_i];
136770 if (ts.isExportSpecifier(declaration) && !declaration.propertyName && !declaration.parent.parent.moduleSpecifier) {
136771 return checker.getExportSpecifierLocalTargetSymbol(declaration);
136772 }
136773 else if (ts.isPropertyAccessExpression(declaration) && ts.isModuleExportsAccessExpression(declaration.expression) && !ts.isPrivateIdentifier(declaration.name)) {
136774 // Export of form 'module.exports.propName = expr';
136775 return checker.getSymbolAtLocation(declaration);
136776 }
136777 else if (ts.isShorthandPropertyAssignment(declaration)
136778 && ts.isBinaryExpression(declaration.parent.parent)
136779 && ts.getAssignmentDeclarationKind(declaration.parent.parent) === 2 /* AssignmentDeclarationKind.ModuleExports */) {
136780 return checker.getExportSpecifierLocalTargetSymbol(declaration.name);
136781 }
136782 }
136783 }
136784 return symbol;
136785 }
136786 function getContainingModuleSymbol(importer, checker) {
136787 return checker.getMergedSymbol(getSourceFileLikeForImportDeclaration(importer).symbol);
136788 }

Callers 1

getImportFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected