Skip to content

3188 - Tuple to Nested Object #32079

Closed
Closed

Description

@PassionZale
type TupleToNestedObject<T, U> = T extends [infer First, ...infer Rest]
  ? {
      [K in First extends string ? First : never]: TupleToNestedObject<Rest, U>;
    }
  : U;

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

    3188answerzh-CN

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions