Add some helpers

This commit is contained in:
pk committed 2022-10-29 22:05:19 +02:00
1 parent 30634f7433
commit 9f5824fd41
3 files changed
+61

No files matched your search

+6
View 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;
}