File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change 1+ import { ParamOptions } from "../decorator-options/ParamOptions" ;
12import { getMetadataArgsStorage } from "../index" ;
23
34/**
45 * Injects all request's route parameters to the controller action parameter.
56 * Must be applied on a controller action parameter.
67 */
7- export function Params ( ) : Function {
8+ export function Params ( options ?: ParamOptions ) : Function {
89 return function ( object : Object , methodName : string , index : number ) {
910 getMetadataArgsStorage ( ) . params . push ( {
1011 type : "params" ,
1112 object : object ,
1213 method : methodName ,
1314 index : index ,
14- parse : false , // it does not make sense for Param to be parsed
15- required : false ,
16- classTransform : undefined
15+ parse : options ? options . parse : false ,
16+ required : options ? options . required : undefined ,
17+ classTransform : options ? options . transform : undefined ,
18+ explicitType : options ? options . type : undefined ,
19+ validate : options ? options . validate : undefined ,
1720 } ) ;
1821 } ;
19- }
22+ }
You can’t perform that action at this time.
0 commit comments