neverthrow
neverthrow copied to clipboard
Type-Safe Errors for JS & TypeScript
Fixes #631. With the previous example: ```ts (arr: Array) => arr.map(parseInt) ``` `parseInt` gets the indices as its second parameter for the base. Providing a callback where we pass the...
When using .andThrough() with a function that returns a Result, TypeScript reports a type mismatch, even though the function signature should be compatible. ## part of code ```ts ok({ title:...
Can you publish to [JSR](https://jsr.io/) so that hard-coded docs in README can be replaced by JSR's auto-generated API docs like [this](https://jsr.io/@std/assert/doc/~/assert) :)
I stumbled on a weird bug related to how NextJS treats the return values of cached functions. This not a bug with neverthrow, per se, but I wanted to get...
The eslint-plugin-neverthrow that you recommend in your docs is no longer maintained (or working with TypeScript). https://github.com/mdbetancourt/eslint-plugin-neverthrow/issues/19 The author states this as of 5 days ago here: https://github.com/mdbetancourt/eslint-plugin-neverthrow/issues/14 I would...
Especially for beginners that are not used to this concept. It is supposed to start easy and also explain the why? Also, no real world usage examples where it would...
Closes #608 It's not uncommon to write an async function with serial `await` because the second call depends on the first, where you're try/catch handlers return `ok()` or `err()` respectively....
Hi! I've been using neverthrow and it's been great! Really enjoying it. I would like to propose '_one more API_' 😆 : The main thing is that we have a...
- Migrate to tsdown, drop Rollup - Fix publint issues: https://publint.dev/[email protected] - Move faux ESM to real on Node.js.
Introduce a new instance method on Result and ResultAsync ``` unwrapOrElse(op: (err: E) => U): T | U ``` - Success (Ok): returns the contained T. - Failure (Err): calls...