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

Function getReferencedImportDeclaration

test/fixtures/snapshot/typescript.js:86819–86833  ·  view source on GitHub ↗
(nodeIn)

Source from the content-addressed store, hash-verified

86817 // When resolved as an expression identifier, if the given node references an import, return the declaration of
86818 // that import. Otherwise, return undefined.
86819 function getReferencedImportDeclaration(nodeIn) {
86820 if (nodeIn.generatedImportReference) {
86821 return nodeIn.generatedImportReference;
86822 }
86823 var node = ts.getParseTreeNode(nodeIn, ts.isIdentifier);
86824 if (node) {
86825 var symbol = getReferencedValueSymbol(node);
86826 // We should only get the declaration of an alias if there isn't a local value
86827 // declaration for the symbol
86828 if (isNonLocalAlias(symbol, /*excludes*/ 111551 /* SymbolFlags.Value */) && !getTypeOnlyAliasDeclaration(symbol)) {
86829 return getDeclarationOfAliasSymbol(symbol);
86830 }
86831 }
86832 return undefined;
86833 }
86834 function isSymbolOfDestructuredElementOfCatchBinding(symbol) {
86835 return symbol.valueDeclaration
86836 && ts.isBindingElement(symbol.valueDeclaration)

Callers

nothing calls this directly

Calls 4

getReferencedValueSymbolFunction · 0.85
isNonLocalAliasFunction · 0.85

Tested by

no test coverage detected