title: Trim input values before express-validator in Node.Js
body: <p>I'm using the suggested V4 syntax of express-validator in a Node.js project:</p>
  
  <pre><code>const { check, validationResult } = require('express-validator/check');
  const { matchedData } = require('express-validator/filter');
  </code></pre>
  
  <p>and</p>
  
  <pre><code>app.post('/users/add/',[
  check('first_name')
  .isLength({ min: 1 }).withMessage('A first name is required')],
  (req, res, next) =&gt; {
    var errors = validationResult(req);
    if (errors) {
       ..etc
  </code></pre>
  
  <p>Note that I am using the modern syntax and do not have the following code (as 
  per the express-validator README.md file):</p>
  
  <pre><code>const expressValidator = require('express-validator');
  app.use(expressValidator());
  </code></pre>
  
  <p>How do I trim blank spaces from the input field before running the validation?</p>