Returns a boolean for whether the given type is unknown.
unknown
https://github.com/dsherret/conditional-type-checks/pull/16
Useful in type utilities, such as when dealing with unknown data from API calls.
import type {IsUnknown} from 'type-fest';type A = IsUnknown<unknown>;//=> truetype B = IsUnknown<any>;//=> falsetype C = IsUnknown<never>;//=> falsetype D = IsUnknown<unknown[]>;//=> falsetype E = IsUnknown<object>;//=> falsetype F = IsUnknown<string>;//=> false Copy
import type {IsUnknown} from 'type-fest';type A = IsUnknown<unknown>;//=> truetype B = IsUnknown<any>;//=> falsetype C = IsUnknown<never>;//=> falsetype D = IsUnknown<unknown[]>;//=> falsetype E = IsUnknown<object>;//=> falsetype F = IsUnknown<string>;//=> false
Returns a boolean for whether the given type is
unknown.