* Invokes the method at `path` on `object`. * * @private * @param {Object} object The object to query. * @param {Array|string} path The path of the method to invoke. * @param {Array} args The arguments to invoke the method with. * @returns {*} Returns the result of the
(object, path, args)
| 5600 | * @returns {*} Returns the result of the invoked method. |
| 5601 | */ |
| 5602 | function invokePath(object, path, args) { |
| 5603 | if (object != null && !isKey(path, object)) { |
| 5604 | path = toPath(path); |
| 5605 | object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1)); |
| 5606 | path = last(path); |
| 5607 | } |
| 5608 | var func = object == null ? object : object[path]; |
| 5609 | return func == null ? undefined : func.apply(object, args); |
| 5610 | } |
| 5611 | |
| 5612 | /** |
| 5613 | * Checks if `value` is a valid array-like index. |