Fix normalization of email to lowercase
This commit is contained in:
@@ -78,6 +78,18 @@ exports.isEmail = function(data) {
|
||||
return re.test(data);
|
||||
};
|
||||
|
||||
/**
|
||||
* Normalize email address to lowercase.
|
||||
* @param {string} email The email address
|
||||
* @return {string} lowercase email address
|
||||
*/
|
||||
exports.normalizeEmail = function(email) {
|
||||
if (email) {
|
||||
email = email.toLowerCase();
|
||||
}
|
||||
return email;
|
||||
};
|
||||
|
||||
/**
|
||||
* Create an error with a custom status attribute e.g. for http codes.
|
||||
* @param {number} status The error's http status code
|
||||
|
||||
Reference in New Issue
Block a user