Consolidate invoke modules.

This commit is contained in:
John-David Dalton
2017-01-12 10:54:48 -08:00
parent 168322fda5
commit 563059c4b9
5 changed files with 25 additions and 42 deletions

View File

@@ -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;