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

Function symbolCanBeReferencedAtTypeLocation

test/fixtures/snapshot/typescript.js:135464–135474  ·  view source on GitHub ↗

True if symbol is a type or a module containing at least one type.

(symbol, checker, seenModules)

Source from the content-addressed store, hash-verified

135462 ;
135463 /** True if symbol is a type or a module containing at least one type. */
135464 function symbolCanBeReferencedAtTypeLocation(symbol, checker, seenModules) {
135465 if (seenModules === void 0) { seenModules = new ts.Map(); }
135466 // Since an alias can be merged with a local declaration, we need to test both the alias and its target.
135467 // This code used to just test the result of `skipAlias`, but that would ignore any locally introduced meanings.
135468 return nonAliasCanBeReferencedAtTypeLocation(symbol) || nonAliasCanBeReferencedAtTypeLocation(ts.skipAlias(symbol.exportSymbol || symbol, checker));
135469 function nonAliasCanBeReferencedAtTypeLocation(symbol) {
135470 return !!(symbol.flags & 788968 /* SymbolFlags.Type */) || checker.isUnknownSymbol(symbol) ||
135471 !!(symbol.flags & 1536 /* SymbolFlags.Module */) && ts.addToSeen(seenModules, ts.getSymbolId(symbol)) &&
135472 checker.getExportsOfModule(symbol).some(function (e) { return symbolCanBeReferencedAtTypeLocation(e, checker, seenModules); });
135473 }
135474 }
135475 function isDeprecated(symbol, checker) {
135476 var declarations = ts.skipAlias(symbol, checker).declarations;
135477 return !!ts.length(declarations) && ts.every(declarations, ts.isDeprecatedDeclaration);

Callers 3

shouldIncludeSymbolFunction · 0.85
isValidTypeAccess_1Function · 0.85

Tested by

no test coverage detected