summaryrefslogtreecommitdiff
path: root/lib/internal/map.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/internal/map.js')
-rw-r--r--lib/internal/map.js15
1 files changed, 4 insertions, 11 deletions
diff --git a/lib/internal/map.js b/lib/internal/map.js
index b587f59..2c2a750 100644
--- a/lib/internal/map.js
+++ b/lib/internal/map.js
@@ -1,23 +1,16 @@
-import isArrayLike from 'lodash/isArrayLike';
-import getIterator from './getIterator';
import noop from 'lodash/noop';
-import okeys from 'lodash/keys';
-import indexOf from 'lodash/_baseIndexOf';
import once from './once';
export default function _asyncMap(eachfn, arr, iteratee, callback) {
callback = once(callback || noop);
arr = arr || [];
var results = [];
- var keys;
- if (!isArrayLike(arr) && !getIterator(arr)) {
- keys = okeys(arr);
- }
+ var counter = 0;
- eachfn(arr, function (value, index, callback) {
+ eachfn(arr, function (value, _, callback) {
+ var index = counter++;
iteratee(value, function (err, v) {
- var idx = keys ? indexOf(keys, index, 0) : index;
- results[idx] = v;
+ results[index] = v;
callback(err);
});
}, function (err) {