traverse1984 / oxide.ts

Rust's Option<T> and Result<T, E>, implemented for TypeScript.
MIT License
509 stars 19 forks source link

I think there should be a API for unwrapping Results into tuples #10

Closed thelinuxlich closed 1 year ago

thelinuxlich commented 1 year ago

So it would be something like:

const [err, res] = val.unwrapTuple() // golang style
traverse1984 commented 1 year ago

I like the idea. Perhaps as intoTuple to fit with the current naming convention. I'll look to add this when I'm a little less busy, unless you want to make a PR.

thelinuxlich commented 1 year ago

yeah, intoTuple would be neat

traverse1984 commented 1 year ago

intoTuple has been added in 1.1.0, which has been published to npm. Enjoy!