/** * Returns an effect whose failure and success channels have been mapped by * the specified pair of functions, `f` and `g`. * * @tsplus static effect/core/io/Effect.Aspects mapBoth * @tsplus pipeable effect/core/io/Effect mapBoth */ export function mapBoth( f: (e: E) => E2, g: (a: A) => A2 ) { return (self: Effect): Effect => self.foldEffect( (e) => Effect.failSync(f(e)), (a) => Effect.sync(g(a)) ) }