@@ -27,12 +27,16 @@ async function fetchPreviousComment(octokit, repo, pr) {
27
27
}
28
28
29
29
class SizeLimit {
30
- formatBytes ( size , sizeLimit , passed ) {
30
+ formatBytes ( size ) {
31
+ return bytes . format ( size , { unitSeparator : ' ' } ) ;
32
+ }
33
+
34
+ formatSizeLimitResult ( size , sizeLimit , passed ) {
31
35
if ( passed ) {
32
- return bytes . format ( size , { unitSeparator : ' ' } ) ;
36
+ return this . formatBytes ( size ) ;
33
37
}
34
38
35
- return `⛔️ ${ bytes . format ( size , { unitSeparator : ' ' } ) } (max: ${ bytes . format ( sizeLimit , { unitSeparator : ' ' } ) } )` ;
39
+ return `⛔️ ${ this . formatBytes ( size ) } (max: ${ this . formatBytes ( sizeLimit ) } )` ;
36
40
}
37
41
38
42
formatPercentageChange ( base = 0 , current = 0 ) {
@@ -88,7 +92,7 @@ class SizeLimit {
88
92
formatSizeResult ( name , base , current ) {
89
93
return [
90
94
name ,
91
- this . formatBytes ( current . size , current . sizeLimit , current . passed ) ,
95
+ this . formatSizeLimitResult ( current . size , current . sizeLimit , current . passed ) ,
92
96
this . formatPercentageChange ( base . size , current . size ) ,
93
97
this . formatChange ( base . size , current . size ) ,
94
98
] ;
0 commit comments