src/index.js
function getHostname(httpOptions) {
  if (httpOptions.uri && httpOptions.uri.hostname) {
    return httpOptions.uri.hostname;
  } else if (httpOptions.hostname) {
    return httpOptions.hostname;
  } else if (httpOptions.host) {
    return httpOptions.host;
  }
  return 'Unknown';
}
function getHostname(httpOptions) {
  if (httpOptions.uri && httpOptions.uri.hostname) {
    return httpOptions.uri.hostname;
  } else if (httpOptions.hostname) {
    return httpOptions.hostname;
  } else if (httpOptions.host) {
    return httpOptions.host;
  }
  return 'Unknown';
}
function getHostname ( httpOptions ) { if ( httpOptions . uri && httpOptions . uri . hostname ) { return httpOptions . uri . hostname ; } else if ( httpOptions . hostname ) { return httpOptions . hostname ; } else if ( httpOptions . host ) { return httpOptions . host ; } return 'Unknown' ; }
Get the hostname from an HTTP options object.
Supports multiple types of options.
@param  {object} httpOptions
@return {string} the hostname or "Unknown" if not found.
Get the hostname from an HTTP options object . Supports multiple types of options .