clashofclans.js 3.0.1-dev.e71b7fa → 3.0.2

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.
package/CHANGELOG.md CHANGED
@@ -2,13 +2,14 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
- ## 3.0.1 (11-01-2023)
5
+ ## 3.0.2 (15-01-2023)
6
6
 
7
7
  ### Bug Fixes
8
8
 
9
9
  - Conflict with the same name of builder base and home base troops. (#123)
10
10
  - Fix the issue with the `Client#getLeagueWar()` method.
11
11
  - Typings and documentation for clan capital.
12
+ - Fix the issue with the `Clan#clanCapital` property.
12
13
 
13
14
  ### Features
14
15
 
@@ -34,7 +34,8 @@ class Clan {
34
34
  this.warLeague = data.warLeague ? new WarLeague_1.WarLeague(data.warLeague) : null;
35
35
  this.memberCount = data.members;
36
36
  this.labels = data.labels.map((label) => new Label_1.Label(label));
37
- this.clanCapital = Object.keys(data.clanCapital).length > 0 ? new ClanCapital_1.ClanCapital(data.clanCapital) : null;
37
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
38
+ this.clanCapital = Object.keys(data.clanCapital ?? {}).length > 0 ? new ClanCapital_1.ClanCapital(data.clanCapital) : null;
38
39
  this.isFamilyFriendly = data.isFamilyFriendly;
39
40
  this.capitalPoints = data.clanCapitalPoints;
40
41
  this.capitalLeague = data.capitalLeague;
@@ -24,7 +24,7 @@ export interface APISeason {
24
24
  }
25
25
  /** /clans?name={name}&limit={limit} */
26
26
  export interface APIClanList {
27
- items: Omit<APIClan, 'memberList'>[];
27
+ items: Omit<APIClan, 'memberList' | 'clanCapital'>[];
28
28
  paging: APIPaging;
29
29
  }
30
30
  export interface APIChatLanguage {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clashofclans.js",
3
- "version": "3.0.1-dev.e71b7fa",
3
+ "version": "3.0.2",
4
4
  "description": "JavaScript library for interacting with the Clash of Clans API",
5
5
  "author": "SUVAJIT <suvajit.me@gmail.com>",
6
6
  "license": "MIT",