(iter, mapfn)
| 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; |
nothing calls this directly
no test coverage detected
searching dependent graphs…