@newdash/newdash
Version:
javascript/typescript utility library
26 lines (25 loc) • 718 B
TypeScript
/**
* The opposite of `method` this method creates a function that invokes
* the method at a given path of `object`. Any additional arguments are
* provided to the invoked method.
*
* @since 5.12.0
* @category Util
* @param object The object to query.
* @param args The arguments to invoke the method with.
* @returns Returns the new invoker function.
* @example
*
* ```js
* const array = times(3, i => () => i)
* const object = { 'a': array, 'b': array, 'c': array }
*
* map(['a[2]', 'c[0]'], methodOf(object))
* // => [2, 0]
*
* map([['a', '2'], ['c', '0']], methodOf(object))
* // => [2, 0]
* ```
*/
export declare function methodOf(object: any, ...args: any[]): any;
export default methodOf;