pacote 13.0.6 → 13.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/fetcher.js CHANGED
@@ -105,6 +105,9 @@ class FetcherBase {
105
105
  this[_readPackageJson] = readPackageJsonFast
106
106
  }
107
107
 
108
+ // config values: npmjs (default), never
109
+ this.replaceRegistryHost = opts.replaceRegistryHost === 'never' ? 'never' : 'npmjs'
110
+
108
111
  this.defaultTag = opts.defaultTag || 'latest'
109
112
  this.registry = removeTrailingSlashes(opts.registry || 'https://registry.npmjs.org')
110
113
 
package/lib/remote.js CHANGED
@@ -13,7 +13,9 @@ class RemoteFetcher extends Fetcher {
13
13
  constructor (spec, opts) {
14
14
  super(spec, opts)
15
15
  this.resolved = this.spec.fetchSpec
16
- if (magic.test(this.resolved) && !magic.test(this.registry + '/')) {
16
+ if (this.replaceRegistryHost === 'npmjs'
17
+ && magic.test(this.resolved)
18
+ && !magic.test(this.registry + '/')) {
17
19
  this.resolved = this.resolved.replace(magic, this.registry + '/')
18
20
  }
19
21
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pacote",
3
- "version": "13.0.6",
3
+ "version": "13.1.0",
4
4
  "description": "JavaScript package downloader",
5
5
  "author": "GitHub Inc.",
6
6
  "bin": {
@@ -29,6 +29,7 @@
29
29
  "@npmcli/template-oss": "3.2.2",
30
30
  "hosted-git-info": "^5.0.0",
31
31
  "mutate-fs": "^2.1.1",
32
+ "nock": "^13.2.4",
32
33
  "npm-registry-mock": "^1.3.1",
33
34
  "tap": "^16.0.1"
34
35
  },