Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/cacache/lib/content/rm.js')
-rw-r--r--node_modules/cacache/lib/content/rm.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/node_modules/cacache/lib/content/rm.js b/node_modules/cacache/lib/content/rm.js
index a8903dc0e..12cf15823 100644
--- a/node_modules/cacache/lib/content/rm.js
+++ b/node_modules/cacache/lib/content/rm.js
@@ -9,9 +9,13 @@ const rimraf = BB.promisify(require('rimraf'))
module.exports = rm
function rm (cache, integrity) {
return hasContent(cache, integrity).then(content => {
- const sri = content.sri
- if (sri) {
- return rimraf(contentPath(cache, sri))
+ if (content) {
+ const sri = content.sri
+ if (sri) {
+ return rimraf(contentPath(cache, sri)).then(() => true)
+ }
+ } else {
+ return false
}
})
}