Skip to content

Commit

Permalink
Shorten NormalizeParam type definition
Browse files Browse the repository at this point in the history
  • Loading branch information
ezzatron committed Sep 4, 2021
1 parent 73a2bcb commit 2965f21
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ export function normalizeParam<P extends ParamOrString> (p: P): NormalizeParam<P
return p as NormalizeParam<P>
}

export type NormalizeParam<NameOrParam extends ParamOrString> = NameOrParam extends string
? Param<NameOrParam>
: Cast<NameOrParam, AnyParam>
export type NormalizeParam<P extends ParamOrString> = P extends string ? Param<P> : Cast<P, AnyParam>

export interface Param<Name extends string, Arg = string> {
readonly name: Name
Expand Down

0 comments on commit 2965f21

Please sign in to comment.