conditional-type-checks
conditional-type-checks copied to clipboard
Types for testing TypeScript types.
Hi, I can't make `IsExact` work with enums. ```ts const foo = 'Foo'; enum A { A1 = 'A1', A2 = 'A2', } export const t1 = [foo, ['A1']] as...
I have been trying to write an assertion that two types have an identical shape. They both contain a nested type. I can't figure out a way to check that...
Would be nice to tell when a type has a property. For example, I have some types that are missing a property in them that they should have so I...
```ts // before asserts(true) // after eq(true) ```
Because typescript doesn't support strict version of Extract for union types. (https://github.com/microsoft/TypeScript/issues/31474) How about add constraints to type parameters of `Has`? current behavior ```ts assert(true); // true. assert(true); // also...
`IsExact` returns `true` when the only difference between two interfaces is the `readonly` modifier. ```ts interface A { value: string; } interface B { readonly value: string; } assert(false); //...
I have been researching solutions for TS type testing such as this repo. It seems superior to other solutions since it exposes assertion types and not only assertion methods, keeping...