Skip to content

Commit 9e30e9f

Browse files
committed
Apply CR suggestions
1 parent e01c4aa commit 9e30e9f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

app/pages/package/[...package].vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ const publishSecurityDowngrade = computed(() => {
244244
245245
const installVersionOverride = computed(() => {
246246
if (!publishSecurityDowngrade.value) return null
247-
return publishSecurityDowngrade.value?.trustedVersion ?? null
247+
return publishSecurityDowngrade.value.trustedVersion
248248
})
249249
250250
const sizeTooltip = computed(() => {

app/utils/publish-security.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export function detectPublishSecurityDowngrade(
5353
}))
5454
.sort(sortByRecency)
5555

56-
const latest = sorted[0]
56+
const latest = sorted.at(0)
5757
if (!latest || latest.hasProvenance) return null
5858

5959
const latestTrusted = sorted.find(version => version.hasProvenance)
@@ -89,7 +89,7 @@ export function detectPublishSecurityDowngradeForVersion(
8989
const currentIndex = sorted.findIndex(version => version.version === viewedVersion)
9090
if (currentIndex === -1) return null
9191

92-
const current = sorted[currentIndex]
92+
const current = sorted.at(currentIndex)
9393
if (!current || current.hasProvenance) return null
9494

9595
const trustedOlder = sorted.slice(currentIndex + 1).find(version => version.hasProvenance)

0 commit comments

Comments
 (0)