bupkis
    Preparing search index...

    Type Alias NoNeverTuple<T>

    NoNeverTuple: T extends readonly [infer First, ...(infer Rest)]
        ? [First] extends [never]
            ? readonly [...NoNeverTuple<Rest>]
            : readonly [First, ...NoNeverTuple<Rest>]
        : readonly []

    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.

    Type Parameters

    • T extends readonly unknown[]

      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]