1 | const REQ_KEY = '_validationCustomMethods';
|
2 |
|
3 | module.exports = (req, options) => {
|
4 | req[REQ_KEY] = req[REQ_KEY] || {
|
5 | sanitizers: {},
|
6 | validators: {}
|
7 | };
|
8 |
|
9 | Object.assign(req[REQ_KEY].validators, options.customValidators);
|
10 | Object.assign(req[REQ_KEY].sanitizers, options.customSanitizers);
|
11 |
|
12 | return req[REQ_KEY];
|
13 | }; |
\ | No newline at end of file |