If email === null then the next line email.split('@') will throw an exception.
The function should return false if !!email and could use feature detection for the trimming: email = (typeof email.trim === "function") ? email().trim() : email.replace(/^\s*/, '').replace(/\s*$/, '');
Are u still processing PR for this package?
varparts=email.split('@');
if(parts.length<2){
returnfalse;
@@ -247,7 +250,7 @@ var Mailcheck = {
varsld='';
vartld='';
if(domainParts.length==0){
if(domainParts.length===0){
// The address does not have a top-level domain
returnfalse;
}elseif(domainParts.length==1){
@@ -256,8 +259,8 @@ var Mailcheck = {
}else{
// The address has a domain and a top-level domain
sld=domainParts[0];
for(vari=1;i<domainParts.length;i++){
tld+=domainParts[i]+'.';
for(varj=1;j<domainParts.length;j++){
tld+=domainParts[j]+'.';
}
tld=tld.substring(0,tld.length-1);
}
@@ -267,7 +270,7 @@ var Mailcheck = {
secondLevelDomain: sld,
domain: domain,
address: parts.join('@')
}
};
},
// Encode the email address to prevent XSS but leave in valid
If
email === null
then the next lineemail.split('@')
will throw an exception.The function should return false if
!!email
and could use feature detection for the trimming:email = (typeof email.trim === "function") ? email().trim() : email.replace(/^\s*/, '').replace(/\s*$/, '');
Are u still processing PR for this package?