Normalize emails for uniqueness validation. This will convert the email to lowercase, remove dots (.), and plus signs
followed by arbitrary strings (+foobar).
Based on normailize.
npm install --save normalize-emailvar normalizeEmail = require('normalize-email')
normalizeEmail('[email protected]') // => '[email protected]'
normalizeEmail('[email protected]') // => '[email protected]'
normalizeEmail('[email protected]') // => '[email protected]'
normalizeEmail('[email protected]') // => '[email protected]'
normalizeEmail('[email protected]') // => '[email protected]'Normalization rules vary by domain. The rules implemented by this package are:
- "plus" — remove first
+mark and anything after it - "dot" — remove all
.marks - "none" — do nothing
Emails are normalized by domain as follows:
gmail.com— plus and dotgooglemail.com(alias of gmail.com) — plus and dot- hotmail.com — plus only
- live.com — plus and dot
- outlook.com — plus only
- all other domains — none
MIT
- Fork it
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create new Pull Request
Crafted with <3 by John Otander (@4lpine).
This package was initially generated with yeoman and the p generator.
