Convenient assertions for typelevel programming.
npm install typelevel-assert




<TypeLevel> Assert provides convenient assertions for type-level programming.
Installation
``sh`
npm i -D typelevel-assert
Start to code (try it out)
`ts
import { assertType, Is } from 'typelevel-assert';
type Hi;
assertType
`
The assertType assertion accepts a type parameter T.
* ✅ The compiler succeeds, if T is trueT
* ❌ The compiler fails, if is not true
<TypeLevel> Assert has the following built-in type predicates that can be used with assertType:
| type | description |
| --- | --- |
| And | true if both C1 and C2 are true, false otherwise |Or
| | true if any of C1 or C2 is true, false otherwise |Not
| | true if C is false, true otherwise |Equals
| | And |Extends
| | syntactic sugar for [T1] extends [T2] ? true : false |Is
| | true if T1 is exactly T2`, false otherwise |