Use an alternative value when an error occurs.
const wrapper = await wrap<string, number>(Promise.reject('error')) wrapper.unwrapOr(1) // 1
Last updated 1 year ago