(candidate)
| 71118 | // the filtered type `{}`. For this reason we narrow constituents of the union individually, in addition to |
| 71119 | // filtering by type-facts. |
| 71120 | function narrowUnionMemberByTypeof(candidate) { |
| 71121 | return function (type) { |
| 71122 | if (isTypeSubtypeOf(type, candidate)) { |
| 71123 | return type; |
| 71124 | } |
| 71125 | if (isTypeSubtypeOf(candidate, type)) { |
| 71126 | return candidate; |
| 71127 | } |
| 71128 | if (type.flags & 465829888 /* TypeFlags.Instantiable */) { |
| 71129 | var constraint = getBaseConstraintOfType(type) || anyType; |
| 71130 | if (isTypeSubtypeOf(candidate, constraint)) { |
| 71131 | return getIntersectionType([type, candidate]); |
| 71132 | } |
| 71133 | } |
| 71134 | return type; |
| 71135 | }; |
| 71136 | } |
| 71137 | function narrowBySwitchOnTypeOf(type, switchStatement, clauseStart, clauseEnd) { |
| 71138 | var switchWitnesses = getSwitchClauseTypeOfWitnesses(switchStatement, /*retainDefault*/ true); |
| 71139 | if (!switchWitnesses.length) { |
no test coverage detected
searching dependent graphs…