Skip to content

isResultErr

Returns true for failed Result tuple

261 bytes

Usage

Check if a value is both a Result tuple and an Err result.

import * as _ from 'radashi'
declare const value: unknown
if (_.isResultErr(value)) {
value // <-- now an Err<Error> type
value[0] // <-- This is the error!
}

Also see the related isResult and isResultOk functions.