1'use strict' 2 3const BB = require('bluebird') 4 5const index = require('./lib/entry-index') 6const memo = require('./lib/memoization') 7const path = require('path') 8const rimraf = BB.promisify(require('rimraf')) 9const rmContent = require('./lib/content/rm') 10 11module.exports = entry 12module.exports.entry = entry 13function entry (cache, key) { 14 memo.clearMemoized() 15 return index.delete(cache, key) 16} 17 18module.exports.content = content 19function content (cache, integrity) { 20 memo.clearMemoized() 21 return rmContent(cache, integrity) 22} 23 24module.exports.all = all 25function all (cache) { 26 memo.clearMemoized() 27 return rimraf(path.join(cache, '*(content-*|index-*)')) 28} 29