function validateCookieDomain (domain) {
  if (
    domain.startsWith('-') ||
    domain.endsWith('.') ||
    domain.endsWith('-')
  ) {
    throw new Error('Invalid cookie domain')
  }
}
I have no idea why these values aren't allowed to be honest,
but Deno tests these. - Khafra
@param {string} domain