add simple email validation

This commit is contained in:
Bilal Catic
2019-05-22 16:57:08 +02:00
parent a3f76d20fe
commit dd38602c5a
3 changed files with 48 additions and 20 deletions

9
app/helpers/email.js Normal file
View File

@@ -0,0 +1,9 @@
const isValidEmail = (email) => {
const simpleEmailRegex = /^.+@.+\..+$/;
return (email && email.length < 250 && simpleEmailRegex.test(email));
};
module.exports = {
isValidEmail
};