Skip to content

Type Alias: IfAny<T, TypeIfAny, TypeIfNotAny> ​

ts
type IfAny<T, TypeIfAny, TypeIfNotAny> =
  IsAny<T> extends true ? TypeIfAny : TypeIfNotAny;

An if-else-like type that resolves depending on whether the given type is any.

Type Parameters ​

Type ParameterDefault type
T-
TypeIfAnytrue
TypeIfNotAnyfalse

See ​

IsAny

Author ​

sindresorhus https://github.com/sindresorhus/type-fest