now computes zoneName and finds protocol

This commit is contained in:
2016-05-25 06:54:55 +02:00
parent 05cd515824
commit 2d4c480c1b
5 changed files with 37 additions and 5 deletions

View File

@ -9,6 +9,7 @@ export class Domain {
level4:string;
level5:string;
protocol:string;
zoneName:string;
//aliases
topLevel:string;
domainName;
@ -21,6 +22,9 @@ export class Domain {
this.level3 = regexMatches[2];
this.level4 = regexMatches[3];
this.level5 = regexMatches[4];
this.protocol = protocolRegex(domainStringArg)[1];
this.zoneName = this.level2 + "." + this.level1;
// aliases
this.topLevel = this.level1;
this.domainName = this.level2;
@ -37,4 +41,11 @@ let domainRegex = function(stringArg:string){
return(stringArg != "");
});
return regexMatchesFiltered;
};
};
let protocolRegex = function(stringArg:string){
let regexString = /^([a-zA-Z0-9]*):\/\//;
let regexMatches = regexString.exec(stringArg);
console.log(regexMatches);
return regexMatches;
}