If the unwrapped value is Err, will map the error by calling the given errMapFn function.
errMapFn
const wrapper = await wrap<string, number>(Promise.reject('error')) wrapper.unwrapOrElse((e: string) => 1) // 1
Last updated 1 year ago