diff --git a/sanitizer/sanitizeAll.js b/sanitizer/sanitizeAll.js index 47861737..c21c78ff 100644 --- a/sanitizer/sanitizeAll.js +++ b/sanitizer/sanitizeAll.js @@ -1,3 +1,5 @@ +'use strict'; + const async = require('async'); function sanitize( req, sanitizers, cb ){ @@ -12,7 +14,7 @@ function sanitize( req, sanitizers, cb ){ // (in this case from the GET querystring params) const params = req.query || {}; - for (var s in sanitizers) { + for (let s in sanitizers) { var sanity = sanitizers[s].sanitize( params, req.clean ); // if errors occurred then set them @@ -37,11 +39,11 @@ function checkParameters(req, sanitizers, cb) { const params = req.query || {}; const goodParameters = {}; - for (var s in sanitizers) { + for (let s in sanitizers) { // checks if there is a function that returns valid params if (typeof sanitizers[s].expected === 'function'){ - /** func returns {array} ex: [{ name: 'text' }, { name: 'parsed_text' }] */ + /** func returns {array} ex: [{ name: 'text' }] */ for (let t in sanitizers[s].expected()) { /** {object} prop */ const prop = sanitizers[s].expected()[t]; diff --git a/test/unit/sanitizer/nearby.js b/test/unit/sanitizer/nearby.js index f816ea62..11ef459e 100644 --- a/test/unit/sanitizer/nearby.js +++ b/test/unit/sanitizer/nearby.js @@ -18,7 +18,7 @@ module.exports.tests = {}; module.exports.tests.interface = function(test, common) { test('sanitize interface', function(t) { t.equal(typeof sanitize, 'function', 'sanitize is a function'); - t.equal(sanitize.length, 3, 'sanitize interface takes one argument: req'); + t.equal(sanitize.length, 3, 'sanitize interface takes three args'); t.end(); }); test('middleware interface', function(t) { diff --git a/test/unit/sanitizer/place.js b/test/unit/sanitizer/place.js index ecbe295e..af3a9859 100644 --- a/test/unit/sanitizer/place.js +++ b/test/unit/sanitizer/place.js @@ -10,7 +10,7 @@ module.exports.tests = {}; module.exports.tests.interface = function(test, common) { test('sanitize interface', function(t) { t.equal(typeof sanitize, 'function', 'sanitize is a function'); - t.equal(sanitize.length, 3, 'sanitize interface takes one arg: req'); + t.equal(sanitize.length, 3, 'sanitize interface takes three args'); t.end(); }); test('middleware interface', function(t) {