Commit da11b95
stream: add forEach method
Add a `forEach` method to readable streams to enable concurrent
iteration and align with the iterator-helpers proposal.
Co-Authored-By: Robert Nagy <ronagy@icloud.com>
PR-URL: #41445
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>1 parent 8429216 commit da11b95Copy full SHA for da11b95
File tree
Expand file treeCollapse file tree
4 files changed
+182
-10
lines changedOpen diff view settings
Filter options
- doc/api
- lib
- internal/streams
- test/parallel
Expand file treeCollapse file tree
4 files changed
+182
-10
lines changedOpen diff view settings
Collapse file
+61-2Lines changed: 61 additions & 2 deletions
- Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1697 | 1697 | |
1698 | 1698 | |
1699 | 1699 | |
1700 | | - |
| 1700 | + |
1701 | 1701 | |
1702 | 1702 | |
1703 | 1703 | |
| ||
1741 | 1741 | |
1742 | 1742 | |
1743 | 1743 | |
1744 | | - |
| 1744 | + |
1745 | 1745 | |
1746 | 1746 | |
1747 | 1747 | |
| ||
1776 | 1776 | |
1777 | 1777 | |
1778 | 1778 | |
| 1779 | + |
| 1780 | + |
| 1781 | + |
| 1782 | + |
| 1783 | + |
| 1784 | + |
| 1785 | + |
| 1786 | + |
| 1787 | + |
| 1788 | + |
| 1789 | + |
| 1790 | + |
| 1791 | + |
| 1792 | + |
| 1793 | + |
| 1794 | + |
| 1795 | + |
| 1796 | + |
| 1797 | + |
| 1798 | + |
| 1799 | + |
| 1800 | + |
| 1801 | + |
| 1802 | + |
| 1803 | + |
| 1804 | + |
| 1805 | + |
| 1806 | + |
| 1807 | + |
| 1808 | + |
| 1809 | + |
| 1810 | + |
| 1811 | + |
| 1812 | + |
| 1813 | + |
| 1814 | + |
| 1815 | + |
| 1816 | + |
| 1817 | + |
| 1818 | + |
| 1819 | + |
| 1820 | + |
| 1821 | + |
| 1822 | + |
| 1823 | + |
| 1824 | + |
| 1825 | + |
| 1826 | + |
| 1827 | + |
| 1828 | + |
| 1829 | + |
| 1830 | + |
| 1831 | + |
| 1832 | + |
| 1833 | + |
| 1834 | + |
| 1835 | + |
| 1836 | + |
| 1837 | + |
1779 | 1838 | |
1780 | 1839 | |
1781 | 1840 | |
|
Collapse file
lib/internal/streams/operators.js
Copy file name to clipboardExpand all lines: lib/internal/streams/operators.js+23-5Lines changed: 23 additions & 5 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
23 | 23 | |
24 | 24 | |
25 | 25 | |
26 | | - |
| 26 | + |
27 | 27 | |
28 | 28 | |
29 | 29 | |
| ||
147 | 147 | |
148 | 148 | |
149 | 149 | |
| 150 | + |
| 151 | + |
| 152 | + |
| 153 | + |
| 154 | + |
| 155 | + |
| 156 | + |
| 157 | + |
| 158 | + |
| 159 | + |
| 160 | + |
| 161 | + |
| 162 | + |
150 | 163 | |
151 | 164 | |
152 | | - |
153 | | - |
| 165 | + |
| 166 | + |
154 | 167 | |
155 | 168 | |
156 | 169 | |
| ||
160 | 173 | |
161 | 174 | |
162 | 175 | |
163 | | - |
| 176 | + |
| 177 | + |
| 178 | + |
164 | 179 | |
165 | | - |
| 180 | + |
| 181 | + |
| 182 | + |
| 183 | + |
166 | 184 | |
Collapse file
+12-3Lines changed: 12 additions & 3 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
31 | 31 | |
32 | 32 | |
33 | 33 | |
34 | | - |
| 34 | + |
| 35 | + |
| 36 | + |
| 37 | + |
35 | 38 | |
36 | 39 | |
37 | 40 | |
| ||
46 | 49 | |
47 | 50 | |
48 | 51 | |
49 | | - |
50 | | - |
| 52 | + |
| 53 | + |
51 | 54 | |
52 | 55 | |
53 | 56 | |
54 | 57 | |
| 58 | + |
| 59 | + |
| 60 | + |
| 61 | + |
| 62 | + |
| 63 | + |
55 | 64 | |
56 | 65 | |
57 | 66 | |
|
Collapse file
test/parallel/test-stream-forEach.js
Copy file name to clipboard+86Lines changed: 86 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | + |
| 28 | + |
| 29 | + |
| 30 | + |
| 31 | + |
| 32 | + |
| 33 | + |
| 34 | + |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | + |
| 39 | + |
| 40 | + |
| 41 | + |
| 42 | + |
| 43 | + |
| 44 | + |
| 45 | + |
| 46 | + |
| 47 | + |
| 48 | + |
| 49 | + |
| 50 | + |
| 51 | + |
| 52 | + |
| 53 | + |
| 54 | + |
| 55 | + |
| 56 | + |
| 57 | + |
| 58 | + |
| 59 | + |
| 60 | + |
| 61 | + |
| 62 | + |
| 63 | + |
| 64 | + |
| 65 | + |
| 66 | + |
| 67 | + |
| 68 | + |
| 69 | + |
| 70 | + |
| 71 | + |
| 72 | + |
| 73 | + |
| 74 | + |
| 75 | + |
| 76 | + |
| 77 | + |
| 78 | + |
| 79 | + |
| 80 | + |
| 81 | + |
| 82 | + |
| 83 | + |
| 84 | + |
| 85 | + |
| 86 | + |
0 commit comments