Skip to content

Commit 7dfbc87

Browse files
committed
debug sizes more...
1 parent 956b657 commit 7dfbc87

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

dev-packages/size-limit-gh-action/utils/SizeLimitFormatter.mjs

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import * as core from '@actions/core';
12
import bytes from 'bytes';
23

34
const SIZE_RESULTS_HEADER = ['Path', 'Size', '% Change', 'Change'];
@@ -97,17 +98,28 @@ export class SizeLimitFormatter {
9798
}
9899

99100
hasSizeChanges(base, current, threshold = 0) {
100-
if(!base || !current) {
101+
if (!base || !current) {
101102
return true;
102103
}
103104

104-
const names = [...new Set([...(Object.keys(base)), ...Object.keys(current)])];
105+
const names = [...new Set([...Object.keys(base), ...Object.keys(current)])];
106+
107+
core.debug('hasSizeChanges....', names);
105108

106109
return names.some(name => {
107110
const baseResult = base[name] || EmptyResult;
108111
const currentResult = current[name] || EmptyResult;
109112

110-
if (baseResult.size === 0 || currentResult.size === 0) {
113+
// DEBUGGING?!
114+
core.debug(
115+
'comparing...',
116+
name,
117+
baseResult.size,
118+
currentResult.size,
119+
Math.abs((currentResult.size - baseResult.size) / baseResult.size) * 100 > threshold,
120+
);
121+
122+
if (!baseResult.size || !currentResult.size) {
111123
return true;
112124
}
113125

0 commit comments

Comments
 (0)