Skip to content

Commit bf9ab39

Browse files
committed
fix: apply coderabbit suggestion
1 parent 02c9802 commit bf9ab39

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

app/utils/charts.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -544,8 +544,9 @@ export function createAltTextForVersionsBarChart({
544544
if (!dataset) return ''
545545

546546
const series = dataset.bars[0]?.series ?? []
547-
const versions = series.map((value, i) => ({
548-
name: config.datapointLabels[i] ?? '-',
547+
const versions = series.map((value, index) => ({
548+
index,
549+
name: config.datapointLabels[index] ?? '-',
549550
rawDownloads: value ?? 0,
550551
downloads: config.numberFormatter(value ?? 0),
551552
}))
@@ -557,7 +558,7 @@ export function createAltTextForVersionsBarChart({
557558

558559
const per_version_analysis = versions
559560
?.toReversed()
560-
.filter(v => v.name !== versionWithMaxDownloads?.name)
561+
.filter(v => v.index !== versionWithMaxDownloads?.index)
561562
.map(v =>
562563
config.$t(`package.versions.copy_alt.per_version_analysis`, {
563564
version: v?.name ?? '-',

0 commit comments

Comments
 (0)