types-kit.isemptytypearray.md

September 4, 2023 ยท View on GitHub

Home > types-kit > IsEmptyTypeArray

IsEmptyTypeArray type

If T is a empty array, return true, else return false.

Signature:

export type IsEmptyTypeArray<T extends readonly unknown[]> = T extends T
  ? IsExtends<T['length'], 0>
  : never

References: IsExtends

Example

// Expect: true
type Foo = IsEmptyTypeArray<[]>

Contents

  1. 1IsEmptyTypeArray type
  2. 2Example