mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-03 16:47:49 +00:00
Apply arrow function transform.
This commit is contained in:
@@ -27,12 +27,12 @@ import isArrayLike from './isArrayLike.js';
|
||||
* _.invokeMap([123, 456], String.prototype.split, '');
|
||||
* // => [['1', '2', '3'], ['4', '5', '6']]
|
||||
*/
|
||||
var invokeMap = baseRest(function(collection, path, args) {
|
||||
var invokeMap = baseRest((collection, path, args) => {
|
||||
var index = -1,
|
||||
isFunc = typeof path == 'function',
|
||||
result = isArrayLike(collection) ? Array(collection.length) : [];
|
||||
|
||||
baseEach(collection, function(value) {
|
||||
baseEach(collection, value => {
|
||||
result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
|
||||
});
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user