implemented email format check
This commit is contained in:
parent
47c29ad10e
commit
8c03efbfc0
|
|
@ -0,0 +1,13 @@
|
|||
|
||||
function check_email_format(email: string) {
|
||||
const trimmed = email.trim()
|
||||
|
||||
if (trimmed.length > 254) return false
|
||||
|
||||
const emailRegex = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:.[a-zA-Z0-9-]+)*$/;
|
||||
return emailRegex.test(trimmed)
|
||||
}
|
||||
|
||||
export default {
|
||||
check_email_format,
|
||||
}
|
||||
Loading…
Reference in New Issue