filterOrElse()
filterOrElse<
A,E>(predicate,onFalse): (self) =>Either<E,A>
Filters the Right value with a predicate, returning Left if it fails.
Type Parametersβ
A: Aβ
The success type.
E: Eβ
The error type.
Parametersβ
predicate: (a) => booleanβ
The predicate to test.
onFalse: (a) => Eβ
Function to create error when predicate fails.
Returnsβ
A function that filters the Either.
Sinceβ
2.0.0