neverthrow
neverthrow copied to clipboard
Fix `map` and `mapErr` types
Fixes #616.
Currently functions map and mapErr cannot receive callbacks that return type A | Promise<B>, because the callback is expected to have return type A | Promise<A>.
This PR fixes this, basically changing function signatures from
<A,>(cb: () => A | Promise<A>): A
<A,>(cb: () => A): Awaited<A>