]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - middlewares/reqValidators/utils.js
Infile code reorganization
[github/Chocobozzz/PeerTube.git] / middlewares / reqValidators / utils.js
index 5bc9f4f0b72c7492ab58678fb6cd3cbda549b805..c88f6df2e85125906b046ab01ec5e48edb9b7ac8 100644 (file)
@@ -2,11 +2,14 @@
   'use strict'
 
   var util = require('util')
+
   var logger = require('../../helpers/logger')
 
-  var utils = {}
+  var reqValidatorsUtils = {
+    checkErrors: checkErrors
+  }
 
-  utils.checkErrors = function (req, res, next, status_code) {
+  function checkErrors (req, res, next, status_code) {
     if (status_code === undefined) status_code = 400
     var errors = req.validationErrors()
 
@@ -18,5 +21,7 @@
     return next()
   }
 
-  module.exports = utils
+  // ---------------------------------------------------------------------------
+
+  module.exports = reqValidatorsUtils
 })()