routing-controllers
Version:
Create structured, declarative and beautifully organized class-based controllers with heavy decorators usage for Express / Koa using TypeScript.
23 lines • 782 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.UploadedFile = UploadedFile;
const index_1 = require("../index");
/**
* Injects an uploaded file object to the controller action parameter.
* Must be applied on a controller action parameter.
*/
function UploadedFile(name, options) {
return function (object, methodName, index) {
(0, index_1.getMetadataArgsStorage)().params.push({
type: 'file',
object: object,
method: methodName,
index: index,
name: name,
parse: false,
required: options ? options.required : undefined,
extraOptions: options ? options.options : undefined,
});
};
}
//# sourceMappingURL=UploadedFile.js.map
;