Skip to content

Commit df7d8c2

Browse files
committed
fix: don't diff install size with first version
Most initial versions are empty or unfinished, so generally show up as a large bump in file size to the 2nd version. This is misleading so we should just skip those.
1 parent 230b7c7 commit df7d8c2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/composables/useInstallSizeDiff.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ function getComparisonVersion(pkg: SlimPackument, resolvedVersion: string): stri
3131
.sort((a, b) => compare(a, b))
3232

3333
const currentIdx = stableVersions.indexOf(resolvedVersion)
34-
if (currentIdx <= 0) return null
34+
// Don't compare the second version against the first as the first
35+
// has no baseline so a large size difference is expected
36+
if (currentIdx <= 1) return null
3537

3638
return stableVersions[currentIdx - 1]!
3739
}

0 commit comments

Comments
 (0)