@@ -62,2 +62,3 @@ const path = require("path"), | ||
| }); | ||
| battlesList =[] | ||
| for (let uR of uniqueRaw) { | ||
@@ -75,8 +76,9 @@ let updatedRaw = duplicatesRaw.filter(x => x.team_id == uR.team_id && x.mana_cap == uR.mana_cap && x.ruleset == uR.ruleset); | ||
| } else { | ||
| await chillout.forEach(uniqueRaw, uniq => { | ||
| uniqueRaw.forEach(uniq => { | ||
| let duplicaters = data.findIndex(o => o.team_id == uniq.team_id && o.mana_cap == uniq.mana_cap && o.ruleset == uniq.ruleset); | ||
| duplicaters != -1 ? dupIndex.push(duplicaters) && duplicates.push(uniq) : unique.push(uniq) | ||
| }) | ||
| }); | ||
| } | ||
| data = data.filter(function (value, index) { | ||
| uniqueRaw = [] | ||
| data = await data.filter(async (value, index) => { | ||
| if (dupIndex.indexOf(index) == -1) { | ||
@@ -88,13 +90,13 @@ return true; | ||
| }); | ||
| dupIndex = [] | ||
| misc.lineToLog('Updating gathered data to the stored data. Please wait.') | ||
| await chillout.forEach(unique2, uniq2 => { | ||
| let uniqueFinder = duplicates.filter(x => x.team_id == uniq2.team_id && x.mana_cap == uniq2.mana_cap && x.ruleset == uniq2.ruleset); | ||
| unique2.forEach(element => { | ||
| let uniqueFinder = duplicates.filter(x => x.team_id == element.team_id && x.mana_cap == element.mana_cap && x.ruleset == element.ruleset); | ||
| if (uniqueFinder.length > 0) { | ||
| updatedUnique.push({ | ||
| team_id: uniqueFinder[0].team_id, mana_cap: uniqueFinder[0].mana_cap, ruleset: uniqueFinder[0].ruleset, | ||
| win: uniq2.win + uniqueFinder[0].win, draw: uniq2.draw + uniqueFinder[0].draw, lose: uniq2.lose + uniqueFinder[0].lose | ||
| win: element.win + uniqueFinder[0].win, draw: element.draw + uniqueFinder[0].draw, lose: element.lose + uniqueFinder[0].lose | ||
| }) | ||
| } | ||
| }) | ||
| }); | ||
@@ -101,0 +103,0 @@ battlesList = data.concat(unique).concat(updatedUnique); |
+1
-1
| { | ||
| "name": "lib-xtr", | ||
| "version": "1.0.15", | ||
| "version": "1.0.16", | ||
| "description": "", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
20011
0.21%421
0.72%