1 var baseInvoke = require('./_baseInvoke'),
2 baseRest = require('./_baseRest');
5 * Creates a function that invokes the method at `path` of a given object.
6 * Any additional arguments are provided to the invoked method.
12 * @param {Array|string} path The path of the method to invoke.
13 * @param {...*} [args] The arguments to invoke the method with.
14 * @returns {Function} Returns the new invoker function.
18 * { 'a': { 'b': _.constant(2) } },
19 * { 'a': { 'b': _.constant(1) } }
22 * _.map(objects, _.method('a.b'));
25 * _.map(objects, _.method(['a', 'b']));
28 var method = baseRest(function(path, args) {
29 return function(object) {
30 return baseInvoke(object, path, args);
34 module.exports = method;