Skip to content

Commit

Permalink
fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
mydea committed Sep 2, 2024
1 parent e9ce11b commit 3247805
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions dev-packages/size-limit-gh-action/utils/SizeLimitFormatter.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ export class SizeLimitFormatter {
return bytes.format(size, { unitSeparator: ' ' });
}

formatSizeLimitResult(size, sizeLimit, passed) {
formatName(name, sizeLimit, passed) {
if (passed) {
return this.formatBytes(size);
return name;
}

return `⛔️ ${this.formatBytes(size)}\n(max: ${this.formatBytes(sizeLimit)})`;
return `⛔️ ${name} (max: ${this.formatBytes(sizeLimit)})`;
}

formatPercentageChange(base = 0, current = 0) {
Expand Down Expand Up @@ -72,8 +72,8 @@ export class SizeLimitFormatter {

formatSizeResult(name, base, current) {
return [
name,
this.formatSizeLimitResult(current.size, current.sizeLimit, current.passed),
this.formatName(name, current.sizeLimit, current.passed),
this.formatBytes(current.size),
this.formatPercentageChange(base.size, current.size),
this.formatChange(base.size, current.size),
];
Expand Down

0 comments on commit 3247805

Please sign in to comment.