hive-bedrock-api 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -108,6 +108,7 @@ exports.formats = (_a = {
108
108
  return game;
109
109
  },
110
110
  _a[GAME_INFO_1.GAME.TheBridge] = function (game) {
111
+ var _a, _b;
111
112
  if (!game)
112
113
  return null;
113
114
  if ("m_solo_deaths" in game) {
@@ -130,6 +131,12 @@ exports.formats = (_a = {
130
131
  game.victories = game.m_solo_victories;
131
132
  delete game.m_solo_victories;
132
133
  }
134
+ if ("played" in game && "victories" in game) {
135
+ game.losses = (_b = (_a = game.played) !== null && _a !== void 0 ? _a : 0 - game.victories) !== null && _b !== void 0 ? _b : 0;
136
+ game.win_percentage = game.victories / game.played;
137
+ if (isNaN(game.win_percentage))
138
+ game.win_percentage = 0;
139
+ }
133
140
  return game;
134
141
  },
135
142
  _a);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hive-bedrock-api",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "An API wrapper for the Hive Minecraft Bedrock Edition server.",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",