1 var baseInvoke = require('./internal/baseInvoke'),
2 rest = require('./rest');
5 * Creates a function that invokes the method at `path` of a given object.
6 * Any additional arguments are provided to the invoked method.
11 * @param {Array|string} path The path of the method to invoke.
12 * @param {...*} [args] The arguments to invoke the method with.
13 * @returns {Function} Returns the new function.
17 * { 'a': { 'b': { 'c': _.constant(2) } } },
18 * { 'a': { 'b': { 'c': _.constant(1) } } }
21 * _.map(objects, _.method('a.b.c'));
24 * _.invokeMap(_.sortBy(objects, _.method(['a', 'b', 'c'])), 'a.b.c');
27 var method = rest(function(path, args) {
28 return function(object) {
29 return baseInvoke(object, path, args);
33 module.exports = method;