function getSubDomain(url) {
  const sections = getHost(url).split('.')
  if (sections.length < 2) return ''
  return sections.slice(0, -2).join('.')
}
Get sub domain of url
@param  {String} url - href of page
@return {String} sub domain of page

@example
 getSubDomain('https://subdomain.my-site.com/')
 > subdomain