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

Function getGlobalTypeAliasSymbol

test/fixtures/snapshot/typescript.js:60657–60670  ·  view source on GitHub ↗
(name, arity, reportErrors)

Source from the content-addressed store, hash-verified

60655 return getGlobalSymbol(name, 788968 /* SymbolFlags.Type */, reportErrors ? ts.Diagnostics.Cannot_find_global_type_0 : undefined);
60656 }
60657 function getGlobalTypeAliasSymbol(name, arity, reportErrors) {
60658 var symbol = getGlobalSymbol(name, 788968 /* SymbolFlags.Type */, reportErrors ? ts.Diagnostics.Cannot_find_global_type_0 : undefined);
60659 if (symbol) {
60660 // Resolve the declared type of the symbol. This resolves type parameters for the type
60661 // alias so that we can check arity.
60662 getDeclaredTypeOfSymbol(symbol);
60663 if (ts.length(getSymbolLinks(symbol).typeParameters) !== arity) {
60664 var decl = symbol.declarations && ts.find(symbol.declarations, ts.isTypeAliasDeclaration);
60665 error(decl, ts.Diagnostics.Global_type_0_must_have_1_type_parameter_s, ts.symbolName(symbol), arity);
60666 return undefined;
60667 }
60668 }
60669 return symbol;
60670 }
60671 function getGlobalSymbol(name, meaning, diagnostic) {
60672 // Don't track references for global symbols anyway, so value if `isReference` is arbitrary
60673 return resolveName(undefined, name, meaning, diagnostic, name, /*isUse*/ false, /*excludeGlobals*/ false, /*getSpellingSuggestions*/ false);

Callers 3

getGlobalExtractSymbolFunction · 0.85
getGlobalOmitSymbolFunction · 0.85
getGlobalAwaitedSymbolFunction · 0.85

Calls 6

getGlobalSymbolFunction · 0.85
getDeclaredTypeOfSymbolFunction · 0.85
getSymbolLinksFunction · 0.85
errorFunction · 0.70
findMethod · 0.65
lengthMethod · 0.45

Tested by

no test coverage detected