The JADE 2022 release meets tomorrow’s business demands.
I would say every Jade system out there has an email validation method on the String primitive. Could we have one created by Jade on the String primitive on the root schema? String :: isValidEmailAddress__
You can implement this easily enough yourself using JadeRegex. A reasonable regex to use is the one specified by HTML5 for email input validation:
^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$
https://html.spec.whatwg.org/multipage/input.html#email-state-(type=email)
It's not RFC 5322 compliant (eg. it doesn't handle comments and quoted strings which are technically valid in an email address but not really used in practice) but it was deemed good enough by Google/Microsoft/Apple/Mozilla.
At least if Jade provide a standard it should cover the generic needs of most requirements and then developers could inherit this to their own requirements to add any further tweaks
stevek
I would suggest that every JADE system out there has a different email validation method, as while there is a standard, it is virtually impossible to implement, and everyone does it differently, and according to their own needs. Incidentally, gmail and outlook do not fully implement the standard.
Once Regex comes out, you'll be able to implement one of your own, to your own needs, much more cleanly and easily.
Also, is it a productive use of our time to supply code everyone already has?