summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/cacache/lib
diff options
context:
space:
mode:
authorFallenRiteMonk <fallenritemonk@gmail.com>2018-04-05 11:52:34 -0400
committerMyles Borins <mylesborins@google.com>2018-04-05 16:01:07 -0400
commit25a816dcda7b1db0929501acfe13f2fe5119759b (patch)
treed3df4377a11dfb643b5976d2048d9bb4ee527903 /deps/npm/node_modules/cacache/lib
parentb29c36b80746733994257b7380245102bc3c4cd6 (diff)
downloadnode-new-25a816dcda7b1db0929501acfe13f2fe5119759b.tar.gz
deps: upgrade npm to 5.8.0
PR-URL: https://github.com/nodejs/node/pull/19560 Fixes: https://github.com/nodejs/node/issues/19271 Reviewed-By: Michaƫl Zasso <targos@protonmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com>
Diffstat (limited to 'deps/npm/node_modules/cacache/lib')
-rw-r--r--deps/npm/node_modules/cacache/lib/content/read.js10
-rw-r--r--deps/npm/node_modules/cacache/lib/entry-index.js7
2 files changed, 14 insertions, 3 deletions
diff --git a/deps/npm/node_modules/cacache/lib/content/read.js b/deps/npm/node_modules/cacache/lib/content/read.js
index b09ad5cb40..7a4da3beb8 100644
--- a/deps/npm/node_modules/cacache/lib/content/read.js
+++ b/deps/npm/node_modules/cacache/lib/content/read.js
@@ -95,6 +95,16 @@ function pickContentSri (cache, integrity) {
return BB.any(sri[sri.pickAlgorithm()].map(meta => {
return pickContentSri(cache, meta)
}))
+ .catch(err => {
+ if ([].some.call(err, e => e.code === 'ENOENT')) {
+ throw Object.assign(
+ new Error('No matching content found for ' + sri.toString()),
+ {code: 'ENOENT'}
+ )
+ } else {
+ throw err[0]
+ }
+ })
}
}
diff --git a/deps/npm/node_modules/cacache/lib/entry-index.js b/deps/npm/node_modules/cacache/lib/entry-index.js
index face0fe79c..fe1cd06457 100644
--- a/deps/npm/node_modules/cacache/lib/entry-index.js
+++ b/deps/npm/node_modules/cacache/lib/entry-index.js
@@ -116,9 +116,10 @@ function lsStream (cache) {
}, new Map())
return getKeyToEntry.then(reduced => {
- return Array.from(reduced.values()).map(
- entry => stream.push(formatEntry(cache, entry))
- )
+ for (let entry of reduced.values()) {
+ const formatted = formatEntry(cache, entry)
+ formatted && stream.push(formatted)
+ }
}).catch({code: 'ENOENT'}, nop)
})
})