Validator.js: `remove_dots: false` still removes the dots

Created on 2 Mar 2017  路  4Comments  路  Source: validatorjs/validator.js

I am using the latest version [email protected] with node v6.10.0 (npm v3.10.10).
My package.json

{
  "name": "hackathon-starter",
  "version": "4.3.0",
  "description": "A boilerplate for Node.js web applications",
  "repository": {
    "type": "git",
    "url": "https://github.com/sahat/hackathon-starter.git"
  },
  "author": "Sahat Yalkabov",
  "license": "MIT",
  "scripts": {
    "start": "node app.js",
    "test": "mocha --reporter spec"
  },
  "dependencies": {
    "async": "^2.1.2",
    "bcrypt-nodejs": "^0.0.3",
    "body-parser": "^1.15.2",
    "chalk": "^1.1.3",
    "cheerio": "^0.22.0",
    "clockwork": "^0.1.4",
    "compression": "^1.6.2",
    "connect-mongo": "^1.3.2",
    "dotenv": "^2.0.0",
    "errorhandler": "^1.4.3",
    "express": "^4.14.0",
    "express-flash": "^0.0.2",
    "express-session": "^1.14.2",
    "express-status-monitor": "^0.1.5",
    "express-validator": "^3.1.2",
    "fbgraph": "^1.3.0",
    "github": "^7.2.0",
    "instagram-node": "^0.5.8",
    "lastfm": "^0.9.2",
    "lob": "^3.9.0",
    "lodash": "^4.16.6",
    "lusca": "^1.4.1",
    "mongoose": "^4.6.6",
    "morgan": "^1.7.0",
    "multer": "^1.2.0",
    "node-foursquare": "^0.3.0",
    "node-linkedin": "^0.5.4",
    "node-sass-middleware": "^0.10.0",
    "nodemailer": "^2.6.4",
    "passport": "0.3.2",
    "passport-facebook": "^2.1.1",
    "passport-github": "^1.1.0",
    "passport-google-oauth": "^1.0.0",
    "passport-instagram": "^1.0.0",
    "passport-linkedin-oauth2": "^1.4.1",
    "passport-local": "^1.0.0",
    "passport-oauth": "^1.0.0",
    "passport-openid": "^0.4.0",
    "passport-twitter": "^1.0.4",
    "paypal-rest-sdk": "^1.7.0",
    "pug": "^2.0.0-beta6",
    "request": "^2.78.0",
    "stripe": "^4.12.0",
    "tumblr.js": "^1.1.1",
    "twilio": "^3.3.1-edge",
    "twit": "^2.2.5",
    "validator": "^6.1.0"
  },
  "devDependencies": {
    "chai": "^3.5.0",
    "eslint": "^3.9.1",
    "eslint-config-airbnb-base": "^11.0.0",
    "eslint-plugin-import": "^2.1.0",
    "mocha": "^3.1.2",
    "nodemon": "^1.11.0",
    "proxyquire": "^1.7.11",
    "rewire": "^2.5.2",
    "sinon": "^1.17.6",
    "sinon-mongoose": "^1.3.0",
    "supertest": "^2.0.1"
  },
  "eslintConfig": {
    "extends": "airbnb-base",
    "rules": {
      "comma-dangle": 0,
      "consistent-return": 0,
      "no-param-reassign": 0,
      "no-underscore-dangle": 0,
      "no-shadow": 0,
      "no-console": 0,
      "no-plusplus": 0
    }
  }
}
console.log('req.body.email', req.body.email); // req.body.email [email protected]
req.sanitize('email').normalizeEmail({ remove_dots: false });
console.log('req.body.email', req.body.email); // req.body.email [email protected]

Most helpful comment

It looks like express-validator is the repo that you're after.

All 4 comments

Option should be gmail_remove_dots, not remove_dots.

Cool cheers, should update the docs

FYI the README shows gmail_remove_dots:

gmail_remove_dots: true: Removes dots from the local part of the email address, as GMail ignores them (e.g. "john.doe" and "johndoe" are considered equal).

It looks like express-validator is the repo that you're after.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MindRapist picture MindRapist  路  4Comments

karladler picture karladler  路  3Comments

malkhuzayyim picture malkhuzayyim  路  4Comments

AtomicBorg picture AtomicBorg  路  3Comments

mren picture mren  路  3Comments