/** * Switches to the provided stream in case this one fails with the `None` * value. * * See also `Stream.catchAll`. * * @tsplus static effect/core/stream/Stream.Aspects orElseOptional * @tsplus pipeable effect/core/stream/Stream orElseOptional */ export function orElseOptional( that: LazyArg, A2>> ) { return (self: Stream, A>): Stream, A | A2> => self.catchAll((option) => option.fold(that, (e) => Stream.fail(Maybe.some(e)))) }