mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-06 00:07:44 +01:00
fb767f2b4a
* 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;
|