gw2e-account-statistics 3.16.1 → 3.17.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.
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
|
|
5
|
+
var _coloredTitles = require('@gw2efficiency/game-data/titles/categories/colored-titles');
|
|
6
|
+
|
|
7
|
+
var _coloredTitles2 = _interopRequireDefault(_coloredTitles);
|
|
8
|
+
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
|
|
11
|
+
var coloredTitleIds = _coloredTitles2.default.map(function (x) {
|
|
12
|
+
return x.id;
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
exports.default = coloredTitleIds;
|
|
@@ -36,7 +36,8 @@ exports.default = function (accountData, extraInformation) {
|
|
|
36
36
|
_pristineFractalRelicsFromTitles: pristineFractalRelicsFromTitles(accountData),
|
|
37
37
|
_unstableFractalEssenceFromUnlocks: unstableFractalEssenceFromUnlocks(accountData),
|
|
38
38
|
aureneLegendaryVariantSkins: aureneLegendaryVariantSkins(accountData),
|
|
39
|
-
suffusedObsidianArmorSkins: suffusedObsidianArmorSkins(accountData)
|
|
39
|
+
suffusedObsidianArmorSkins: suffusedObsidianArmorSkins(accountData),
|
|
40
|
+
coloredTitleCount: coloredTitleCount(accountData)
|
|
40
41
|
};
|
|
41
42
|
};
|
|
42
43
|
|
|
@@ -64,6 +65,10 @@ var _suffusedObsidianArmors = require('../gameData/suffusedObsidianArmors');
|
|
|
64
65
|
|
|
65
66
|
var _suffusedObsidianArmors2 = _interopRequireDefault(_suffusedObsidianArmors);
|
|
66
67
|
|
|
68
|
+
var _coloredTitles = require('../gameData/coloredTitles');
|
|
69
|
+
|
|
70
|
+
var _coloredTitles2 = _interopRequireDefault(_coloredTitles);
|
|
71
|
+
|
|
67
72
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
68
73
|
|
|
69
74
|
// The unlocked dyes on the account
|
|
@@ -202,6 +207,18 @@ function titleCount(accountData) {
|
|
|
202
207
|
return accountData.titles.length;
|
|
203
208
|
}
|
|
204
209
|
|
|
210
|
+
function coloredTitleCount(accountData) {
|
|
211
|
+
if (!accountData.titles) {
|
|
212
|
+
return null;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
var titleCount = _coloredTitles2.default.filter(function (x) {
|
|
216
|
+
return accountData.titles.includes(x);
|
|
217
|
+
}).length;
|
|
218
|
+
|
|
219
|
+
return titleCount;
|
|
220
|
+
}
|
|
221
|
+
|
|
205
222
|
// The unlocked recipes on the account
|
|
206
223
|
function recipeCount(accountData) {
|
|
207
224
|
if (!accountData.recipes) {
|
package/package.json
CHANGED
package/tests/unlocks.spec.js
CHANGED
|
@@ -149,6 +149,13 @@ describe('statistics > unlocks', () => {
|
|
|
149
149
|
expect(unlocksStatistics({titles: [1, 2, 7, 9, 10]}, EXTRA_INFO).titleCount).to.equal(5)
|
|
150
150
|
})
|
|
151
151
|
|
|
152
|
+
it('can calculate colored title coun', () => {
|
|
153
|
+
expect(unlocksStatistics({}, EXTRA_INFO).coloredTitleCount).to.equal(null)
|
|
154
|
+
expect(unlocksStatistics({titles: []}, EXTRA_INFO).coloredTitleCount).to.equal(0)
|
|
155
|
+
expect(unlocksStatistics({titles: [1]}, EXTRA_INFO).coloredTitleCount).to.equal(0)
|
|
156
|
+
expect(unlocksStatistics({titles: [1, 89]}, EXTRA_INFO).coloredTitleCount).to.equal(1)
|
|
157
|
+
})
|
|
158
|
+
|
|
152
159
|
it('can calculate recipe count', () => {
|
|
153
160
|
expect(unlocksStatistics({}, EXTRA_INFO).recipeCount).to.equal(null)
|
|
154
161
|
expect(unlocksStatistics({recipes: []}, EXTRA_INFO).recipeCount).to.equal(0)
|