clashofclans.js 3.3.13-dev.a96b9d2 → 3.3.14-dev.00f01da
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/dist/struct/ClanWar.d.ts +2 -0
- package/dist/struct/ClanWar.js +4 -0
- package/dist/util/Util.js +1 -1
- package/package.json +1 -1
package/dist/struct/ClanWar.d.ts
CHANGED
|
@@ -98,6 +98,8 @@ export declare class WarClan {
|
|
|
98
98
|
get defenses(): ClanWarAttack[];
|
|
99
99
|
/** Get a member of the clan for the given tag, or `null` if not found. */
|
|
100
100
|
getMember(tag: string): ClanWarMember | null;
|
|
101
|
+
/** Get a member of the clan for the given map position, or `null` if not found. */
|
|
102
|
+
getMemberByMapPosition(mapPosition: number): ClanWarMember | null;
|
|
101
103
|
/** Get clan's formatted link to open clan in-game. */
|
|
102
104
|
get shareLink(): string;
|
|
103
105
|
}
|
package/dist/struct/ClanWar.js
CHANGED
|
@@ -139,6 +139,10 @@ class WarClan {
|
|
|
139
139
|
getMember(tag) {
|
|
140
140
|
return this.members.find((m) => m.tag === tag) ?? null;
|
|
141
141
|
}
|
|
142
|
+
/** Get a member of the clan for the given map position, or `null` if not found. */
|
|
143
|
+
getMemberByMapPosition(mapPosition) {
|
|
144
|
+
return this.members.find((m) => m.mapPosition === mapPosition) ?? null;
|
|
145
|
+
}
|
|
142
146
|
/** Get clan's formatted link to open clan in-game. */
|
|
143
147
|
get shareLink() {
|
|
144
148
|
return `https://link.clashofclans.com/en?action=OpenClanProfile&tag=${this.tag.replace(/#/g, '')}`;
|
package/dist/util/Util.js
CHANGED
|
@@ -146,7 +146,7 @@ class Util extends null {
|
|
|
146
146
|
static parseArmyLink(link) {
|
|
147
147
|
const unitsMatches = /u(?<units>[\d+x-]+)/.exec(link);
|
|
148
148
|
const spellsMatches = /s(?<spells>[\d+x-]+)/.exec(link);
|
|
149
|
-
const unitsPart = unitsMatches?.groups?.
|
|
149
|
+
const unitsPart = unitsMatches?.groups?.units?.split('-') ?? [];
|
|
150
150
|
const spellParts = spellsMatches?.groups?.spells?.split('-') ?? [];
|
|
151
151
|
const units = unitsPart
|
|
152
152
|
.map((parts) => parts.split(/x/))
|
package/package.json
CHANGED