Skip to content
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

Conversation

azlam-abdulsalam
Copy link
Contributor

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.

merge advice
ℹ️ 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.


  • The recommended version is 3 versions ahead of your current version.
  • The recommended version was released 7 months ago, on 2021-11-19.
Release notes
Package name: neverthrow
  • 4.3.1 - 2021-11-19

    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.

  • 4.3.0 - 2021-10-18

    Many thanks to @ sidhu663 for these great improvements to neverthrow.

    Significantly Improved Type Inference On andThen and orElse Methods

    With this release, you should not need to explicitly annotate the return type on the callbacks called into andThen and orElse.

    Example:

    Before

    const slotsResult = ok(123).andThen((value) =>
      value === '777'
        ? ok('Lucky Sevens')
        : err('Try Again')
    )

    Before, slotsResult would be of type Result<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 as Result<string, string>!

    If you're interested in how this works, check out the PR that implements these improvements here: #349

    Additional notes

    • This same improvement applies to .orElse
    • These improvements are for both Result and ResultAsync

    More Flexible unwrapOr Method

    The type signature of .unwrapOr has been "widened" to allow for returning something other than a type T as defined by the Result / ResultAsync you are calling unwrapOr on.

    This change was implemented in #350.

    Example:

    const result = err<number, string>('boom').unwrapOr(false)

    The above did not work prior to v4.3.0 because boolean (the false value) is not of type number.

    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 within unwrapOr.

    In the above example, result is now of type number | boolean.

  • 4.2.2 - 2021-07-01

    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 👏

  • 4.2.1 - 2021-03-20

    This release adds in-line docs for the Result variants. Now, when using a LSP-supported editor, you'll have docs as you hover a Result method.

    Thanks to @ Liam-Tait for the contribution!

from neverthrow GitHub release notes
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

@azlam-abdulsalam azlam-abdulsalam deleted the snyk-upgrade-050b0121de548b6fa935bfdf6d1930f3 branch June 15, 2022 11:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants