Type Alias DropMatch<A, Criteria>

DropMatch: A["length"] extends 0
    ? A
    : A extends readonly [infer Head, ...(infer Tail)]
        ? Tail["length"] extends 0
            ? undefined extends Criteria
                ? ExcludeUnionOfEmptyTuple<Head extends Criteria ? [] : [Head]>
                : ExcludeUnionOfEmptyTuple<Head extends Criteria ? [] : [Head]>
            : Exclude<Head, Criteria> extends never
                ? TuplePlus.DropMatch<Tail, Criteria>
                : [Exclude<Head, Criteria>, ...TuplePlus.DropMatch<Tail, Criteria>]
        : never[]

Type Parameters

  • A extends Readonly<unknown[]>
  • Criteria