Skip to content

Type inference improvements for all of the "combine" functions!

Compare
Choose a tag to compare
@supermacro supermacro released this 24 Oct 13:24
· 40 commits to master since this release

Thanks to @incetarik for fixing a long-lasting developer inconvenience! #226

Now, all of the "combine" functions can now infer types correctly and treat the list argument as a tuple rather than an unbounded list!

i.e. Rather than having to do:

Result.combine([ ok(123), err('whopps!') ] as const)

You can just omit the as const now:

Result.combine([ ok(123), err('whopps!') ])

And neverthrow can figure out the type of the above tuple on its own!