Skip to content

Commit 9e467d0

Browse files
committed
fix: add name type
1 parent 89d5ebf commit 9e467d0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

server/api/registry/badge/[type]/[...pkg].get.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,10 @@ async function fetchInstallSize(packageName: string, version: string): Promise<n
289289
}
290290

291291
const badgeStrategies = {
292+
'name': async (pkgData: globalThis.Packument) => {
293+
return { label: 'npm', value: pkgData.name, color: COLORS.slate }
294+
},
295+
292296
'version': async (pkgData: globalThis.Packument, requestedVersion?: string) => {
293297
const version = requestedVersion ?? getLatestVersion(pkgData) ?? 'unknown'
294298
return {

0 commit comments

Comments
 (0)