Skip to content

Node.js based forum software built for the modern web

refactor: use includes

Barış Soner Uşaklı0c43e2dafb67
diff --git a/public/src/utils.common.js b/public/src/utils.common.js
index 7dd3a3c0e0..dfb6f35c98 100644
--- a/public/src/utils.common.js
+++ b/public/src/utils.common.js
@@ -332,7 +332,7 @@ const utils = {
},
isEmailValid: function (email) {
- return typeof email === 'string' && email.length && email.indexOf('@') !== -1 && email.indexOf(',') === -1 && email.indexOf(';') === -1;
+ return typeof email === 'string' && email.length && email.includes('@') && !email.includes(',') && !email.includes(';');
},
isUserNameValid: function (name) {