Skip to content

Commit

Permalink
[ci] Fix size comparison sort order (#17800)
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon authored Oct 9, 2019
1 parent 635ed7f commit 31d3008
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions dangerfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,10 @@ async function run() {
.map(([bundleId, size]) => [computeBundleLabel(bundleId), size])
// orderBy(|parsedDiff| DESC, |gzipDiff| DESC, name ASC)
.sort(([labelA, statsA], [labelB, statsB]) => {
const compareParsedDiff = Math.abs(
statsB.parsed.absoluteDiff - statsA.parsed.absoluteDiff,
);
const compareGzipDiff = Math.abs(statsB.gzip.absoluteDiff - statsA.gzip.absoluteDiff);
const compareParsedDiff =
Math.abs(statsB.parsed.absoluteDiff) - Math.abs(statsA.parsed.absoluteDiff);
const compareGzipDiff =
Math.abs(statsB.gzip.absoluteDiff) - Math.abs(statsA.gzip.absoluteDiff);
const compareName = labelA.localeCompare(labelB);

if (compareParsedDiff === 0 && compareGzipDiff === 0) {
Expand Down

0 comments on commit 31d3008

Please sign in to comment.