Skip to content

Commit a552f01

Browse files
committed
fix: resolve type errors and remove unused computed in name.vue
1 parent 90aadf8 commit a552f01

File tree

1 file changed

+4
-17
lines changed

1 file changed

+4
-17
lines changed

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

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -321,12 +321,11 @@ const latestVersion = computed(() => {
321321
return pkg.value.versions[latestTag] ?? null
322322
})
323323
324-
// Detect license changes between current version and latest
324+
// SlimVersion does not carry license, so we compare against the package-level license
325325
const licenseChanged = computed(() => {
326326
const currentLicense = displayVersion.value?.license
327-
const latestLicense = latestVersion.value?.license ?? pkg.value?.license
327+
const latestLicense = pkg.value?.license
328328
if (!currentLicense || !latestLicense) return false
329-
// Normalize: compare string representations
330329
const normalize = (l: unknown): string =>
331330
typeof l === 'string' ? l : (l as { type?: string })?.type ?? ''
332331
return normalize(currentLicense) !== normalize(latestLicense)
@@ -394,18 +393,6 @@ const sizeTooltip = computed(() => {
394393
return chunks.filter(Boolean).join('\n')
395394
})
396395
397-
const hasDependencies = computed(() => {
398-
if (!displayVersion.value) return false
399-
const deps = displayVersion.value.dependencies
400-
const peerDeps = displayVersion.value.peerDependencies
401-
const optionalDeps = displayVersion.value.optionalDependencies
402-
return (
403-
(deps && Object.keys(deps).length > 0) ||
404-
(peerDeps && Object.keys(peerDeps).length > 0) ||
405-
(optionalDeps && Object.keys(optionalDeps).length > 0)
406-
)
407-
})
408-
409396
// Vulnerability count for the stats banner
410397
const vulnCount = computed(() => vulnTree.value?.totalCounts.total ?? 0)
411398
const hasVulnerabilities = computed(() => vulnCount.value > 0)
@@ -610,11 +597,11 @@ const showSkeleton = shallowRef(false)
610597
{{ $t('package.stats.license') }}
611598
</dt>
612599
<dd class="font-mono text-sm text-fg flex items-center gap-2 flex-wrap">
613-
<LicenseDisplay v-if="displayVersion?.license ?? pkg.license" :license="displayVersion?.license ?? pkg.license" />
600+
<LicenseDisplay v-if="displayVersion?.license ?? pkg.license" :license="(displayVersion?.license ?? pkg.license) as string" />
614601
<span v-else>{{ $t('package.license.none') }}</span>
615602
<TooltipApp
616603
v-if="licenseChanged"
617-
:text="$t('package.license.changed', { latest: latestVersion?.license ?? pkg.license })"
604+
:text="$t('package.license.changed', { latest: pkg.license })"
618605
position="bottom"
619606
>
620607
<span class="inline-flex items-center gap-1 px-1.5 py-0.5 text-2xs font-sans rounded bg-amber-500/15 text-amber-700 dark:text-amber-400 border border-amber-500/30 cursor-help">

0 commit comments

Comments
 (0)