Git Product home page Git Product logo

Comments (4)

dcarniel avatar dcarniel commented on May 18, 2024

I also have another corner case which I would expect be caught: [email protected]. is actually reported as correct if the typo check is disabled.
I would expect this to be caught by the regexp validation. It is very annoying as many modern browsers add a period when pressing space twice. I can easily trim the input but that won't remove the trailing dot.

from deep-email-validator.

mfbx9da4 avatar mfbx9da4 commented on May 18, 2024

Checking for spaces is beyond this

The philosophy of this lib is to be really light on validating the format of an email as that notoriously produces a lot of false alarms. Spaces are actually valid I believe in some cases, so I won't be adding that. If you want just regex I recommend validator.

The latter complaint is fair though. This lib should definitely validate that the email should not end with ..

const [domain] = split.slice(-1)
if (domain.indexOf('.') === -1) {
return 'Must contain a "." after the "@".'
}

Should add

   if (domain.endsWith('.')) {
      return 'Must not end with "."'
    }

from deep-email-validator.

dcarniel-evorra avatar dcarniel-evorra commented on May 18, 2024

I agree that you don't want to generate too many false alarms. Though I'd expect that spaces are only before or right after characters such as <> or "" that mark a readable name associated with the actual email.
There certainly should not be any spaces in the actual email part, though I must admit I'm not sure to put that together in a reliable RegExp ;).

from deep-email-validator.

conradkirschner avatar conradkirschner commented on May 18, 2024

I also have another corner case which I would expect be caught: [email protected]. is actually reported as correct if the typo check is disabled. I would expect this to be caught by the regexp validation. It is very annoying as many modern browsers add a period when pressing space twice. I can easily trim the input but that won't remove the trailing dot.

https://stackoverflow.com/a/49153802

Isn't is a valid domain? So email should also be valid in this case.

from deep-email-validator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.