diff options
author | Federico Brigante <github@bfred.it> | 2018-04-19 18:19:42 +0700 |
---|---|---|
committer | Federico Brigante <github@bfred.it> | 2018-04-19 18:41:47 +0700 |
commit | 37c467bba0dd92dae0f7e8530b36f3e08f54c5c4 (patch) | |
tree | 5c23fec7ae88946476cae2d7867ac9a5cdb1d308 /lib | |
parent | e3828896a165cb071da47f93bf6a82ae1ba730ab (diff) | |
download | async-37c467bba0dd92dae0f7e8530b36f3e08f54c5c4.tar.gz |
Drop _baseRange
Diffstat (limited to 'lib')
-rw-r--r-- | lib/internal/range.js | 7 | ||||
-rw-r--r-- | lib/timesLimit.js | 4 |
2 files changed, 9 insertions, 2 deletions
diff --git a/lib/internal/range.js b/lib/internal/range.js new file mode 100644 index 0000000..c9033e5 --- /dev/null +++ b/lib/internal/range.js @@ -0,0 +1,7 @@ +export default function range(size) { + var result = Array(size); + while (size--) { + result[size] = size; + } + return result; +} diff --git a/lib/timesLimit.js b/lib/timesLimit.js index 22be265..bb4a1fe 100644 --- a/lib/timesLimit.js +++ b/lib/timesLimit.js @@ -1,5 +1,5 @@ import mapLimit from './mapLimit'; -import range from 'lodash/_baseRange'; +import range from './internal/range'; import wrapAsync from './internal/wrapAsync'; /** @@ -20,5 +20,5 @@ import wrapAsync from './internal/wrapAsync'; */ export default function timeLimit(count, limit, iteratee, callback) { var _iteratee = wrapAsync(iteratee); - mapLimit(range(0, count, 1), limit, _iteratee, callback); + mapLimit(range(count), limit, _iteratee, callback); } |