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

Function combineIterationTypes

test/fixtures/snapshot/typescript.js:83125–83145  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

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 }

Callers 2

Calls 4

createIterationTypesFunction · 0.85
getUnionTypeFunction · 0.85
getIntersectionTypeFunction · 0.85
appendMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…