feat(typescript-types): Add IsUnknown<T>
This commit is contained in:
9
packages/typescript-types/src/is-unknown.ts
Normal file
9
packages/typescript-types/src/is-unknown.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import type { If } from './if.js'
|
||||
import type { IsAny } from './is-any.js'
|
||||
import type { IsNever } from './is-never.js'
|
||||
|
||||
export type IsUnknown<T> = If<
|
||||
IsAny<T>,
|
||||
false,
|
||||
If<IsNever<T>, false, T extends unknown ? (unknown extends T ? true : false) : false>
|
||||
>
|
||||
Reference in New Issue
Block a user