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.
@@ -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
  }
@@ -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?.unit?.split('-') ?? [];
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clashofclans.js",
3
- "version": "3.3.13-dev.a96b9d2",
3
+ "version": "3.3.14-dev.00f01da",
4
4
  "description": "JavaScript library for interacting with the Clash of Clans API",
5
5
  "author": "https://clashofclans.js.org",
6
6
  "license": "MIT",