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

Function getResolvedTypeParameterDefault

test/fixtures/snapshot/typescript.js:59064–59086  ·  view source on GitHub ↗
(typeParameter)

Source from the content-addressed store, hash-verified

59062 return type.resolvedApparentType || (type.resolvedApparentType = getTypeWithThisArgument(type, type, /*apparentType*/ true));
59063 }
59064 function getResolvedTypeParameterDefault(typeParameter) {
59065 if (!typeParameter.default) {
59066 if (typeParameter.target) {
59067 var targetDefault = getResolvedTypeParameterDefault(typeParameter.target);
59068 typeParameter.default = targetDefault ? instantiateType(targetDefault, typeParameter.mapper) : noConstraintType;
59069 }
59070 else {
59071 // To block recursion, set the initial value to the resolvingDefaultType.
59072 typeParameter.default = resolvingDefaultType;
59073 var defaultDeclaration = typeParameter.symbol && ts.forEach(typeParameter.symbol.declarations, function (decl) { return ts.isTypeParameterDeclaration(decl) && decl.default; });
59074 var defaultType = defaultDeclaration ? getTypeFromTypeNode(defaultDeclaration) : noConstraintType;
59075 if (typeParameter.default === resolvingDefaultType) {
59076 // If we have not been called recursively, set the correct default type.
59077 typeParameter.default = defaultType;
59078 }
59079 }
59080 }
59081 else if (typeParameter.default === resolvingDefaultType) {
59082 // If we are called recursively for this type parameter, mark the default as circular.
59083 typeParameter.default = circularConstraintType;
59084 }
59085 return typeParameter.default;
59086 }
59087 /**
59088 * Gets the default type for a type parameter.
59089 *

Callers 2

Calls 3

instantiateTypeFunction · 0.85
getTypeFromTypeNodeFunction · 0.85
forEachMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…