clashofclans.js 2.0.2-dev.ff41115 → 2.1.0-dev.37563ef

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,6 +2,23 @@
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
+ ## 2.1.0 (2021-12-06)
6
+
7
+ ### Bug Fixes
8
+
9
+ - Consistency of `ClanWar.attacksPerMember` property. ([#75](https://github.com/clashperk/clashofclans.js/pull/75)) ([6e23d2f](https://github.com/clashperk/clashofclans.js/commit/6e23d2fe0373f56268ffa55d5ac2807c9a2dc2fc))
10
+
11
+ ### Features
12
+
13
+ - More utility methods added to `Util` class. ([#76](https://github.com/clashperk/clashofclans.js/pull/76)) ([ff41115](https://github.com/clashperk/clashofclans.js/commit/ff4111530d6293ef1fc54aa916436130fc30a09c))
14
+ - `Util.formatTag(tag: string): string`
15
+ - `Util.formatDate(date: string): Date`
16
+ - `Util.isValidTag(tag: string): boolean`
17
+ - `Util.encodeTagToId(tag: string): string`
18
+ - `Util.decodeIdToTag(id: string): string`
19
+
20
+ - Support of async/await for custom events ([#79](https://github.com/clashperk/clashofclans.js/pull/79)) ([ff41115](https://github.com/clashperk/clashofclans.js/commit/a23db3786bcca44b8547c70f27773bdb1216f990))
21
+
5
22
  ## 2.0.2 (2021-11-30)
6
23
 
7
24
  ### Bug Fixes
@@ -203,7 +203,7 @@ class EventManager {
203
203
  return this._clans.set(clan.tag, clan);
204
204
  for (const { name, filter } of this._events.clans) {
205
205
  try {
206
- if (!filter(cached, clan))
206
+ if (!(await filter(cached, clan)))
207
207
  continue;
208
208
  this.client.emit(name, cached, clan);
209
209
  }
@@ -224,7 +224,7 @@ class EventManager {
224
224
  return this._players.set(player.tag, player);
225
225
  for (const { name, filter } of this._events.players) {
226
226
  try {
227
- if (!filter(cached, player))
227
+ if (!(await filter(cached, player)))
228
228
  continue;
229
229
  this.client.emit(name, cached, player);
230
230
  }
@@ -248,7 +248,7 @@ class EventManager {
248
248
  return this._wars.set(key, war);
249
249
  for (const { name, filter } of this._events.wars) {
250
250
  try {
251
- if (!filter(cached, war))
251
+ if (!(await filter(cached, war)))
252
252
  continue;
253
253
  this.client.emit(name, cached, war);
254
254
  }
@@ -262,7 +262,7 @@ class EventManager {
262
262
  if (data && data.warTag === cached.warTag) {
263
263
  for (const { name, filter } of this._events.wars) {
264
264
  try {
265
- if (!filter(cached, data))
265
+ if (!(await filter(cached, data)))
266
266
  continue;
267
267
  this.client.emit(name, cached, data);
268
268
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clashofclans.js",
3
- "version": "2.0.2-dev.ff41115",
3
+ "version": "2.1.0-dev.37563ef",
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",