Function
toOption
(
self: Filter<A, Pass, Fail>
)
Source from the content-addressed store, hash-verified
| 810 | * @since 4.0.0 |
| 811 | */ |
| 812 | export const toOption = <A, Pass, Fail>( |
| 813 | self: Filter<A, Pass, Fail> |
| 814 | ): (input: A) => Option.Option<Pass> => |
| 815 | (input: A) => { |
| 816 | const result = self(input) |
| 817 | return Result.isFailure(result) ? Option.none() : Option.some(result.success) |
| 818 | } |
| 819 | |
| 820 | /** |
| 821 | * Converts a `Filter` into a function that returns the underlying |
Callers
nothing calls this directly
Tested by
no test coverage detected