mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-18 10:30:49 +01:00
refactor: use includes
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user