// tracing: off
import * as Ex from "../../Exit"
import * as O from "../../Option"
import { collectWhileMap_ } from "./collectWhileMap"
/**
 * Terminates the stream when encountering the first `Exit.Failure`.
 */

export function collectWhileSuccess(self) {
  return collectWhileMap_(
    self,
    Ex.fold(
      (_) => O.none,
      (a) => O.some(a)
    )
  )
}
//# sourceMappingURL=collectWhileSuccess.js.map
