isErr
Type guard that narrows a Result to Err.
Usage
isErr(result)
The inverse of isOk. Useful when the failure path is the early-return: check isErr, bail, continue with the narrowed Ok after.
Parameters
resultResult<T>required
the result to test.
Returns
true if the result is a failure.
See also
isOk— the inverse guard- Result & Errors concept guide