ensure method

Task<S, F> ensure({
  1. required bool check(
    1. S ok
    ),
  2. required F otherwise(
    1. S ok
    ),
})

Ensures that a success value satisfies a condition, otherwise converts it to a failure.

Implementation

Task<S, F> ensure({
  required bool Function(S ok) check,
  required F Function(S ok) otherwise,
}) => Task._(_task.ensure(check: check, otherwise: otherwise));