The type of the value being transformed.
The initial value to transform.
Transform functions to apply, which can be arbitrarily nested in arrays for organizational purposes. Nested arrays are flattened during execution.
The final transformed value after all transform functions have been applied.
// Pure transformations (returning new values)
const result = applyTransforms(
{ count: 1 },
(obj) => ({ ...obj, count: obj.count + 1 }),
(obj) => ({ ...obj, doubled: obj.count * 2 }),
);
// result: { count: 2, doubled: 4 }
// Impure transformations (modifying in-place)
const result = applyTransforms(
{ count: 1 },
(obj) => { obj.count += 1; },
(obj) => { obj.doubled = obj.count * 2; },
);
// result: { count: 2, doubled: 4 }
Applies a sequence of synchronous transform functions to a value.
Transform functions are applied sequentially in order. Each function can either:
undefined(impure transformation)