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