blob: 6299f4e953007ce2e05e93a8f5dd561b269a5f5d [file] [log] [blame]
/**
* Function that returns the root domain of a sub-domain.
*
* I.e. it will return "skia.org" if the current location is "perf.skia.org".
*
* In addition it will fallback to "skia.org" is case we are on corp.goog.
*/
export function rootDomain(): string {
let ret = window.location.host.split('.').slice(-2).join('.');
if (ret === 'corp.goog') {
ret = 'skia.org';
}
return ret;
}