Skip to content

Commit 6da139c

Browse files
committed
fix it
1 parent f573eb5 commit 6da139c

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

dev-packages/size-limit-gh-action/index.mjs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,16 @@ async function fetchPreviousComment(octokit, repo, pr) {
2727
}
2828

2929
class SizeLimit {
30-
formatBytes(size, sizeLimit, passed) {
30+
formatBytes(size) {
31+
return bytes.format(size, { unitSeparator: ' ' });
32+
}
33+
34+
formatSizeLimitResult(size, sizeLimit, passed) {
3135
if (passed) {
32-
return bytes.format(size, { unitSeparator: ' ' });
36+
return this.formatBytes(size);
3337
}
3438

35-
return `⛔️ ${bytes.format(size, { unitSeparator: ' ' })} (max: ${bytes.format(sizeLimit, { unitSeparator: ' ' })})`;
39+
return `⛔️ ${this.formatBytes(size)} (max: ${this.formatBytes(sizeLimit)})`;
3640
}
3741

3842
formatPercentageChange(base = 0, current = 0) {
@@ -88,7 +92,7 @@ class SizeLimit {
8892
formatSizeResult(name, base, current) {
8993
return [
9094
name,
91-
this.formatBytes(current.size, current.sizeLimit, current.passed),
95+
this.formatSizeLimitResult(current.size, current.sizeLimit, current.passed),
9296
this.formatPercentageChange(base.size, current.size),
9397
this.formatChange(base.size, current.size),
9498
];

0 commit comments

Comments
 (0)