()
| 25019 | } |
| 25020 | |
| 25021 | function next() { |
| 25022 | const item = arr.shift(); |
| 25023 | const promise = promiseProducer(item); |
| 25024 | |
| 25025 | promise.then(function (result) { |
| 25026 | results.push(result); |
| 25027 | |
| 25028 | total--; |
| 25029 | if (total === 0) { |
| 25030 | resolve(results); |
| 25031 | } else { |
| 25032 | if (arr.length) { |
| 25033 | next(); |
| 25034 | } |
| 25035 | } |
| 25036 | }, reject); |
| 25037 | } |
| 25038 | }); |
| 25039 | } |
| 25040 |
no test coverage detected