Skip to content

Commit

Permalink
Merge pull request #78 from npm/gar/normalize-manifest
Browse files Browse the repository at this point in the history
fix(registry): normalize registry manifests
  • Loading branch information
wraithgar committed Apr 23, 2021
2 parents 42e977a + 14264d2 commit d97e2fb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/registry.js
Expand Up @@ -3,6 +3,7 @@ const RemoteFetcher = require('./remote.js')
const _tarballFromResolved = Symbol.for('pacote.Fetcher._tarballFromResolved')
const pacoteVersion = require('../package.json').version
const npa = require('npm-package-arg')
const rpj = require('read-package-json-fast')
const pickManifest = require('npm-pick-manifest')
const ssri = require('ssri')
const Minipass = require('minipass')
Expand Down Expand Up @@ -156,7 +157,8 @@ class RegistryFetcher extends Fetcher {
}
if (this.integrity)
mani._integrity = String(this.integrity)
return this.package = mani
this.package = rpj.normalize(mani)
return this.package
})
}

Expand Down
2 changes: 1 addition & 1 deletion test/registry.js
Expand Up @@ -61,7 +61,7 @@ t.test('underscore, no tag or version', t => {
return f.resolve().then(r => t.equal(r, `${registry}underscore/-/underscore-1.5.1.tgz`))
.then(() => f.manifest()).then(m => {
t.equal(m, f.package)
t.match(m, { version: '1.5.1' })
t.match(m, { version: '1.5.1', _id: 'underscore@1.5.1' })
return f.manifest().then(m2 => t.equal(m, m2, 'manifest cached'))
})
.then(() => f.extract(me + '/underscore'))
Expand Down

0 comments on commit d97e2fb

Please sign in to comment.