npm ts-pattern 4.0.6
v4.0.6

latest releases: 5.5.0, 5.4.0, 5.3.1...
2 years ago

Bug fixes

abstract class A {}

class B extends A {}

class C extends A {}

const object = new B() as B | C;

match(object)
    .with(P.instanceOf(A), a => ...) // a: B | C
     //                ^
     //     ✅ This type-checks now! 
    .exhaustive()

Don't miss a new ts-pattern release

NewReleases is sending notifications on new releases.