这是indexloc提供的服务,不要输入任何密码
Skip to content

9616 - Parse URL Params #37710

@rauf322

Description

@rauf322
type ParseUrlParams<S, Arr extends unknown[] = []> = Union<S extends `${infer First}:${infer Rest}`
  ? Rest extends `${infer NestedFirst}/:${infer SecondNested}`
    ? ParseUrlParams<`/:${SecondNested}`, [...Arr, NestedFirst]>
    : Rest extends `${infer LastValidation}/${infer _}`
      ? [...Arr, LastValidation]
      : [...Arr, Rest]
  : Arr>

Metadata

Metadata

Assignees

No one assigned

    Labels

    9616answerShare 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