Skip to content

Bump ts-pattern from 4.3.0 to 5.7.0#44

Closed
dependabot[bot] wants to merge 1 commit intomainfrom
dependabot/npm_and_yarn/ts-pattern-5.7.0
Closed

Bump ts-pattern from 4.3.0 to 5.7.0#44
dependabot[bot] wants to merge 1 commit intomainfrom
dependabot/npm_and_yarn/ts-pattern-5.7.0

Conversation

@dependabot
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Apr 1, 2025

Bumps ts-pattern from 4.3.0 to 5.7.0.

Release notes

Sourced from ts-pattern's releases.

v5.7.0

New feature

Exhaustive callback

By default, .exhaustive() will throw an error if the input value wasn't handled by any .with(...) clause. This should only happen if your types are incorrect.

It is possible to pass your own handler function as a parameter to decide what should happen if an unexpected value has been received. You can for example throw your own custom error:

match(...)
  .with(...)
  .exhaustive((unexpected: unknown) => {
    throw MyCustomError(unexpected);
  })

Or log an error and return a default value:

match<string, number>(...)
  .with(P.string, (str) => str.length)
  .exhaustive((notAString: unknown) => {
    console.log(`received an unexpected value: ${notAString}`);
    return 0;
  })

Improved narrowing for isMatching

isMatching didn't have full feature parity with match in terms of type narrowing, but now does.

What's Changed

Full Changelog: gvergnaud/ts-pattern@v5.6.2...v5.7.0

v5.6.2

What's Changed

Full Changelog: gvergnaud/ts-pattern@v5.6.1...v5.6.2

v5.6.1

What's Changed

... (truncated)

Commits
  • 60af216 Merge pull request #253 from gvergnaud/gvergnaud/add-exhaustive-fallback-support
  • 890edfe 5.7.0
  • f58dc67 feat(.exhaustive): improve docstring
  • 1f8e197 feat(.exhaustive): fix docstrings
  • 03c1824 feat(exhaustive): Add doc
  • 47fb3dc feat(exhaustive): Improve comment
  • 88c6000 feat(exhaustive): Add support for passing a fallback function
  • 672b5ef Merge pull request #311 from gvergnaud/gvergnaud/improve-is-matching-predicate
  • d5d1bf2 isMatching: add narrowing unit test
  • f1af270 isMatching: improve narrowing
  • Additional commits viewable in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

@dependabot dependabot bot added dependencies Pull requests that update a dependency file javascript Pull requests that update javascript code labels Apr 1, 2025
@dependabot dependabot bot force-pushed the dependabot/npm_and_yarn/ts-pattern-5.7.0 branch from d0ee44a to 50f7b48 Compare April 15, 2025 09:27
Bumps [ts-pattern](https://github.com/gvergnaud/ts-pattern) from 4.3.0 to 5.7.0.
- [Release notes](https://github.com/gvergnaud/ts-pattern/releases)
- [Commits](gvergnaud/ts-pattern@v4.3.0...v5.7.0)

---
updated-dependencies:
- dependency-name: ts-pattern
  dependency-version: 5.7.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot force-pushed the dependabot/npm_and_yarn/ts-pattern-5.7.0 branch from 50f7b48 to f8ca07a Compare April 15, 2025 09:28
@dependabot @github
Copy link
Contributor Author

dependabot bot commented on behalf of github Jun 1, 2025

Superseded by #53.

@dependabot dependabot bot closed this Jun 1, 2025
@dependabot dependabot bot deleted the dependabot/npm_and_yarn/ts-pattern-5.7.0 branch June 1, 2025 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file javascript Pull requests that update javascript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants