From dc46b87abee1e441c07524ddde67fd902a919336 Mon Sep 17 00:00:00 2001 From: Kumar Damani Date: Tue, 16 Apr 2019 09:17:06 -0400 Subject: added some dependencies to package.json --- node_modules/express-validator/test/helpers/app.js | 45 ---------------------- 1 file changed, 45 deletions(-) delete mode 100644 node_modules/express-validator/test/helpers/app.js (limited to 'node_modules/express-validator/test/helpers/app.js') diff --git a/node_modules/express-validator/test/helpers/app.js b/node_modules/express-validator/test/helpers/app.js deleted file mode 100644 index d86a4bb..0000000 --- a/node_modules/express-validator/test/helpers/app.js +++ /dev/null @@ -1,45 +0,0 @@ -// Sample app -var express = require('express'); -var expressValidator = require('../../index'); -var bodyParser = require('body-parser'); - -var port = process.env.PORT || 8888; -var app = express(); - -// If no native implementation of Promise exists (less than Node v4), -// use Bluebird promises so we can test for both depending on the Node version -if (typeof Promise === 'undefined') { - Promise = require('bluebird'); -} - -module.exports = function(validation) { - - app.set('port', port); - app.use(bodyParser.json()); - app.use(expressValidator({ - customValidators: { - isArray: function(value) { - return Array.isArray(value); - }, - isAsyncTest: function(testparam) { - return new Promise(function(resolve, reject) { - setTimeout(function() { - if (testparam === '42') { return resolve(); } - reject(); - }, 200); - }); - } - }, - customSanitizers: { - toTestSanitize: function() { - return "!!!!"; - } - } - })); - - app.get(/\/test(\d+)/, validation); - app.get('/:testparam?', validation); - app.post('/:testparam?', validation); - - return app; -}; -- cgit v1.2.3