* Creates a failed `Result` containing the provided error. * * @param error - The error to wrap in a failed result. * @returns A `Result` instance with the error.
(error: E)
| 36 | * @returns A `Result` instance with the error. |
| 37 | */ |
| 38 | public static fail<E>(error: E): Result<never, E> { |
| 39 | return new Result<never, E>(false, undefined, error); |
| 40 | } |
| 41 | |
| 42 | /** |
| 43 | * Checks whether the result is successful. |