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

Function skipPastExportOrImportSpecifierOrUnion

test/fixtures/snapshot/typescript.js:137682–137700  ·  view source on GitHub ↗

Handle a few special cases relating to export/import specifiers.

(symbol, node, checker, useLocalSymbolForExportSpecifier)

Source from the content-addressed store, hash-verified

137680 }
137681 /** Handle a few special cases relating to export/import specifiers. */
137682 function skipPastExportOrImportSpecifierOrUnion(symbol, node, checker, useLocalSymbolForExportSpecifier) {
137683 var parent = node.parent;
137684 if (ts.isExportSpecifier(parent) && useLocalSymbolForExportSpecifier) {
137685 return getLocalSymbolForExportSpecifier(node, symbol, parent, checker);
137686 }
137687 // If the symbol is declared as part of a declaration like `{ type: "a" } | { type: "b" }`, use the property on the union type to get more references.
137688 return ts.firstDefined(symbol.declarations, function (decl) {
137689 if (!decl.parent) {
137690 // Ignore UMD module and global merge
137691 if (symbol.flags & 33554432 /* SymbolFlags.Transient */)
137692 return undefined;
137693 // Assertions for GH#21814. We should be handling SourceFile symbols in `getReferencedSymbolsForModule` instead of getting here.
137694 ts.Debug.fail("Unexpected symbol at ".concat(ts.Debug.formatSyntaxKind(node.kind), ": ").concat(ts.Debug.formatSymbol(symbol)));
137695 }
137696 return ts.isTypeLiteralNode(decl.parent) && ts.isUnionTypeNode(decl.parent.parent)
137697 ? checker.getPropertyOfType(checker.getTypeFromTypeNode(decl.parent.parent), symbol.name)
137698 : undefined;
137699 });
137700 }
137701 var SpecialSearchKind;
137702 (function (SpecialSearchKind) {
137703 SpecialSearchKind[SpecialSearchKind["None"] = 0] = "None";

Callers 1

Calls 3

concatMethod · 0.80
failMethod · 0.45

Tested by

no test coverage detected