| [a762898] | 1 | /**
|
|---|
| 2 | * Invokes the method at path of each element in collection.
|
|---|
| 3 | *
|
|---|
| 4 | * @param {object | null | undefined} collection - The collection to iterate over.
|
|---|
| 5 | * @param {string} methodName - The name of the method to invoke.
|
|---|
| 6 | * @param {...any[]} args - The arguments to invoke each method with.
|
|---|
| 7 | * @returns {any[]} Returns the array of results.
|
|---|
| 8 | *
|
|---|
| 9 | * @example
|
|---|
| 10 | * invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
|
|---|
| 11 | * // => [[1, 5, 7], [1, 2, 3]]
|
|---|
| 12 | *
|
|---|
| 13 | * invokeMap([123, 456], 'toString', 2);
|
|---|
| 14 | * // => ['1111011', '111001000']
|
|---|
| 15 | */
|
|---|
| 16 | declare function invokeMap(collection: object | null | undefined, methodName: string, ...args: any[]): any[];
|
|---|
| 17 | /**
|
|---|
| 18 | * Invokes the method at path of each element in collection.
|
|---|
| 19 | *
|
|---|
| 20 | * @template R
|
|---|
| 21 | * @param {object | null | undefined} collection - The collection to iterate over.
|
|---|
| 22 | * @param {(...args: any[]) => R} method - The method to invoke.
|
|---|
| 23 | * @param {...any[]} args - The arguments to invoke each method with.
|
|---|
| 24 | * @returns {R[]} Returns the array of results.
|
|---|
| 25 | *
|
|---|
| 26 | * @example
|
|---|
| 27 | * invokeMap([5, 1, 7], Array.prototype.slice, 1);
|
|---|
| 28 | * // => [[], [], []]
|
|---|
| 29 | */
|
|---|
| 30 | declare function invokeMap<R>(collection: object | null | undefined, method: (...args: any[]) => R, ...args: any[]): R[];
|
|---|
| 31 |
|
|---|
| 32 | export { invokeMap };
|
|---|