Skip to content

build(deps): bump ts-pattern from 5.2.0 to 5.6.0#390

Merged
tpluscode merged 2 commits intomasterfrom
dependabot/npm_and_yarn/ts-pattern-5.6.0
Jan 14, 2025
Merged

build(deps): bump ts-pattern from 5.2.0 to 5.6.0#390
tpluscode merged 2 commits intomasterfrom
dependabot/npm_and_yarn/ts-pattern-5.6.0

Conversation

@dependabot
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Jan 13, 2025

Bumps ts-pattern from 5.2.0 to 5.6.0.

Release notes

Sourced from ts-pattern's releases.

v5.6.0

This release contains two changes:

Typecheck pattern when using isMatching with 2 parameter.

It used to be possible to pass a pattern than could never match to isMatching. The new version checks that the provide pattern does match the value in second parameter:

type Pizza = { type: 'pizza'; topping: string };
type Sandwich = { type: 'sandwich'; condiments: string[] };
type Food = Pizza | Sandwich;
const fn = (food: Pizza | Sandwich) => {
if (isMatching({ type: 'oops' }, food)) {
//                  👆 used to type-check, now doesn't!
}
}

Do not use P.infer as an inference point

When using P.infer<Pattern> to type a function argument, like in the following example:

const getWithDefault = <T extends P.Pattern>(
  input: unknown,
  pattern: T,
  defaultValue: P.infer<T> //  👈
): P.infer<T> =>
  isMatching(pattern, input) ? input : defaultValue

TypeScript could get confused and find type errors in the wrong spot:

const res = getWithDefault(null, { x: P.string }, 'oops') 
//                                     👆           👆 type error should be here
//                                 but it's here 😬

This new version fixes this problem.

What's Changed

Full Changelog: gvergnaud/ts-pattern@v5.5.0...v5.6.0

... (truncated)

Commits
  • d68fbcf 5.6.0
  • e35de42 fix: prevent NoInfer from showing up in display types
  • 514057f Merge pull request #289 from gvergnaud/dependabot/npm_and_yarn/rollup-2.79.2
  • ba71cf1 Merge pull request #302 from gvergnaud/P-infer-improvement
  • a009d89 feat(P.Pattern): support no type param
  • 16e2b2c feat(isMatching): Typecheck pattern when using isMatching wth 2 parameters
  • b6d791a feat(P.infer): Remove inference point
  • b5aa458 Remove lock files in examples
  • 94ee35d feat: Add jsr support
  • 1fed620 5.5.0
  • 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)

Bumps [ts-pattern](https://github.com/gvergnaud/ts-pattern) from 5.2.0 to 5.6.0.
- [Release notes](https://github.com/gvergnaud/ts-pattern/releases)
- [Commits](gvergnaud/ts-pattern@v5.2.0...v5.6.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot added the dependencies Pull requests that update a dependency file label Jan 13, 2025
@changeset-bot
Copy link

changeset-bot bot commented Jan 13, 2025

🦋 Changeset detected

Latest commit: 56c85f6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@hydrofoil/sparql-processor Patch
@hydrofoil/shape-to-query Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@tpluscode tpluscode merged commit afe19e7 into master Jan 14, 2025
11 checks passed
@tpluscode tpluscode deleted the dependabot/npm_and_yarn/ts-pattern-5.6.0 branch January 14, 2025 09:05
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant