neverthrow
neverthrow copied to clipboard
Type-Safe Errors for JS & TypeScript
Hi, I've been enjoying neverthrow for a while now. Since I try to rely on type inference as much as possible, I used some version of the types added in...
When implementing a function returning a result, it's often that I need to construct an `Ok` object. However, it's not so ergonomic to do this. `ok` must be passed an...
### Pull Request Description #### Summary This PR introduces enhancements to the error handling mechanism within the codebase by allowing custom error messages to be specified. Additionally, it updates the...
Smaller version of #574
Currently it does not seem possible to handle both `Ok` and `Err` at the same time. Note that this behavior is different from `.andThen(...).orElse(...)` or `.orElse(...).andThen(...)` as the first of...
One of our use cases of `ResultAsync.combine` is to act as a `Promise.all` for several external API calls, which is great for combining multiple ResultAsyncs running in parallel. The array...
There's probably some good reason this hasn't been implemented, but sometimes I just want to know if something fired properly, no need to return a value. It seems ok() *has*...
This PR is related to the earlier #536 which proposed an implementation for an `andFinally` method that will be called regardless of whether an earlier step contained an error or...
Cherrypicked from #574