mirror of
https://github.com/Unleash/unleash.git
synced 2024-12-22 19:07:54 +01:00
5aa14262a2
* Use pretty (svg) badges * Fix build
16 lines
383 B
JavaScript
16 lines
383 B
JavaScript
'use strict';
|
|
const BPromise = require('bluebird');
|
|
const ValidationError = require('./ValidationError');
|
|
|
|
function validateRequest (req) {
|
|
return new BPromise((resolve, reject) => {
|
|
if (req.validationErrors()) {
|
|
reject(new ValidationError('Invalid syntax'));
|
|
} else {
|
|
resolve(req);
|
|
}
|
|
});
|
|
}
|
|
|
|
module.exports = validateRequest;
|