- mapObjectWith<From, Source>(source): (<To>(transformation: ((x: Source[keyof Source]) => To)) => {
[K in string | number | symbol]: To
}) Type Parameters
- From
- Source extends Record<string, From>
Returns (<To>(transformation: ((x: Source[keyof Source]) => To)) => {
[K in string | number | symbol]: To
})
- <To>(transformation): {
[K in string | number | symbol]: To
} Returns {
[K in string | number | symbol]: To
}
Maps an object's values to a new set of values using a transformation function.
The type of the result is an object preserving the keys and inferring the type of each value based on the transformation function.
Example