summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/pacote/lib/fetchers/registry/tarball.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules/pacote/lib/fetchers/registry/tarball.js')
-rw-r--r--deps/npm/node_modules/pacote/lib/fetchers/registry/tarball.js11
1 files changed, 5 insertions, 6 deletions
diff --git a/deps/npm/node_modules/pacote/lib/fetchers/registry/tarball.js b/deps/npm/node_modules/pacote/lib/fetchers/registry/tarball.js
index 7239981279..134153280e 100644
--- a/deps/npm/node_modules/pacote/lib/fetchers/registry/tarball.js
+++ b/deps/npm/node_modules/pacote/lib/fetchers/registry/tarball.js
@@ -2,18 +2,17 @@
const BB = require('bluebird')
-const fetch = require('./fetch')
+const fetch = require('npm-registry-fetch')
const manifest = require('./manifest')
const optCheck = require('../../util/opt-check')
const PassThrough = require('stream').PassThrough
-const pickRegistry = require('./pick-registry')
const ssri = require('ssri')
const url = require('url')
module.exports = tarball
function tarball (spec, opts) {
opts = optCheck(opts)
- const registry = pickRegistry(spec, opts)
+ const registry = fetch.pickRegistry(spec, opts)
const stream = new PassThrough()
let mani
if (
@@ -49,11 +48,11 @@ function tarball (spec, opts) {
module.exports.fromManifest = fromManifest
function fromManifest (manifest, spec, opts) {
opts = optCheck(opts)
- opts.scope = spec.scope || opts.scope
+ if (spec.scope) { opts = opts.concat({ scope: spec.scope }) }
const stream = new PassThrough()
- const registry = pickRegistry(spec, opts)
+ const registry = fetch.pickRegistry(spec, opts)
const uri = getTarballUrl(spec, registry, manifest, opts)
- fetch(uri, registry, Object.assign({
+ fetch(uri, opts.concat({
headers: {
'pacote-req-type': 'tarball',
'pacote-pkg-id': `registry:${manifest.name}@${uri}`