Skip to content

Commit 7cd72dd

Browse files
committed
some more debug & changes
1 parent 2330269 commit 7cd72dd

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ async function run() {
181181
}
182182
} else {
183183
core.debug('Skipping comment because there are no changes.');
184+
core.debug(`Base result:\n\n${base}`);
184185
}
185186

186187
if (status > 0) {

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,17 @@ export class SizeLimitFormatter {
9797
}
9898

9999
hasSizeChanges(base, current, threshold = 0) {
100-
const names = [...new Set([...(base ? Object.keys(base) : []), ...Object.keys(current)])];
100+
if(!base || !current) {
101+
return true;
102+
}
101103

102-
return !!names.find(name => {
103-
const baseResult = base?.[name] || EmptyResult;
104+
const names = [...new Set([...(Object.keys(base)), ...Object.keys(current)])];
105+
106+
return names.some(name => {
107+
const baseResult = base[name] || EmptyResult;
104108
const currentResult = current[name] || EmptyResult;
105109

106-
if (baseResult.size === 0 && currentResult.size === 0) {
110+
if (baseResult.size === 0 || currentResult.size === 0) {
107111
return true;
108112
}
109113

0 commit comments

Comments
 (0)