failure
failure<
T
>(f
):Failure
Converts the value to a Failure
. The function as as an identity function on a failure.
Example
failure("foobar")// => Error("foobar")
failure(new Error("foobar"))// => Error("foobar")
Type Parameters
• T
The value type.
Parameters
f
T
The value to create a Failure from.
Returns
The unpacked value.