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

Function instantiateReverseMappedType

test/fixtures/snapshot/typescript.js:63715–63729  ·  view source on GitHub ↗
(type, mapper)

Source from the content-addressed store, hash-verified

63713 return type;
63714 }
63715 function instantiateReverseMappedType(type, mapper) {
63716 var innerMappedType = instantiateType(type.mappedType, mapper);
63717 if (!(ts.getObjectFlags(innerMappedType) & 32 /* ObjectFlags.Mapped */)) {
63718 return type;
63719 }
63720 var innerIndexType = instantiateType(type.constraintType, mapper);
63721 if (!(innerIndexType.flags & 4194304 /* TypeFlags.Index */)) {
63722 return type;
63723 }
63724 var instantiated = inferTypeForHomomorphicMappedType(instantiateType(type.source, mapper), innerMappedType, innerIndexType);
63725 if (instantiated) {
63726 return instantiated;
63727 }
63728 return type; // Nested invocation of `inferTypeForHomomorphicMappedType` or the `source` instantiated into something unmappable
63729 }
63730 function getUniqueLiteralFilledInstantiation(type) {
63731 return type.flags & (131068 /* TypeFlags.Primitive */ | 3 /* TypeFlags.AnyOrUnknown */ | 131072 /* TypeFlags.Never */) ? type :
63732 type.uniqueLiteralFilledInstantiation || (type.uniqueLiteralFilledInstantiation = instantiateType(type, uniqueLiteralMapper));

Callers 1

instantiateTypeWorkerFunction · 0.85

Calls 2

instantiateTypeFunction · 0.85

Tested by

no test coverage detected