source: trip-planner-front/node_modules/cacache/lib/content/rm.js@ 76712b2

Last change on this file since 76712b2 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 499 bytes
Line 
1'use strict'
2
3const util = require('util')
4
5const contentPath = require('./path')
6const { hasContent } = require('./read')
7const rimraf = util.promisify(require('rimraf'))
8
9module.exports = rm
10
11function rm (cache, integrity) {
12 return hasContent(cache, integrity).then((content) => {
13 // ~pretty~ sure we can't end up with a content lacking sri, but be safe
14 if (content && content.sri)
15 return rimraf(contentPath(cache, content.sri)).then(() => true)
16 else
17 return false
18 })
19}
Note: See TracBrowser for help on using the repository browser.