* Code cleanup and eslint since -- remove unused variables, clean up RegExs, so on...

This commit is contained in:
Bryan Ashby 2018-01-15 12:22:11 -07:00
parent a106050ba3
commit ac1433e84b
112 changed files with 1375 additions and 1898 deletions

View file

@ -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);
});
}