🔨mapErr

If the unwrapped value is Err, will map the error by calling the given errMapFn function.

const wrapper = await wrap<string, number>(Promise.reject('error'))
wrapper.unwrapOrElse((e: string) => 1) // 1

Last updated