function shareSameDomainSuffix(hostname, vhost) {
  if (endsWith(hostname, vhost)) {
    return (
      hostname.length === vhost.length ||
      hostname[hostname.length - vhost.length - 1] === '.'
    );
  }

  return false;
}
Check if `vhost` is a valid suffix of `hostname` (top-domain)

It means that `vhost` needs to be a suffix of `hostname` and we then need to
make sure that: either they are equal, or the character preceding `vhost` in
`hostname` is a '.' (it should not be a partial label).

* hostname = 'not.evil.com' and vhost = 'vil.com'      => not ok
* hostname = 'not.evil.com' and vhost = 'evil.com'     => ok
* hostname = 'not.evil.com' and vhost = 'not.evil.com' => ok

@param {string} hostname
@param {string} vhost
@return {boolean}