"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.getDomain = void 0;
const getDomain = url => {
  if (!url) return;
  const _URL = new URL(url),
    hostname = _URL.hostname;
  const parts = hostname.split('.');
  if (parts.length > 2) return parts.slice(-2).join('.');
  return hostname;
};
exports.getDomain = getDomain;
//# sourceMappingURL=getDomain.js.map