diff options
author | Federico Brigante <github@bfred.it> | 2018-04-19 17:49:57 +0700 |
---|---|---|
committer | Federico Brigante <github@bfred.it> | 2018-04-19 18:33:23 +0700 |
commit | 880cf15a0f8c61770d7f1e37689a736b7048f97f (patch) | |
tree | 8bb7aa0343f77514bf4f11dba3224351b7745166 /lib | |
parent | a58156a16eb6a7200e35c7056afd8f5b5a7882ba (diff) | |
download | async-880cf15a0f8c61770d7f1e37689a736b7048f97f.tar.gz |
Drop keys
Diffstat (limited to 'lib')
-rw-r--r-- | lib/auto.js | 4 | ||||
-rw-r--r-- | lib/internal/iterator.js | 3 |
2 files changed, 2 insertions, 5 deletions
diff --git a/lib/auto.js b/lib/auto.js index 8dbc56c..2938905 100644 --- a/lib/auto.js +++ b/lib/auto.js @@ -1,5 +1,4 @@ import indexOf from 'lodash/_baseIndexOf'; -import okeys from 'lodash/keys'; import noop from 'lodash/noop'; import forOwn from './internal/forOwn'; @@ -94,8 +93,7 @@ export default function (tasks, concurrency, callback) { concurrency = null; } callback = once(callback || noop); - var keys = okeys(tasks); - var numTasks = keys.length; + var numTasks = Object.keys(tasks).length; if (!numTasks) { return callback(null); } diff --git a/lib/internal/iterator.js b/lib/internal/iterator.js index d8a9a81..6098795 100644 --- a/lib/internal/iterator.js +++ b/lib/internal/iterator.js @@ -1,6 +1,5 @@ import isArrayLike from 'lodash.isarraylike'; import getIterator from './getIterator'; -import keys from 'lodash/keys'; function createArrayIterator(coll) { var i = -1; @@ -22,7 +21,7 @@ function createES2015Iterator(iterator) { } function createObjectIterator(obj) { - var okeys = keys(obj); + var okeys = obj ? Object.keys(obj) : []; var i = -1; var len = okeys.length; return function next() { |