fortnite-basic-api
Advanced tools
Comparing version 1.0.5 to 1.0.6
{ | ||
"name": "fortnite-basic-api", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "basic fortnite api and other things, supporting both v1 and v2, using request-promises", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -169,4 +169,6 @@ const GameModes = require('../../enums/GameModes'); | ||
static assignExtraStats(obj) { | ||
const winrate = Number(this.winrate(obj.placetop1, obj.matchesplayed)); | ||
const kdr = Number(this.ratio(obj.kills, (obj.matchesplayed - obj.placetop1))); | ||
if (!obj.placetop1) Object.assign(obj, { placetop1: 0 }); | ||
if (!obj.kills) Object.assign(obj, { kills: 0 }); | ||
const winrate = Number(this.winrate(obj.placetop, obj.matchesplayed)); | ||
const kdr = Number(this.ratio(obj.kills, obj.matchesplayed - obj.placetop1)); | ||
const killsPerMatch = Number(this.ratio(obj.kills, obj.matchesplayed)); | ||
@@ -173,0 +175,0 @@ Object.assign(obj, { winrate, kdr, killsPerMatch }); |
25423
501