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

Function flatMapIterator

test/fixtures/snapshot/typescript.js:734–759  ·  view source on GitHub ↗
(iter, mapfn)

Source from the content-addressed store, hash-verified

732 }
733 ts.flatMapToMutable = flatMapToMutable;
734 function flatMapIterator(iter, mapfn) {
735 var first = iter.next();
736 if (first.done) {
737 return ts.emptyIterator;
738 }
739 var currentIter = getIterator(first.value);
740 return {
741 next: function () {
742 while (true) {
743 var currentRes = currentIter.next();
744 if (!currentRes.done) {
745 return currentRes;
746 }
747 var iterRes = iter.next();
748 if (iterRes.done) {
749 return iterRes;
750 }
751 currentIter = getIterator(iterRes.value);
752 }
753 },
754 };
755 function getIterator(x) {
756 var res = mapfn(x);
757 return res === undefined ? ts.emptyIterator : isArray(res) ? arrayIterator(res) : res;
758 }
759 }
760 ts.flatMapIterator = flatMapIterator;
761 function sameFlatMap(array, mapfn) {
762 var result;

Callers

nothing calls this directly

Calls 2

getIteratorFunction · 0.85
nextMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…