Remove isKey use from invokeMap.

This commit is contained in:
John-David Dalton
2016-11-14 17:32:52 -08:00
parent 058361e222
commit 014982cb2c

View File

@@ -9476,12 +9476,10 @@
var invokeMap = baseRest(function(collection, path, args) {
var index = -1,
isFunc = typeof path == 'function',
isProp = isKey(path),
result = isArrayLike(collection) ? Array(collection.length) : [];
baseEach(collection, function(value) {
var func = isFunc ? path : ((isProp && value != null) ? value[path] : undefined);
result[++index] = func ? apply(func, value, args) : baseInvoke(value, path, args);
result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
});
return result;
});