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

Function getInstantiatedTypePart

test/fixtures/snapshot/typescript.js:77376–77406  ·  view source on GitHub ↗
(type)

Source from the content-addressed store, hash-verified

77374 }
77375 return result;
77376 function getInstantiatedTypePart(type) {
77377 if (type.flags & 524288 /* TypeFlags.Object */) {
77378 var resolved = resolveStructuredTypeMembers(type);
77379 var callSignatures = getInstantiatedSignatures(resolved.callSignatures);
77380 var constructSignatures = getInstantiatedSignatures(resolved.constructSignatures);
77381 hasSignatures || (hasSignatures = resolved.callSignatures.length !== 0 || resolved.constructSignatures.length !== 0);
77382 hasApplicableSignature || (hasApplicableSignature = callSignatures.length !== 0 || constructSignatures.length !== 0);
77383 if (callSignatures !== resolved.callSignatures || constructSignatures !== resolved.constructSignatures) {
77384 var result_11 = createAnonymousType(undefined, resolved.members, callSignatures, constructSignatures, resolved.indexInfos);
77385 result_11.objectFlags |= 8388608 /* ObjectFlags.InstantiationExpressionType */;
77386 result_11.node = node;
77387 return result_11;
77388 }
77389 }
77390 else if (type.flags & 58982400 /* TypeFlags.InstantiableNonPrimitive */) {
77391 var constraint = getBaseConstraintOfType(type);
77392 if (constraint) {
77393 var instantiated = getInstantiatedTypePart(constraint);
77394 if (instantiated !== constraint) {
77395 return instantiated;
77396 }
77397 }
77398 }
77399 else if (type.flags & 1048576 /* TypeFlags.Union */) {
77400 return mapType(type, getInstantiatedType);
77401 }
77402 else if (type.flags & 2097152 /* TypeFlags.Intersection */) {
77403 return getIntersectionType(ts.sameMap(type.types, getInstantiatedTypePart));
77404 }
77405 return type;
77406 }
77407 }
77408 function getInstantiatedSignatures(signatures) {
77409 var applicableSignatures = ts.filter(signatures, function (sig) { return !!sig.typeParameters && hasCorrectTypeArgumentArity(sig, typeArguments); });

Callers 1

getInstantiatedTypeFunction · 0.85

Calls 6

createAnonymousTypeFunction · 0.85
getBaseConstraintOfTypeFunction · 0.85
mapTypeFunction · 0.85
getIntersectionTypeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…