Skip to content

5117 - 去除数组指定元素 #32097

Closed
Closed

Description

@PassionZale
type ToUnion<T> = T extends unknown[] ? T[number] : T;

type Without<T extends unknown[], U> = T extends [infer F, ...infer R]
  ? F extends ToUnion<U>
    ? Without<R, U>
    : [F, ...Without<R, U>]
  : T;

Activity

  1. added
    answer
    zh-CN
    on Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    5117answerzh-CN

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions