| Name | Modified | Size | Downloads / Week |
|---|---|---|---|
| Parent folder | |||
| README.md | 2026-10-14 | 931 Bytes | |
| v5.9.2 source code.tar.gz | 2026-10-14 | 282.1 kB | |
| v5.9.2 source code.zip | 2026-10-14 | 323.1 kB | |
| Totals: 3 Items | 606.1 kB | 0 | |
Readable type errors
Type errors on invalid patterns now name the pattern type Pattern<...> instead of leaking internal types like KnownPatternInternal<string[], never, string[], never>.
:::ts
match(input).with({ type: 'alpha', id: { value: 1, items: 'gamma' } }, () => 1)
// 5.9.1: Type 'string' is not assignable to type 'KnownPatternInternal<string[], never, string[], never> | undefined'.
// 5.9.2: Type 'string' is not assignable to type 'Pattern<string[]> | undefined'.
Invalid 2-argument .with() calls still report "No overload matches this call" (TS2769), as in 5.9.1. Type checking also got a little faster: 3-4% fewer instantiations on the 5.9.1 benchmarks.
What's Changed
- fix(types): name the pattern type Pattern<...> in type errors by @gvergnaud in https://github.com/gvergnaud/ts-pattern/pull/384
Full Changelog: https://github.com/gvergnaud/ts-pattern/compare/v5.9.1...v5.9.2