mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-06-10 14:44:40 +02:00
* Code cleanup and eslint since -- remove unused variables, clean up RegExs, so on...
This commit is contained in:
parent
a106050ba3
commit
ac1433e84b
112 changed files with 1375 additions and 1898 deletions
|
@ -99,7 +99,7 @@ function validateGeneralMailAddressedTo(data, cb) {
|
|||
function validateEmailAvail(data, cb) {
|
||||
//
|
||||
// This particular method allows empty data - e.g. no email entered
|
||||
//
|
||||
//
|
||||
if(!data || 0 === data.length) {
|
||||
return cb(null);
|
||||
}
|
||||
|
@ -110,7 +110,7 @@ function validateEmailAvail(data, cb) {
|
|||
//
|
||||
// See http://stackoverflow.com/questions/7786058/find-the-regex-used-by-html5-forms-for-validation
|
||||
//
|
||||
const emailRegExp = /[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9-]+(.[a-z0-9-]+)*/;
|
||||
const emailRegExp = /[a-z0-9!#$%&'*+/=?^_`{|}~.-]+@[a-z0-9-]+(.[a-z0-9-]+)*/;
|
||||
if(!emailRegExp.test(data)) {
|
||||
return cb(new Error('Invalid email address'));
|
||||
}
|
||||
|
@ -121,8 +121,8 @@ function validateEmailAvail(data, cb) {
|
|||
} else if(uids.length > 0) {
|
||||
return cb(new Error('Email address not unique'));
|
||||
}
|
||||
|
||||
return cb(null);
|
||||
|
||||
return cb(null);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue