Skip to content

Commit

Permalink
Expose a ParamName utility type
Browse files Browse the repository at this point in the history
  • Loading branch information
ezzatron committed Sep 4, 2021
1 parent 2965f21 commit 0233e1e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export interface Param<Name extends string, Arg = string> {
}

export type ParamArg<Subject extends AnyParam> = Subject extends Param<string, infer Arg> ? Arg : never
export type ParamName<Subject extends AnyParam> = Subject extends Param<infer Name, any> ? Name : never
export type ParamOrString = AnyParam | string

export interface PathPattern<Params extends AnyParams> {
Expand Down

0 comments on commit 0233e1e

Please sign in to comment.