* Combines multiple `IterationTypes` records. * * If `array` is empty or all elements are missing or are references to `noIterationTypes`, * then `noIterationTypes` is returned. Otherwise, an `IterationTypes` record is returned * for the combined iteration types.
(array)
| 83123 | * for the combined iteration types. |
| 83124 | */ |
| 83125 | function combineIterationTypes(array) { |
| 83126 | var yieldTypes; |
| 83127 | var returnTypes; |
| 83128 | var nextTypes; |
| 83129 | for (var _i = 0, array_11 = array; _i < array_11.length; _i++) { |
| 83130 | var iterationTypes = array_11[_i]; |
| 83131 | if (iterationTypes === undefined || iterationTypes === noIterationTypes) { |
| 83132 | continue; |
| 83133 | } |
| 83134 | if (iterationTypes === anyIterationTypes) { |
| 83135 | return anyIterationTypes; |
| 83136 | } |
| 83137 | yieldTypes = ts.append(yieldTypes, iterationTypes.yieldType); |
| 83138 | returnTypes = ts.append(returnTypes, iterationTypes.returnType); |
| 83139 | nextTypes = ts.append(nextTypes, iterationTypes.nextType); |
| 83140 | } |
| 83141 | if (yieldTypes || returnTypes || nextTypes) { |
| 83142 | return createIterationTypes(yieldTypes && getUnionType(yieldTypes), returnTypes && getUnionType(returnTypes), nextTypes && getIntersectionType(nextTypes)); |
| 83143 | } |
| 83144 | return noIterationTypes; |
| 83145 | } |
| 83146 | function getCachedIterationTypes(type, cacheKey) { |
| 83147 | return type[cacheKey]; |
| 83148 | } |
no test coverage detected
searching dependent graphs…