code: function getProtocolAndHostname(origUrl?: string): null | string {
    const url = getUrlParts(origUrl);
    if (!url) {
      return null;
    }
    const port = url.port ? `:${url.port}` : "";
    return `${url.protocol || "http:"}//${url.hostname}${port}`;
  }
docs: Returns a domain
  If there is no protocol, default to `http://`
  
  @param {String} origUrl
  @returns {String|null}