File tree Expand file tree Collapse file tree
packages/common/decorators/http Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -27,12 +27,13 @@ const assignCustomMetadata = (
2727} ) ;
2828
2929export type ParamDecoratorEnhancer = ParameterDecorator ;
30+
3031type Unpacked < T > = T extends ( infer U ) [ ]
3132 ? U
32- : T extends ( ...args : any [ ] ) => infer U
33- ? U
34- : T extends Promise < infer U >
35- ? U
33+ : T extends ( ...args : any [ ] ) => infer A
34+ ? A
35+ : T extends Promise < infer B >
36+ ? B
3637 : T ;
3738/**
3839 * Defines HTTP route param decorator
@@ -61,7 +62,7 @@ export function createParamDecorator<T>(
6162 isFunction ( pipe . transform ) ) ;
6263
6364 const hasParamData = isNil ( data ) || ! isPipe ( data ) ;
64- const paramData = hasParamData ? data : undefined ;
65+ const paramData = hasParamData ? ( data as any ) : undefined ;
6566 const paramPipes = hasParamData ? pipes : [ data , ...pipes ] ;
6667
6768 Reflect . defineMetadata (
You can’t perform that action at this time.
0 commit comments