(type)
| 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 | } |
no test coverage detected
searching dependent graphs…