evolve
Applies a spec of transformation functions to matching keys of an object, returning a new object. Keys not in the spec are copied as-is.
Usage
evolve<T extends Record<string, unknown>>(obj: T, spec: { [K in keyof T]?: (value: T[K]) => T[K] })
Applies a spec of transformation functions to matching keys of an object, returning a new object. Keys not in the spec are copied as-is.
Parameters
objTrequired
the source object.
spec{ [K in keyof T]?: (value: T[K]) => T[K] }required
the transformations keyed by property name.
Returns
a new object with matching transformations applied and all other properties preserved.