Skip to content

Type Alias: IfAny<T, Y, N> ​

ts
type IfAny<T, Y, N> = 0 extends 1 & T ? Y : N;

Conditional type that returns Y if T is any, otherwise returns N.

Type Parameters ​

Type ParameterDescription
TThe type to check
YThe type to return if T is any
NThe type to return if T is not any