Skip to content

Commit

Permalink
Fix pacote.manifest condition (#1351).
Browse files Browse the repository at this point in the history
  • Loading branch information
raineorshine committed Nov 19, 2023
1 parent c4a8786 commit 1805e9e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/package-managers/npm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -450,12 +450,13 @@ async function viewMany(
let result: any
try {
// when just fetching the dist-tag, use pacote.manifest instead of pacote.packument for a much smaller payload
if (fieldsExtended.length === 1 && fieldsExtended[0] === 'dist-tags.') {
if (fieldsExtended.length === 1 && fieldsExtended[0].startsWith('dist-tags.')) {
const [, tag] = fieldsExtended[0].split('dist-tags')
const manifest = await pacote.manifest(packageName, npmConfigMerged)
result = {
[`dist-tags.${tag}`]: {
name: packageName,
version: (await pacote.manifest(packageName, npmConfigMerged))?.version,
version: manifest?.version,
},
}
} else {
Expand Down

0 comments on commit 1805e9e

Please sign in to comment.