mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-03 08:37:49 +00:00
Consolidate invoke modules.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import baseInvoke from './.internal/baseInvoke.js';
|
||||
import invoke from './invoke.js';
|
||||
|
||||
/**
|
||||
* Creates a function that invokes the method at `path` of a given object.
|
||||
@@ -7,7 +7,7 @@ import baseInvoke from './.internal/baseInvoke.js';
|
||||
* @since 3.7.0
|
||||
* @category Util
|
||||
* @param {Array|string} path The path of the method to invoke.
|
||||
* @param {...*} [args] The arguments to invoke the method with.
|
||||
* @param {Array} [args] The arguments to invoke the method with.
|
||||
* @returns {Function} Returns the new invoker function.
|
||||
* @example
|
||||
*
|
||||
@@ -22,8 +22,8 @@ import baseInvoke from './.internal/baseInvoke.js';
|
||||
* map(objects, method(['a', 'b']));
|
||||
* // => [2, 1]
|
||||
*/
|
||||
function method(path, ...args) {
|
||||
return object => baseInvoke(object, path, args);
|
||||
function method(path, args) {
|
||||
return object => invoke(object, path, args);
|
||||
}
|
||||
|
||||
export default method;
|
||||
|
||||
Reference in New Issue
Block a user