feat(typescript-types): Add IsNever<T>
This commit is contained in:
4
packages/typescript-types/src/is-never.ts
Normal file
4
packages/typescript-types/src/is-never.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
// See: https://github.com/microsoft/TypeScript/issues/31751#issuecomment-498526919
|
||||
// https://stackoverflow.com/questions/53984650/typescript-never-type-inconsistently-matched-in-conditional-type/53984913#53984913
|
||||
// https://www.zhenghao.io/posts/ts-never
|
||||
export type IsNever<T> = [T] extends [never] ? true : false
|
||||
Reference in New Issue
Block a user