MultiLoader-Template/node_modules/es-toolkit/dist/compat/util/invoke.d.ts
3944Realms 768f38fc97 feat: 可使用的构建模板
修改了脚本,使其可以推给Maven仓库
2026-05-03 13:02:19 +08:00

24 lines
669 B
TypeScript

/**
* Invokes the method at `path` of `object` with the given arguments.
*
* @param {any} object - The object to query.
* @param {PropertyKey | PropertyKey[]} path - The path of the method to invoke.
* @param {any[]} args - The arguments to invoke the method with.
* @returns {any} - Returns the result of the invoked method.
*
* @example
* const object = {
* a: {
* b: function (x, y) {
* return x + y;
* }
* }
* };
*
* invoke(object, 'a.b', [1, 2]); // => 3
* invoke(object, ['a', 'b'], [1, 2]); // => 3
*/
declare function invoke(object: any, path: PropertyKey | readonly PropertyKey[], ...args: any[]): any;
export { invoke };