source: imaps-frontend/node_modules/lodash-es/_baseInvoke.js

main
Last change on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 787 bytes
Line 
1import apply from './_apply.js';
2import castPath from './_castPath.js';
3import last from './last.js';
4import parent from './_parent.js';
5import toKey from './_toKey.js';
6
7/**
8 * The base implementation of `_.invoke` without support for individual
9 * method arguments.
10 *
11 * @private
12 * @param {Object} object The object to query.
13 * @param {Array|string} path The path of the method to invoke.
14 * @param {Array} args The arguments to invoke the method with.
15 * @returns {*} Returns the result of the invoked method.
16 */
17function baseInvoke(object, path, args) {
18 path = castPath(path, object);
19 object = parent(object, path);
20 var func = object == null ? object : object[toKey(last(path))];
21 return func == null ? undefined : apply(func, object, args);
22}
23
24export default baseInvoke;
Note: See TracBrowser for help on using the repository browser.