mirror of
https://github.com/Expand-sys/ccashfrontend
synced 2025-12-19 16:12:14 +11:00
13 lines
No EOL
324 B
JavaScript
13 lines
No EOL
324 B
JavaScript
const REQ_KEY = '_validationCustomMethods';
|
|
|
|
module.exports = (req, options) => {
|
|
req[REQ_KEY] = req[REQ_KEY] || {
|
|
sanitizers: {},
|
|
validators: {}
|
|
};
|
|
|
|
Object.assign(req[REQ_KEY].validators, options.customValidators);
|
|
Object.assign(req[REQ_KEY].sanitizers, options.customSanitizers);
|
|
|
|
return req[REQ_KEY];
|
|
}; |