email-spell-checker icon indicating copy to clipboard operation
email-spell-checker copied to clipboard

invalid emails like "test" return the same result "undefined" like a valid email

Open itinance opened this issue 1 year ago • 1 comments
trafficstars

Current Behavior

input: "test" output: "undefined"

input: "[email protected]" output: undefined

input "test@gmai" output: undefined

input "test@gmail" output: {... [email protected]}

Is this behaviour intended?

Expected Behavior

input: "test" output: false

input: "[email protected]" output: true

input "test@gmai" output: false

input "test@gmail" output: {... [email protected]}

Steps to Reproduce the Problem

const suggestion = emailSpellChecker.run({ email })

Environment

  • Version: 1.12
  • Platform: Mac
  • Node.js Version: 20

itinance avatar Jun 14 '24 10:06 itinance

the problem here is how to know what a valid email address is.

for example: why do you assume "test@gmai" is a false email? according to the email spec, a tld is not required in emails, so it could be a valid email address.

FreTimmerman avatar Sep 23 '25 08:09 FreTimmerman