cacache 15.0.5 → 15.3.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/put.js CHANGED
@@ -9,7 +9,7 @@ const Pipeline = require('minipass-pipeline')
9
9
 
10
10
  const putOpts = (opts) => ({
11
11
  algorithms: ['sha512'],
12
- ...opts
12
+ ...opts,
13
13
  })
14
14
 
15
15
  module.exports = putData
@@ -21,9 +21,9 @@ function putData (cache, key, data, opts = {}) {
21
21
  return index
22
22
  .insert(cache, key, res.integrity, { ...opts, size: res.size })
23
23
  .then((entry) => {
24
- if (memoize) {
24
+ if (memoize)
25
25
  memo.put(cache, entry, data, opts)
26
- }
26
+
27
27
  return res.integrity
28
28
  })
29
29
  })
@@ -67,17 +67,16 @@ function putStream (cache, key, opts = {}) {
67
67
  return index
68
68
  .insert(cache, key, integrity, { ...opts, size })
69
69
  .then((entry) => {
70
- if (memoize && memoData) {
70
+ if (memoize && memoData)
71
71
  memo.put(cache, entry, memoData, opts)
72
- }
73
- if (integrity) {
72
+
73
+ if (integrity)
74
74
  pipeline.emit('integrity', integrity)
75
- }
76
- if (size) {
75
+
76
+ if (size)
77
77
  pipeline.emit('size', size)
78
- }
79
78
  })
80
- }
79
+ },
81
80
  }))
82
81
 
83
82
  return pipeline
package/rm.js CHANGED
@@ -11,9 +11,9 @@ const rmContent = require('./lib/content/rm')
11
11
  module.exports = entry
12
12
  module.exports.entry = entry
13
13
 
14
- function entry (cache, key) {
14
+ function entry (cache, key, opts) {
15
15
  memo.clearMemoized()
16
- return index.delete(cache, key)
16
+ return index.delete(cache, key, opts)
17
17
  }
18
18
 
19
19
  module.exports.content = content