gw2e-account-statistics 3.18.2 → 3.19.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.
- package/build/statistics/unlocks.js +13 -1
- package/package.json +1 -1
- package/tests/unlocks.spec.js +6 -0
|
@@ -38,7 +38,8 @@ exports.default = function (accountData, extraInformation) {
|
|
|
38
38
|
_unstableFractalEssenceFromUnlocks: unstableFractalEssenceFromUnlocks(accountData),
|
|
39
39
|
aureneLegendaryVariantSkins: aureneLegendaryVariantSkins(accountData),
|
|
40
40
|
suffusedObsidianArmorSkins: suffusedObsidianArmorSkins(accountData),
|
|
41
|
-
coloredTitleCount: coloredTitleCount(accountData)
|
|
41
|
+
coloredTitleCount: coloredTitleCount(accountData),
|
|
42
|
+
homesteadDecorationCount: homesteadDecorationCount(accountData)
|
|
42
43
|
};
|
|
43
44
|
};
|
|
44
45
|
|
|
@@ -396,4 +397,15 @@ function unstableFractalEssenceFromUnlocks(accountData) {
|
|
|
396
397
|
}
|
|
397
398
|
|
|
398
399
|
return sum;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
// The amount of homestead decorations on the account
|
|
403
|
+
function homesteadDecorationCount(accountData) {
|
|
404
|
+
if (!accountData.homestead || !accountData.homestead.decorations) {
|
|
405
|
+
return null;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
return accountData.homestead.decorations.reduce(function (sum, decoration) {
|
|
409
|
+
return sum + decoration.count;
|
|
410
|
+
}, 0);
|
|
399
411
|
}
|
package/package.json
CHANGED
package/tests/unlocks.spec.js
CHANGED
|
@@ -276,4 +276,10 @@ describe('statistics > unlocks', () => {
|
|
|
276
276
|
expect(unlocksStatistics({ skins: [1, 2, 7, 9, 10] }, EXTRA_INFO).suffusedObsidianArmorSkins).to.equal(0)
|
|
277
277
|
expect(unlocksStatistics({ skins: [1, 2, 12171, 12136] }, EXTRA_INFO).suffusedObsidianArmorSkins).to.equal(2)
|
|
278
278
|
})
|
|
279
|
+
|
|
280
|
+
it('can calculate homestead decoration count', () => {
|
|
281
|
+
expect(unlocksStatistics({}, EXTRA_INFO).homesteadDecorationCount).to.equal(null)
|
|
282
|
+
expect(unlocksStatistics({ homestead: { decorations: [] } }, EXTRA_INFO).homesteadDecorationCount).to.equal(0)
|
|
283
|
+
expect(unlocksStatistics({ homestead: { decorations: [{ id: 1, count: 1 }, { id: 2, count: 2 }] } }, EXTRA_INFO).homesteadDecorationCount).to.equal(3)
|
|
284
|
+
})
|
|
279
285
|
})
|