The readonly tuple type to filter
type WithNever = readonly [string, never, number, never];
type Filtered = NoNeverTuple<WithNever>; // readonly [string, number]
type Empty = NoNeverTuple<readonly [never, never]>; // readonly []
type Mixed = NoNeverTuple<readonly [boolean, never, string]>; // readonly [boolean, string]
Utility type that removes
never
entries from a tuple while preserving tuple structure.This recursive type filters out
never
types from tuple types, which can occur during type-level transformations. It maintains the readonly tuple structure while removing invalid entries.