text: "use strict";
  var __importDefault = (this && this.__importDefault) || function (mod) {
      return (mod && mod.__esModule) ? mod : { "default": mod };
  };
  Object.defineProperty(exports, "__esModule", { value: true });
  const assert_1 = __importDefault(require("assert"));
  const parseDescription_1 = __importDefault(require("./parseDescription"));
  function formatResult(host, port, srvRecord, result) {
      var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
      assert_1.default(host.length > 0, 'Expected host.length > 0, got ' + host.length);
      assert_1.default(Number.isInteger(port), 'Expected integer, got ' + port);
      assert_1.default(port > 0, 'Expected port > 0, got ' + port);
      assert_1.default(port < 65536, 'Expected port < 65536, got ' + port);
      assert_1.default(typeof result === 'object', 'Expected object, got ' + (typeof result));
      const version = (_b = (_a = result === null || result === void 0 ? void 0 : result.version) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : null;
      const protocolVersion = (_d = (_c = result === null || result === void 0 ? void 0 : result.version) === null || _c === void 0 ? void 0 : _c.protocol) !== null && _d !== void 0 ? _d : null;
      const onlinePlayers = (_f = (_e = result === null || result === void 0 ? void 0 : result.players) === null || _e === void 0 ? void 0 : _e.online) !== null && _f !== void 0 ? _f : null;
      const maxPlayers = (_h = (_g = result === null || result === void 0 ? void 0 : result.players) === null || _g === void 0 ? void 0 : _g.max) !== null && _h !== void 0 ? _h : null;
      const samplePlayers = (_k = (_j = result === null || result === void 0 ? void 0 : result.players) === null || _j === void 0 ? void 0 : _j.sample) !== null && _k !== void 0 ? _k : null;
      const description = typeof result.description !== 'undefined' ? parseDescription_1.default(result.description) : null;
      const favicon = (_l = result === null || result === void 0 ? void 0 : result.favicon) !== null && _l !== void 0 ? _l : null;
      const modInfo = (_m = result === null || result === void 0 ? void 0 : result.modinfo) !== null && _m !== void 0 ? _m : null;
      return {
          host,
          port,
          srvRecord,
          version,
          protocolVersion,
          onlinePlayers,
          maxPlayers,
          samplePlayers,
          description,
          favicon,
          modInfo
      };
  }
  exports.default = formatResult;
  