Home > @wixc3/common > mapKeys
Maps values of a plain object
Signature:
export declare function mapKeys<T extends object, R extends string>(obj: object, mapping: (key: keyof T, value?: T[keyof T]) => R): Record<R, T[keyof T]>;
| Parameter | Type | Description |
|---|---|---|
| obj | object | |
| mapping | (key: keyof T, value?: T\[keyof T\]) => R |
Returns:
Record<R, T[keyof T]>