summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/cacache/lib/verify.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules/cacache/lib/verify.js')
-rw-r--r--deps/npm/node_modules/cacache/lib/verify.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/deps/npm/node_modules/cacache/lib/verify.js b/deps/npm/node_modules/cacache/lib/verify.js
index 33f566c12a..62e85c9464 100644
--- a/deps/npm/node_modules/cacache/lib/verify.js
+++ b/deps/npm/node_modules/cacache/lib/verify.js
@@ -100,7 +100,11 @@ async function garbageCollect (cache, opts) {
return
}
- liveContent.add(entry.integrity.toString())
+ // integrity is stringified, re-parse it so we can get each hash
+ const integrity = ssri.parse(entry.integrity)
+ for (const algo in integrity) {
+ liveContent.add(integrity[algo].toString())
+ }
})
await new Promise((resolve, reject) => {
indexStream.on('end', resolve).on('error', reject)
@@ -220,6 +224,7 @@ async function rebuildBucket (cache, bucket, stats, opts) {
await index.insert(cache, entry.key, entry.integrity, {
metadata: entry.metadata,
size: entry.size,
+ time: entry.time,
})
stats.totalEntries++
} catch (err) {