type R = IsTuple<[], { selection: 'filter' }> // []
type R = IsTuple<[1], { selection: 'filter' }> // [1]
type R = IsTuple<never, { selection: 'filter' }> // never
type R = IsTuple<unknown, { selection: 'filter' }> // never
type R = IsTuple<[] | boolean, { selection: 'filter' }> // []
🔢 customize:
Disable distribution of union types.
type R = IsTuple<[1] | 1> // boolean
type R = IsTuple<[] | 1, { distributive: false }> // false
🔢 customize
Use unique branch identifiers to allow precise processing of the result.
🎭 predicate
Validate that
T
is a tuple, excluding array.🔢 customize
Filter to ensure
T
is atuple
, otherwise returnsnever
.