This repository has been archived by the owner on Mar 18, 2024. It is now read-only.
[Snyk] Upgrade neverthrow from 4.2.1 to 4.3.1 #1024
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR was automatically created by Snyk using the credentials of a real user.
Snyk has created this PR to upgrade neverthrow from 4.2.1 to 4.3.1.
ℹ️ Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.
Release notes
Package name: neverthrow
User kieran-osgood submitted a fix for a long standing issue whereby proxies were suddenly disappearing within calls to
combine
:#228
This issue is now resolved!
Additionally, the docs have been updated to reference
eslint-plugin-neverthrow
.Many thanks to @ sidhu663 for these great improvements to
neverthrow
.Significantly Improved Type Inference On
andThen
andorElse
MethodsWith this release, you should not need to explicitly annotate the return type on the callbacks called into
andThen
andorElse
.Example:
Before
Before,
slotsResult
would be of typeResult<unknown, unknown>
.The "solution" was to explicitly annotate your callback function as returning
Result<string, string>
After
This exact piece of code above now types
slotsResult
asResult<string, string>
!If you're interested in how this works, check out the PR that implements these improvements here: #349
Additional notes
.orElse
Result
andResultAsync
More Flexible
unwrapOr
MethodThe type signature of
.unwrapOr
has been "widened" to allow for returning something other than a typeT
as defined by theResult
/ResultAsync
you are callingunwrapOr
on.This change was implemented in #350.
Example:
The above did not work prior to
v4.3.0
becauseboolean
(thefalse
value) is not of typenumber
.But now you are not constrained by this! As of
v4.3.0
you now have the ability to specify a value of any type withinunwrapOr
.In the above example, result is now of type
number | boolean
.Fixes #300
This PR updates the type definition of
Result.fromThrowable
in order to allow accepting functions that take 1 - n arguments.Thanks to @ universalhandle for the contribution 👏
This release adds in-line docs for the
Result
variants. Now, when using a LSP-supported editor, you'll have docs as you hover aResult
method.Thanks to @ Liam-Tait for the contribution!
Commit messages
Package name: neverthrow
Compare
Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs.
For more information:
🧐 View latest project report
🛠 Adjust upgrade PR settings
🔕 Ignore this dependency or unsubscribe from future upgrade PRs