File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ?? '-' ,
You can’t perform that action at this time.
0 commit comments