rtfeldman / elm-validate

Convenience functions for validating Elm data.
http://package.elm-lang.org/packages/rtfeldman/elm-validate/latest
BSD 3-Clause "New" or "Revised" License
145 stars 28 forks source link

ifInvalidEmail not catching all invalid email addresses #30

Closed Sloff closed 1 year ago

Sloff commented 6 years ago

Hi

The ifInvalidEmail validator is not catching an address such as example@example as an invalid address

Kind regards

Sloff commented 6 years ago

Also it is marking an empty email as invalid, but I have an optional email field, thus an empty value is valid, but a non empty value should be validated as an email. I believe ifBlank can be used with ifInvalidEmail if the field is required

janwirth commented 3 years ago

I have the same problem

validate (ifInvalidEmail identity (always "bad email")) "jan@notopleveldomain"
--> (Valid "jan@notopleveldomain")