"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.getServerDomain = getServerDomain;
exports.getServerUrl = getServerUrl;

function getServerDomain(serverInfo) {
  const {
    host,
    domain
  } = serverInfo;

  if (domain) {
    return `${host}.${domain}.zohocorpin.com`;
  }

  return host;
}

function getServerUrl({
  domain,
  port,
  protocol = 'http'
}) {
  const prefix = protocol ? `${protocol}:` : '';
  return `${prefix}//${domain}:${port}/`;
}