rategame-shared 1.1.503 → 1.1.504

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.
@@ -10,10 +10,17 @@ function alreadyHas(game, tag) {
10
10
  exports.alreadyHas = alreadyHas;
11
11
  function isLastGameOfSeries(game) {
12
12
  const seriesInfo = game.seriesInfo;
13
- if ((seriesInfo === null || seriesInfo === void 0 ? void 0 : seriesInfo.gameNumber) == null || (seriesInfo === null || seriesInfo === void 0 ? void 0 : seriesInfo.maxLength) == null) {
13
+ if ((seriesInfo === null || seriesInfo === void 0 ? void 0 : seriesInfo.homeTeamWins) == null ||
14
+ seriesInfo.awayTeamWins == null ||
15
+ seriesInfo.gameNumber == null ||
16
+ seriesInfo.maxLength == null ||
17
+ seriesInfo.gameNumber <= 0 ||
18
+ seriesInfo.maxLength <= 0) {
14
19
  return false;
15
20
  }
16
- return seriesInfo.gameNumber === seriesInfo.maxLength;
21
+ const winsRequired = Math.floor(seriesInfo.maxLength / 2) + 1;
22
+ return (seriesInfo.homeTeamWins >= winsRequired ||
23
+ seriesInfo.awayTeamWins >= winsRequired);
17
24
  }
18
25
  function evaluateMajorUpset(game) {
19
26
  var _a, _b, _c, _d;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rategame-shared",
3
- "version": "1.1.503",
3
+ "version": "1.1.504",
4
4
  "description": "This package contains shared resources for the Rate Game project.",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.js",