feat(typescript-types): Add IsUnknown<T>

This commit is contained in:
T. R. Bernstein
2025-07-17 16:37:40 +02:00
parent 96cf6bbc48
commit 527250a98a
3 changed files with 22 additions and 0 deletions

View 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>
>