Skip to content

4425 - Greater Than #10827

@liuxing95

Description

@liuxing95
type Num2Array<T extends number, R extends any[] = []> =
  T extends R['length']
  ? R
  : Num2Array<T, [...R, any]>


type GreaterThan<T extends number, U extends number> = T extends U
  ? false
  : Num2Array<T> extends [...Num2Array<U> extends [...infer R] ? R : never, ...any]
  ? true
  : false

Metadata

Metadata

Assignees

No one assigned

    Labels

    4425answerShare answers/solutions to a questionenin English

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions