Package: effect
Module: Struct
Transforms the values of a Struct provided a transformation function for each key. If no transformation function is provided for a key, it will return the original value for that key.
Example
import * as assert from "node:assert"
import { pipe, Struct } from "effect"
assert.deepStrictEqual(
pipe(
{ a: 'a', b: 1, c: 3 },
Struct.evolve({
a: (a) => a.length,
b: (b) => b * 2
})
),
{ a: 1, b: 2, c: 3 }
)
Signature
declare const evolve: { <O, T>(t: PartialTransform<O, T>): (obj: O) => Transformed<O, T>; <O, T>(obj: O, t: PartialTransform<O, T>): Transformed<O, T>; }
Since v2.0.0