From 573cd80b1cc9f757620d08764ee1f7d4380e1604 Mon Sep 17 00:00:00 2001 From: Eric Byers Date: Wed, 29 Apr 2015 12:24:00 -0500 Subject: [PATCH] Fixing formatting, using express.Request since it is now extended properly --- express-validator/express-validator-tests.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/express-validator/express-validator-tests.ts b/express-validator/express-validator-tests.ts index d6ae4addb..74bd277e4 100644 --- a/express-validator/express-validator-tests.ts +++ b/express-validator/express-validator-tests.ts @@ -9,7 +9,7 @@ var app = express(); app.use(expressValidator()); -app.post('/:urlparam', function(req: expressValidator.ValidatedRequest, res: express.Response) { +app.post('/:urlparam', function(req: express.Request, res: express.Response) { // checkBody only checks req.body; none of the other req parameters // Similarly checkParams only checks in req.params (URL params) and @@ -17,17 +17,17 @@ app.post('/:urlparam', function(req: expressValidator.ValidatedRequest, res: exp req.checkBody('postparam', 'Invalid postparam').notEmpty().isInt(); req.checkParams('urlparam', 'Invalid urlparam').isAlpha(); req.checkQuery('getparam', 'Invalid getparam').isInt(); - req.checkHeader('testHeader', 'Invalid testHeader').isLowercase().isUppercase(); - req.checkFiles('testFiles', 'Invalid testFiles').isUrl(); + req.checkHeader('testHeader', 'Invalid testHeader').isLowercase().isUppercase(); + req.checkFiles('testFiles', 'Invalid testFiles').isUrl(); - // OR assert can be used to check on all 3 types of params. + // OR assert can be used to check on all 3 types of params. // req.assert('postparam', 'Invalid postparam').notEmpty().isInt(); // req.assert('urlparam', 'Invalid urlparam').isAlpha(); // req.assert('getparam', 'Invalid getparam').isInt(); req.sanitize('postparam').toBoolean(); - req.filter('postparam').toBoolean(); + req.filter('postparam').toBoolean(); var errors = req.validationErrors(); var mappedErrors = req.validationErrors(true);