Skip to content

Commit

Permalink
Remove isKey use from invokeMap.
Browse files Browse the repository at this point in the history
  • Loading branch information
jdalton committed Nov 15, 2016
1 parent 058361e commit 014982c
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lodash.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
Expand Down

0 comments on commit 014982c

Please sign in to comment.