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

Function getLowerBoundOfKeyType

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

Source from the content-addressed store, hash-verified

58491 // bound includes those keys that are known to always be present, for example because
58492 // because of constraints on type parameters (e.g. 'keyof T' for a constrained T).
58493 function getLowerBoundOfKeyType(type) {
58494 if (type.flags & 4194304 /* TypeFlags.Index */) {
58495 var t = getApparentType(type.type);
58496 return isGenericTupleType(t) ? getKnownKeysOfTupleType(t) : getIndexType(t);
58497 }
58498 if (type.flags & 16777216 /* TypeFlags.Conditional */) {
58499 if (type.root.isDistributive) {
58500 var checkType = type.checkType;
58501 var constraint = getLowerBoundOfKeyType(checkType);
58502 if (constraint !== checkType) {
58503 return getConditionalTypeInstantiation(type, prependTypeMapping(type.root.checkType, constraint, type.mapper));
58504 }
58505 }
58506 return type;
58507 }
58508 if (type.flags & 1048576 /* TypeFlags.Union */) {
58509 return mapType(type, getLowerBoundOfKeyType);
58510 }
58511 if (type.flags & 2097152 /* TypeFlags.Intersection */) {
58512 return getIntersectionType(ts.sameMap(type.types, getLowerBoundOfKeyType));
58513 }
58514 return type;
58515 }
58516 function getIsLateCheckFlag(s) {
58517 return ts.getCheckFlags(s) & 4096 /* CheckFlags.Late */;
58518 }

Callers 2

resolveMappedTypeMembersFunction · 0.85

Calls 8

getApparentTypeFunction · 0.85
isGenericTupleTypeFunction · 0.85
getKnownKeysOfTupleTypeFunction · 0.85
getIndexTypeFunction · 0.85
prependTypeMappingFunction · 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…