mirror of
https://github.com/nodejs/node.git
synced 2025-05-15 11:36:57 +00:00

PR-URL: https://github.com/nodejs/node/pull/35474 Reviewed-By: Ruy Adorno <ruyadorno@github.com> Reviewed-By: Ujjwal Sharma <ryzokuken@disroot.org> Reviewed-By: Ben Coe <bencoe@gmail.com> Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Shelley Vohr <codebytere@gmail.com> Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
32 lines
664 B
JavaScript
32 lines
664 B
JavaScript
'use strict'
|
|
|
|
const util = require('util')
|
|
|
|
const index = require('./lib/entry-index')
|
|
const memo = require('./lib/memoization')
|
|
const path = require('path')
|
|
const rimraf = util.promisify(require('rimraf'))
|
|
const rmContent = require('./lib/content/rm')
|
|
|
|
module.exports = entry
|
|
module.exports.entry = entry
|
|
|
|
function entry (cache, key) {
|
|
memo.clearMemoized()
|
|
return index.delete(cache, key)
|
|
}
|
|
|
|
module.exports.content = content
|
|
|
|
function content (cache, integrity) {
|
|
memo.clearMemoized()
|
|
return rmContent(cache, integrity)
|
|
}
|
|
|
|
module.exports.all = all
|
|
|
|
function all (cache) {
|
|
memo.clearMemoized()
|
|
return rimraf(path.join(cache, '*(content-*|index-*)'))
|
|
}
|