tryToMaybe
Convert the Try
to a Maybe
, where Success
is converted to Just
, and
Failure
is converted to Nothing
.
Example
tryToMaybe("foobar")// => "foobar"
tryToMaybe(new Error("foobar"))// => Nothing
Type Parameters
• T extends unknown
The value type.
Parameters
x
T
The Try
to transform.