Skip to content

Commit 22c905a

Browse files
committed
feat: add "v" before version number on badges
In other places, we show package version number with "v" prefix, which also helps recognizing what number we're actually looking at.
1 parent 7fe73b0 commit 22c905a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ async function fetchInstallSize(packageName: string, version: string): Promise<n
123123

124124
const badgeStrategies = {
125125
'version': async (pkgData: globalThis.Packument, requestedVersion?: string) => {
126-
const value = requestedVersion ?? getLatestVersion(pkgData) ?? 'unknown'
127-
return { label: 'version', value, color: COLORS.blue }
126+
const version = requestedVersion ?? getLatestVersion(pkgData) ?? 'unknown'
127+
return { label: 'version', value: `v${version}`, color: COLORS.blue }
128128
},
129129

130130
'license': async (pkgData: globalThis.Packument) => {

0 commit comments

Comments
 (0)