| 1 | import { ListIteratee } from '../_internal/ListIteratee.js';
|
|---|
| 2 | import { ObjectIteratee } from '../_internal/ObjectIteratee.js';
|
|---|
| 3 |
|
|---|
| 4 | /**
|
|---|
| 5 | * Creates an object with the same values as `object` and keys generated by running each own enumerable string keyed property through `iteratee`.
|
|---|
| 6 | *
|
|---|
| 7 | * @template T
|
|---|
| 8 | * @param {ArrayLike<T> | null | undefined} object - The object to iterate over.
|
|---|
| 9 | * @param {ValueIteratee<T>} [iteratee] - The function invoked per iteration.
|
|---|
| 10 | * @returns {Record<string, T>} - Returns the new mapped object.
|
|---|
| 11 | *
|
|---|
| 12 | * @example
|
|---|
| 13 | * mapKeys([1, 2, 3], (value, index) => `key${index}`);
|
|---|
| 14 | * // => { 'key0': 1, 'key1': 2, 'key2': 3 }
|
|---|
| 15 | */
|
|---|
| 16 | declare function mapKeys<T>(object: ArrayLike<T> | null | undefined, iteratee?: ListIteratee<T>): Record<string, T>;
|
|---|
| 17 | /**
|
|---|
| 18 | * Creates an object with the same values as `object` and keys generated by running each own enumerable string keyed property through `iteratee`.
|
|---|
| 19 | *
|
|---|
| 20 | * @template T
|
|---|
| 21 | * @param {T | null | undefined} object - The object to iterate over.
|
|---|
| 22 | * @param {ValueIteratee<T[keyof T]>} [iteratee] - The function invoked per iteration.
|
|---|
| 23 | * @returns {Record<string, T[keyof T]>} - Returns the new mapped object.
|
|---|
| 24 | *
|
|---|
| 25 | * @example
|
|---|
| 26 | * mapKeys({ a: 1, b: 2 }, (value, key) => key + value);
|
|---|
| 27 | * // => { 'a1': 1, 'b2': 2 }
|
|---|
| 28 | */
|
|---|
| 29 | declare function mapKeys<T extends object>(object: T | null | undefined, iteratee?: ObjectIteratee<T>): Record<string, T[keyof T]>;
|
|---|
| 30 |
|
|---|
| 31 | export { mapKeys };
|
|---|