pacote 13.6.1 → 13.6.2

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/bin.js CHANGED
@@ -18,10 +18,15 @@ const run = conf => {
18
18
  case 'tarball':
19
19
  if (!conf._[2] || conf._[2] === '-') {
20
20
  return pacote.tarball.stream(conf._[1], stream => {
21
- stream.pipe(conf.testStdout ||
22
- /* istanbul ignore next */ process.stdout)
21
+ stream.pipe(
22
+ conf.testStdout ||
23
+ /* istanbul ignore next */
24
+ process.stdout
25
+ )
23
26
  // make sure it resolves something falsey
24
- return stream.promise().then(() => {})
27
+ return stream.promise().then(() => {
28
+ return false
29
+ })
25
30
  }, conf)
26
31
  } else {
27
32
  return pacote.tarball.file(conf._[1], conf._[2], conf)
package/lib/fetcher.js CHANGED
@@ -254,6 +254,7 @@ class FetcherBase {
254
254
  cstream.on('error', err => stream.emit('error', err))
255
255
  stream.pipe(cstream)
256
256
 
257
+ // eslint-disable-next-line promise/catch-or-return
257
258
  cstream.promise().catch(() => {}).then(() => middleStream.end())
258
259
  return middleStream
259
260
  }
@@ -269,7 +270,10 @@ class FetcherBase {
269
270
  }
270
271
 
271
272
  // override the types getter
272
- get types () {}
273
+ get types () {
274
+ return false
275
+ }
276
+
273
277
  [_assertType] () {
274
278
  if (this.types && !this.types.includes(this.spec.type)) {
275
279
  throw new TypeError(`Wrong spec type (${
package/lib/git.js CHANGED
@@ -239,7 +239,7 @@ class GitFetcher extends Fetcher {
239
239
  tarballOk = tarballOk &&
240
240
  h && resolved === repoUrl(h, { noCommittish: false }) && h.tarball
241
241
 
242
- return cacache.tmp.withTmp(this.cache, o, tmp => {
242
+ return cacache.tmp.withTmp(this.cache, o, async tmp => {
243
243
  // if we're resolved, and have a tarball url, shell out to RemoteFetcher
244
244
  if (tarballOk) {
245
245
  const nameat = this.spec.name ? `${this.spec.name}@` : ''
@@ -259,16 +259,15 @@ class GitFetcher extends Fetcher {
259
259
  })
260
260
  }
261
261
 
262
- return (
262
+ const sha = await (
263
263
  h ? this[_cloneHosted](ref, tmp)
264
264
  : this[_cloneRepo](this.spec.fetchSpec, ref, tmp)
265
- ).then(sha => {
266
- this.resolvedSha = sha
267
- if (!this.resolved) {
268
- this[_addGitSha](sha)
269
- }
270
- })
271
- .then(() => handler(tmp))
265
+ )
266
+ this.resolvedSha = sha
267
+ if (!this.resolved) {
268
+ await this[_addGitSha](sha)
269
+ }
270
+ return handler(tmp)
272
271
  })
273
272
  }
274
273
 
package/lib/remote.js CHANGED
@@ -41,6 +41,7 @@ class RemoteFetcher extends Fetcher {
41
41
  algorithms: [this.pickIntegrityAlgorithm()],
42
42
  }
43
43
 
44
+ // eslint-disable-next-line promise/always-return
44
45
  fetch(this.resolved, fetchOpts).then(res => {
45
46
  res.body.on('error',
46
47
  /* istanbul ignore next - exceedingly rare and hard to simulate */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pacote",
3
- "version": "13.6.1",
3
+ "version": "13.6.2",
4
4
  "description": "JavaScript package downloader",
5
5
  "author": "GitHub Inc.",
6
6
  "bin": {