routing-controllers
Version:
Create structured, declarative and beautifully organized class-based controllers with heavy decorators usage for Express / Koa using TypeScript.
24 lines • 891 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.Params = Params;
const index_1 = require("../index");
/**
* Injects all request's route parameters to the controller action parameter.
* Must be applied on a controller action parameter.
*/
function Params(options) {
return function (object, methodName, index) {
(0, index_1.getMetadataArgsStorage)().params.push({
type: 'params',
object: object,
method: methodName,
index: index,
parse: options ? options.parse : false,
required: options ? options.required : undefined,
classTransform: options ? options.transform : undefined,
explicitType: options ? options.type : undefined,
validate: options ? options.validate : undefined,
});
};
}
//# sourceMappingURL=Params.js.map
;