type R = IsArray<number[]> // true
type R = IsArray<[1]> // true
type R = IsArray<number> // false
🔢 customize
Filter to ensure T
is an array, otherwise returns never
.
type R = IsArray<number[], { selection: 'filter' }> // number[]
type R = IsArray<number, { selection: 'filter' }> // never
🔢 customize
Disable distribution of union types.
type R = IsArray<number[] | 1> // boolean
type R = IsArray<number[] | 1, { distributive: false }> // false
🔢 customize
Check if T
is exactly an array, excluding tuple.
🎭 predicate
Validate that
T
is an array.