validator.js icon indicating copy to clipboard operation
validator.js copied to clipboard

NormalizeEmail returns invalid data

Open schaitanya opened this issue 11 years ago • 2 comments

v = require 'validator'

v.isEmail '[email protected]'
true

v.normalizeEmail '[email protected]'
'@gmail.com'

schaitanya avatar Jan 23 '15 00:01 schaitanya

I don't think that's a valid Gmail address. Gmail strips the part after + when determining the destination mailbox, e.g. email to [email protected] and [email protected] both get delivered to me at [email protected].

chriso avatar Jan 23 '15 02:01 chriso

@chriso yes that isn't a valid address. But the problem here is, normalizeEmail is not working as intended. It is removing the local part altogether.

schaitanya avatar Jan 23 '15 02:01 schaitanya