22 lines
604 B
TypeScript
22 lines
604 B
TypeScript
export class ConnectHelper{
|
|
|
|
public static getCommunityFromDomain(domain:string):string{
|
|
// domain = "beta.egi.openaire.eu"; for testing
|
|
if(domain.indexOf("openaire.eu") == -1){
|
|
return null;
|
|
}
|
|
if(domain.indexOf("beta")!=-1){
|
|
domain = domain.substr(domain.indexOf(".")+1,domain.length);
|
|
domain = domain.substr(0,domain.indexOf("."));
|
|
}else if(domain.indexOf("test.")!=-1){
|
|
return null;
|
|
}else{
|
|
domain = domain.substr(0,domain.indexOf("."));
|
|
}
|
|
if(domain == "connect" || domain == "explore"){
|
|
return null;
|
|
}
|
|
return domain;
|
|
}
|
|
}
|