"use strict";

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