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

Function instantiateMappedTypeTemplate

test/fixtures/snapshot/typescript.js:63575–63582  ·  view source on GitHub ↗
(type, key, isOptional, mapper)

Source from the content-addressed store, hash-verified

63573 createTupleType(elementTypes, newTupleModifiers, newReadonly, tupleType.target.labeledElementDeclarations);
63574 }
63575 function instantiateMappedTypeTemplate(type, key, isOptional, mapper) {
63576 var templateMapper = appendTypeMapping(mapper, getTypeParameterFromMappedType(type), key);
63577 var propType = instantiateType(getTemplateTypeFromMappedType(type.target || type), templateMapper);
63578 var modifiers = getMappedTypeModifiers(type);
63579 return strictNullChecks && modifiers & 4 /* MappedTypeModifiers.IncludeOptional */ && !maybeTypeOfKind(propType, 32768 /* TypeFlags.Undefined */ | 16384 /* TypeFlags.Void */) ? getOptionalType(propType, /*isProperty*/ true) :
63580 strictNullChecks && modifiers & 8 /* MappedTypeModifiers.ExcludeOptional */ && isOptional ? getTypeWithFacts(propType, 524288 /* TypeFacts.NEUndefined */) :
63581 propType;
63582 }
63583 function instantiateAnonymousType(type, mapper, aliasSymbol, aliasTypeArguments) {
63584 var result = createObjectType(type.objectFlags | 64 /* ObjectFlags.Instantiated */, type.symbol);
63585 if (type.objectFlags & 32 /* ObjectFlags.Mapped */) {

Callers 2

Calls 8

appendTypeMappingFunction · 0.85
instantiateTypeFunction · 0.85
getMappedTypeModifiersFunction · 0.85
maybeTypeOfKindFunction · 0.85
getOptionalTypeFunction · 0.85
getTypeWithFactsFunction · 0.85

Tested by

no test coverage detected