Skip to content

3196 - Flip Arguments #32082

Closed
Closed

Description

@PassionZale
type Reverse<T extends unknown[]> = T extends [infer F, ...infer R]
  ? [...Reverse<R>, F]
  : [];

type FlipArguments<T extends (...args: any[]) => any> = T extends (
  ...args: infer P
) => infer U
  ? (...args: Reverse<P>) => U
  : never;

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

    3196answerzh-CN

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions