gw2e-account-statistics 3.10.0 → 3.12.0

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.
@@ -7,7 +7,8 @@ exports.default = function (accountData) {
7
7
  return {
8
8
  characterCount: null,
9
9
  maxLevelCharacterCount: null,
10
- deathCount: null
10
+ deathCount: null,
11
+ mostPlayedCharacterPlaytime: null
11
12
  };
12
13
  }
13
14
 
@@ -22,10 +23,16 @@ exports.default = function (accountData) {
22
23
  }).reduce(function (a, b) {
23
24
  return a + b;
24
25
  }, 0);
26
+ var mostPlayedCharacterPlaytime = accountData.characters.map(function (character) {
27
+ return character.age;
28
+ }).reduce(function (a, b) {
29
+ return Math.max(a, b);
30
+ }, 0);
25
31
 
26
32
  return {
27
33
  characterCount: characterCount,
28
34
  maxLevelCharacterCount: maxLevelCharacterCount,
29
- deathCount: deathCount
35
+ deathCount: deathCount,
36
+ mostPlayedCharacterPlaytime: mostPlayedCharacterPlaytime
30
37
  };
31
38
  };
@@ -104,6 +104,15 @@ exports.default = function (accountData) {
104
104
  elonRiverlandsHerosChoice: countItems(items, 91039),
105
105
  theDesolationHerosChoice: countItems(items, [84360, 90994]),
106
106
  domainOfVabbiHerosChoice: countItems(items, 83035),
107
+ seitungProvinceHerosChoice: countItems(items, 97895),
108
+ newKainengCityHerosChoice: countItems(items, 97901),
109
+ echovaldWildsHerosChoice: countItems(items, 97894),
110
+ dragonsEndHerosChoice: countItems(items, 97896),
111
+ gyalaDelveHerosChoice: countItems(items, 99704),
112
+ skywatchArchipelagoHerosChoice: countItems(items, 100547),
113
+ amnytasHerosChoice: countItems(items, 100193),
114
+ innerNayosEndHerosChoice: countItems(items, 101195),
115
+ convergenceHerosChoice: countItems(items, 101185),
107
116
  giftsOfExploration: countItems(items, 19677),
108
117
  giftsOfBattle: countItems(items, 19678),
109
118
  tomesOfKnowledge: countItems(items, [43741, 43766]),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gw2e-account-statistics",
3
- "version": "3.10.0",
3
+ "version": "3.12.0",
4
4
  "description": "Calculate statistics of guildwars2 accounts",
5
5
  "main": "./build/index.js",
6
6
  "scripts": {
@@ -7,7 +7,8 @@ describe('statistics > characters', () => {
7
7
  expect(charactersStatistics({})).to.deep.equal({
8
8
  characterCount: null,
9
9
  maxLevelCharacterCount: null,
10
- deathCount: null
10
+ deathCount: null,
11
+ mostPlayedCharacterPlaytime: null
11
12
  })
12
13
  })
13
14
 
@@ -39,7 +40,8 @@ describe('statistics > characters', () => {
39
40
  expect(charactersStatistics({characters: data})).to.deep.equal({
40
41
  characterCount: 3,
41
42
  deathCount: 3942,
42
- maxLevelCharacterCount: 2
43
+ maxLevelCharacterCount: 2,
44
+ mostPlayedCharacterPlaytime: 8590624
43
45
  })
44
46
  })
45
47
 
@@ -47,7 +49,8 @@ describe('statistics > characters', () => {
47
49
  expect(charactersStatistics({characters: []})).to.deep.equal({
48
50
  characterCount: 0,
49
51
  deathCount: 0,
50
- maxLevelCharacterCount: 0
52
+ maxLevelCharacterCount: 0,
53
+ mostPlayedCharacterPlaytime: 0
51
54
  })
52
55
  })
53
56
  })
@@ -59,6 +59,15 @@ describe('statistics > items', () => {
59
59
  elonRiverlandsHerosChoice: null,
60
60
  theDesolationHerosChoice: null,
61
61
  domainOfVabbiHerosChoice: null,
62
+ seitungProvinceHerosChoice: null,
63
+ newKainengCityHerosChoice: null,
64
+ echovaldWildsHerosChoice: null,
65
+ dragonsEndHerosChoice: null,
66
+ gyalaDelveHerosChoice: null,
67
+ skywatchArchipelagoHerosChoice: null,
68
+ amnytasHerosChoice: null,
69
+ innerNayosEndHerosChoice: null,
70
+ convergenceHerosChoice: null,
62
71
  uniqueTonics: null,
63
72
  bloodRubies: null,
64
73
  petrifiedWood: null,