🔨err

err is used to create an error Result type.

Usage

import {err} from 'unwrapit'

const v = err('error')
//    ^? Result<unknown, string>

You can specify the ok value type

const v = err<string, number>('error')
//    ^? Result<number, string>

Last updated