Skip to content
This repository was archived by the owner on Jan 1, 2026. It is now read-only.

chore(deps): update dependency ts-pattern to ^5.7.0#686

Merged
renovate[bot] merged 1 commit into
0.7.xfrom
renovate/ts-pattern-5.x
Mar 28, 2025
Merged

chore(deps): update dependency ts-pattern to ^5.7.0#686
renovate[bot] merged 1 commit into
0.7.xfrom
renovate/ts-pattern-5.x

Conversation

@renovate
Copy link
Copy Markdown
Contributor

@renovate renovate Bot commented Mar 28, 2025

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
ts-pattern ^5.6.2 -> ^5.7.0 age adoption passing confidence

Release Notes

gvergnaud/ts-pattern (ts-pattern)

v5.7.0

Compare Source

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


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Enabled.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate Bot enabled auto-merge (squash) March 28, 2025 22:32
@renovate renovate Bot merged commit 1eec640 into 0.7.x Mar 28, 2025
5 checks passed
@renovate renovate Bot deleted the renovate/ts-pattern-5.x branch March 28, 2025 22:34
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.

0 participants