/** * Transforms the type of values that this differ knows how to differ using * the specified functions that map the new and old value types to each other. * * @tsplus static Differ.Aspects transform * @tsplus pipeable Differ transform */ export function transform(f: (value: Value) => Value2, g: (value: Value2) => Value) { return (self: Differ): Differ => Differ.make({ empty: self.empty, combine: (first, second) => self.combine(first, second), diff: (oldValue, newValue) => self.diff(g(oldValue), g(newValue)), patch: (patch, oldValue) => f(self.patch(patch, g(oldValue))) }) }