Add some helpers
This commit is contained in:
6
email-validator.js
Normal file
6
email-validator.js
Normal file
@ -0,0 +1,6 @@
|
||||
export const validateEmail = (control, value) => {
|
||||
if (typeof value !== 'string') {
|
||||
return false;
|
||||
}
|
||||
return value.toLowerCase().match(/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/) !== null;
|
||||
}
|
Reference in New Issue
Block a user