util/Constants.js

const Package = require("../../package.json");
const browser = exports.browser = typeof window !== "undefined";

exports.UserAgent = browser
  ? null
  : `Mozilla/5.0 (${process.platform}) AppleWebKit/537.36 (KHTML, like Gecko) ThunderAPI/${Package.version}`;

/**
 * URLs to access specific endpoints. These are:
 * * https://warthunder.com/en
 * * https://warthunder.com/news3-en.html
 * * https://static.warthunder.com
 * * https://wiki.warthunder.com
 * * https://live.warthunder.com/
 * @typedef {string} WTEndPointURL
 */
exports.URLs = {
  main: "https://warthunder.com",
  news: "https://warthunder.com/news3-en.html",
  static: "https://static.warthunder.com",
  wiki: "https://wiki.warthunder.com",
  live: "https://live.warthunder.com/"
};

// eslint-disable-next-line no-unused-vars
function keyMirror(arr) {
  const tmp = Object.create(null);
  for (const value of arr) tmp[value] = value;
  return tmp;
}