|
Last change
on this file was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago |
|
Added visualizations
|
-
Property mode
set to
100644
|
|
File size:
669 bytes
|
| Line | |
|---|
| 1 | /**
|
|---|
| 2 | * Invokes the method at `path` of `object` with the given arguments.
|
|---|
| 3 | *
|
|---|
| 4 | * @param {any} object - The object to query.
|
|---|
| 5 | * @param {PropertyKey | PropertyKey[]} path - The path of the method to invoke.
|
|---|
| 6 | * @param {any[]} args - The arguments to invoke the method with.
|
|---|
| 7 | * @returns {any} - Returns the result of the invoked method.
|
|---|
| 8 | *
|
|---|
| 9 | * @example
|
|---|
| 10 | * const object = {
|
|---|
| 11 | * a: {
|
|---|
| 12 | * b: function (x, y) {
|
|---|
| 13 | * return x + y;
|
|---|
| 14 | * }
|
|---|
| 15 | * }
|
|---|
| 16 | * };
|
|---|
| 17 | *
|
|---|
| 18 | * invoke(object, 'a.b', [1, 2]); // => 3
|
|---|
| 19 | * invoke(object, ['a', 'b'], [1, 2]); // => 3
|
|---|
| 20 | */
|
|---|
| 21 | declare function invoke(object: any, path: PropertyKey | readonly PropertyKey[], ...args: any[]): any;
|
|---|
| 22 |
|
|---|
| 23 | export { invoke };
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.