Improved code readability by formatting the regular expression in the `isEmail` function in `utils/validators/email.ts` and also ensured a newline at the end of the file. Issue: #18 Signed-off-by: Mathis <yidhra@tuta.io>
6 lines
258 B
TypeScript
6 lines
258 B
TypeScript
export function isEmail(email: string) {
|
|
const re =
|
|
/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
|
return re.test(String(email).toLowerCase());
|
|
}
|