fix Domain.fullName

This commit is contained in:
Philipp Kunz 2016-06-21 18:59:05 +02:00
parent 00a892ee82
commit c6a1a45812
2 changed files with 18 additions and 5 deletions

File diff suppressed because one or more lines are too long

View File

@ -15,11 +15,17 @@ export class Domain {
domainName;
subDomain;
constructor(domainStringArg:string){
this.fullName = domainStringArg;
let regexMatches = domainRegex(domainStringArg);
this.fullName = "";
for(let i = 1; i <= 5; i++){
if(regexMatches[i - 1]) {
this["level" + i.toString()] = regexMatches[i - 1]
let localMatch = regexMatches[i - 1]
this["level" + i.toString()] = localMatch;
if (this.fullName == ""){
this.fullName = localMatch;
} else {
this.fullName = localMatch + "." + this.fullName;
}
} else {
this["level" + i.toString()] = undefined;
};