summaryrefslogtreecommitdiff
path: root/tools/eslint/node_modules/lodash/invoke.js
blob: f090a7236739760e1efd9d158ac71954c4b54f99 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
var baseInvoke = require('./_baseInvoke'),
    rest = require('./rest');

/**
 * Invokes the method at `path` of `object`.
 *
 * @static
 * @memberOf _
 * @category Object
 * @param {Object} object The object to query.
 * @param {Array|string} path The path of the method to invoke.
 * @param {...*} [args] The arguments to invoke the method with.
 * @returns {*} Returns the result of the invoked method.
 * @example
 *
 * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
 *
 * _.invoke(object, 'a[0].b.c.slice', 1, 3);
 * // => [2, 3]
 */
var invoke = rest(baseInvoke);

module.exports = invoke;