mapKeys
Import from @varavel/vdl-plugin-sdk/utils/objects.
Creates a new object with the same values as the given object, but with keys generated by running each own enumerable property of the object through the iteratee function.
Type Parameters
| Type Parameter | Description |
|---|---|
T extends Record\<PropertyKey, any> |
The type of the object. |
K extends PropertyKey |
The type of the new keys generated by the iteratee function. |
Parameters
| Parameter | Type | Description |
|---|---|---|
object |
T |
The object to iterate over. |
getNewKey |
(value, key, object) => K |
The function invoked per own enumerable property. |
Returns
Record\<K, T[keyof T]>
- Returns the new mapped object.