p-map
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -18,4 +18,5 @@ 'use strict'; | ||
let resolvingCount = 0; | ||
let currentIdx = 0; | ||
const next = i => { | ||
const next = () => { | ||
if (isRejected) { | ||
@@ -26,2 +27,4 @@ return; | ||
const nextItem = iterator.next(); | ||
const i = currentIdx; | ||
currentIdx++; | ||
@@ -46,3 +49,3 @@ if (nextItem.done) { | ||
resolvingCount--; | ||
next(i + concurrency); | ||
next(); | ||
}, | ||
@@ -57,3 +60,3 @@ err => { | ||
for (let i = 0; i < concurrency; i++) { | ||
next(i); | ||
next(); | ||
@@ -60,0 +63,0 @@ if (iterableDone) { |
{ | ||
"name": "p-map", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Map over promises concurrently", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
5225
51