Open tlvenn opened 3 years ago
@TheMisir what do you think ? I can open a PR if there is an agreement that is probably a safer path forward.
I don't like depending on 3rd party packages just for a few lines of code actually 😅
I understand the sentiment but those few lines of codes are kinda critical to get right and duplicating and maintaining that effort seems kinda pointless. For me this falls into the same realm as Don't roll your own crypto
. The above package has zero dependencies, do only 1 thing and seems to do it right and is well maintained as far as I can see.
For reference this package seems like an even better candidate, focusing only on email validation without using regexp
Validation of common idioms via regexp is a tricky business and not something you really want to do yourself. For example, the regexp currently being used to validate emails is actually quite simple:
If we were to compare it to the one being define in the validators package:
Obviously the latter take into account Unicode characters and probably some other quirks. I believe it would be better to simply leverage the validators package instead of trying to come up with regexps on our own that we have to maintain and test.