@tsed/common
Version:
A TypeScript Framework on top of Express
22 lines • 604 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.UseValidation = void 0;
const ValidationPipe_1 = require("../../pipes/ValidationPipe");
const paramFn_1 = require("./paramFn");
/**
* Enable validation on the decoratored parameter.
*
* @decorator
* @operation
* @input
* @pipe
*/
function UseValidation() {
return paramFn_1.ParamFn((param) => {
if (param.type || param.collectionType) {
param.pipes.push(ValidationPipe_1.ValidationPipe);
}
});
}
exports.UseValidation = UseValidation;
//# sourceMappingURL=useValidation.js.map