(objectType, indexType, writing)
| 62293 | } |
| 62294 | } |
| 62295 | function distributeObjectOverIndexType(objectType, indexType, writing) { |
| 62296 | // T[A | B] -> T[A] | T[B] (reading) |
| 62297 | // T[A | B] -> T[A] & T[B] (writing) |
| 62298 | if (indexType.flags & 1048576 /* TypeFlags.Union */) { |
| 62299 | var types = ts.map(indexType.types, function (t) { return getSimplifiedType(getIndexedAccessType(objectType, t), writing); }); |
| 62300 | return writing ? getIntersectionType(types) : getUnionType(types); |
| 62301 | } |
| 62302 | } |
| 62303 | // Transform an indexed access to a simpler form, if possible. Return the simpler form, or return |
| 62304 | // the type itself if no transformation is possible. The writing flag indicates that the type is |
| 62305 | // the target of an assignment. |
no test coverage detected
searching dependent graphs…