clashofclans.js 3.3.14-dev.00f01da → 3.3.14-dev.a7dc0cc

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.
@@ -1,6 +1,6 @@
1
1
  import { APICapitalRaidSeason } from '../types';
2
2
  export declare const calculateRaidsCompleted: (attackLog: APICapitalRaidSeason['attackLog']) => number;
3
- export declare const calculateOffensiveRaidMedals: (attackLog: APICapitalRaidSeason['attackLog'], offensiveReward?: number) => number;
3
+ export declare const calculateOffensiveRaidMedals: (attackLog: APICapitalRaidSeason['attackLog']) => number;
4
4
  export declare const isFriendlyWar: (preparationStartTime: Date, startTime: Date) => boolean;
5
5
  export declare const getWarResult: (clan: PartialWarClan, opponent: PartialWarClan) => "win" | "lose" | "tie";
6
6
  export declare const isWarWinner: (clan: PartialWarClan, opponent: PartialWarClan) => boolean;
@@ -11,7 +11,7 @@ const calculateRaidsCompleted = (attackLog) => {
11
11
  return total;
12
12
  };
13
13
  exports.calculateRaidsCompleted = calculateRaidsCompleted;
14
- const calculateOffensiveRaidMedals = (attackLog, offensiveReward = 0) => {
14
+ const calculateOffensiveRaidMedals = (attackLog) => {
15
15
  const districtMap = {
16
16
  1: 135,
17
17
  2: 225,
@@ -47,7 +47,7 @@ const calculateOffensiveRaidMedals = (attackLog, offensiveReward = 0) => {
47
47
  }
48
48
  if (totalMedals !== 0)
49
49
  totalMedals = Math.ceil(totalMedals / attacksDone);
50
- return Math.max(totalMedals, offensiveReward);
50
+ return totalMedals;
51
51
  };
52
52
  exports.calculateOffensiveRaidMedals = calculateOffensiveRaidMedals;
53
53
  const isFriendlyWar = (preparationStartTime, startTime) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clashofclans.js",
3
- "version": "3.3.14-dev.00f01da",
3
+ "version": "3.3.14-dev.a7dc0cc",
4
4
  "description": "JavaScript library for interacting with the Clash of Clans API",
5
5
  "author": "https://clashofclans.js.org",
6
6
  "license": "MIT",
@@ -51,12 +51,11 @@
51
51
  }
52
52
  },
53
53
  "dependencies": {
54
- "jest": "^29.7.0",
55
54
  "undici": "^5.23.0"
56
55
  },
57
56
  "devDependencies": {
58
57
  "@jest/globals": "^29.7.0",
59
- "@types/jest": "^29.5.12",
58
+ "@types/jest": "^29.5.14",
60
59
  "@types/node": "^18.17.5",
61
60
  "@typescript-eslint/eslint-plugin": "^6.3.0",
62
61
  "@typescript-eslint/parser": "^6.3.0",
@@ -65,12 +64,13 @@
65
64
  "eslint-config-prettier": "^9.0.0",
66
65
  "eslint-plugin-prettier": "^5.0.0",
67
66
  "gen-esm-wrapper": "^1.1.3",
67
+ "jest": "^29.7.0",
68
68
  "prettier": "^3.0.1",
69
69
  "rimraf": "^5.0.1",
70
- "ts-jest": "^29.1.2",
70
+ "ts-jest": "^29.2.5",
71
71
  "typescript": "^5.1.6"
72
72
  },
73
73
  "engines": {
74
- "node": ">=16.x"
74
+ "node": ">=18.x"
75
75
  }
76
76
  }