@newdash/newdash
Version:
javascript/typescript utility library
21 lines (20 loc) • 543 B
TypeScript
/**
* Invokes the method at `path` of `object`.
*
* @since 5.7.0
* @category Object
* @param object The object to query.
* @param 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
*
* ```js
* const object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] }
*
* invoke(object, 'a[0].b.c.slice', [1, 3])
* // => [2, 3]
* ```
*/
export declare function invoke(object: any, path: any, ...args: any[]): any;
export default invoke;