/** * Apply `Either => B` in case self is right returning `Either`. * * @tsplus static Either.Aspects extend * @tsplus pipeable Either extend */ export function extend(f: (either: Either) => B) { return (self: Either): Either => self.isLeft() ? self : Either.right(f(self)) }