Extends
There is the use-case of testing if only certain TS types cover a special type definition.
I need to ensure that only and only function cover the Fn
type. E.g. type Fn = any
would cover functions but also other types that are not intended to be expected. The existing type Equals
is unsuitable for testing if types are inside or outside of a domain (read: a set of valid types).
Introducing an Extends
type to tsafe would make it possible to assert that Fn
covers the types we intend to cover and to ensure that other types are not covered (as expected).
👇👇👇
By having the following unit tests, we would ensure that the Fn
type does not cover more types than expected.
Last updated