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

Function getTypeAliasInstantiation

test/fixtures/snapshot/typescript.js:60300–60313  ·  view source on GitHub ↗
(symbol, typeArguments, aliasSymbol, aliasTypeArguments)

Source from the content-addressed store, hash-verified

60298 return checkNoTypeArguments(node, symbol) ? type : errorType;
60299 }
60300 function getTypeAliasInstantiation(symbol, typeArguments, aliasSymbol, aliasTypeArguments) {
60301 var type = getDeclaredTypeOfSymbol(symbol);
60302 if (type === intrinsicMarkerType && intrinsicTypeKinds.has(symbol.escapedName) && typeArguments && typeArguments.length === 1) {
60303 return getStringMappingType(symbol, typeArguments[0]);
60304 }
60305 var links = getSymbolLinks(symbol);
60306 var typeParameters = links.typeParameters;
60307 var id = getTypeListId(typeArguments) + getAliasId(aliasSymbol, aliasTypeArguments);
60308 var instantiation = links.instantiations.get(id);
60309 if (!instantiation) {
60310 links.instantiations.set(id, instantiation = instantiateTypeWithAlias(type, createTypeMapper(typeParameters, fillMissingTypeArguments(typeArguments, typeParameters, getMinTypeArgumentCount(typeParameters), ts.isInJSFile(symbol.valueDeclaration))), aliasSymbol, aliasTypeArguments));
60311 }
60312 return instantiation;
60313 }
60314 /**
60315 * Get type from reference to type alias. When a type alias is generic, the declared type of the type alias may include
60316 * references to the type parameters of the alias. We replace those with the actual type arguments by instantiating the

Calls 12

getDeclaredTypeOfSymbolFunction · 0.85
getStringMappingTypeFunction · 0.85
getSymbolLinksFunction · 0.85
getTypeListIdFunction · 0.85
getAliasIdFunction · 0.85
instantiateTypeWithAliasFunction · 0.85
createTypeMapperFunction · 0.85
fillMissingTypeArgumentsFunction · 0.85
getMinTypeArgumentCountFunction · 0.85
hasMethod · 0.65
getMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…