[READ-ONLY] a fast, modern browser for the npm registry
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

perf: avoid unnecessary npm request for custom badge (#482)

authored by

btea and committed by
GitHub
8aa5bee5 77b9103a

+2 -2
+2 -2
server/api/registry/badge/[...pkg].get.ts
··· 30 30 31 31 const label = `./ ${packageName}` 32 32 33 - const packument = await fetchNpmPackage(packageName) 34 - const value = requestedVersion ?? packument['dist-tags']?.latest ?? 'unknown' 33 + const value = 34 + requestedVersion ?? (await fetchNpmPackage(packageName))['dist-tags']?.latest ?? 'unknown' 35 35 36 36 const leftWidth = measureTextWidth(label) 37 37 const rightWidth = measureTextWidth(value)