fix number sort bug
This commit is contained in:
parent
d6dd12d466
commit
4b77b4fdbe
@ -165,7 +165,9 @@ Pokemon.forEach((mon) => {
|
||||
Object.keys(pokemon.pvp).forEach((key) => {
|
||||
const league = key as League;
|
||||
|
||||
const orderedCombinedStats = Object.keys(combinedStatsDistribution[league]).map((cpTotal) => parseInt(cpTotal, 10)).sort();
|
||||
const orderedCombinedStats = Object.keys(combinedStatsDistribution[league]).map((cpTotal) => parseInt(cpTotal, 10));
|
||||
orderedCombinedStats.sort((a, b) => a - b);
|
||||
|
||||
const len = orderedCombinedStats.length - 1;
|
||||
const offset = orderedCombinedStats[1];
|
||||
const max = orderedCombinedStats[len] - offset; // index 0 is always `Grade.S`
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user