You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat: implement IsInhabited as a first-class type primitive #49
Implement as a first-class matcher. It returns true if T has at least one inhabiting value (i.e. is not never), and false otherwise.
This is the one primitive that neither expect-type nor tsd provides, and it addresses a real gap: testing that a type utility doesn't accidentally collapse everything to never.
Why
expect-type has IsNever but no inverse. IsInhabited is useful for:
Validating that a mapped type produces non-empty results
Testing that a conditional type doesn't collapse to never
Guarding against Extract<T, never> patterns that silently return never
Activity