You can tell to use any A compatible promise implemention like this: There are already many validation libraries out there today but most of them are very tightly coupled to a language or framework.
There is also a Travis project used for testing, a Coveralls project used to code coverage as well as the annotated source.
If it doesn't find any matches then it will fail the validation and the function will return false, if the match returns true then the email will be of a correct format and the function will return true.
regular expression pattern to separate the domain name from the email address.
is an open source component of Wrapp and is licensed under the MIT license.
There are no required external dependencies at all!
The regex for validating the correct email format in line 2 has been borrowed and edited slightly by adding the i flag so that the regex is case-insensitive.
The if block in lines 3-6 checks to see if the email address in the first field passes the regex check by invoking the search() method on our email string value.
It is unit tested with 100% code coverage and can be considered fit for production.
Though for the datetime and date validator to you need to specify a parse and format function and for that you most likely will want to use a library, is highly recommended.
If you want to use async validation you need to use a runtime that supports Promises.