Skip to content
This repository has been archived by the owner on Jul 3, 2019. It is now read-only.

Commit

Permalink
feat(rm): added memoization support to rm
Browse files Browse the repository at this point in the history
  • Loading branch information
zkat committed Mar 2, 2017
1 parent c77d794 commit 4205cf0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion rm.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,25 @@

const Promise = require('bluebird')

const rmContent = require('./lib/content/rm')
const index = require('./lib/entry-index')
const memo = require('./lib/memoization')
const rimraf = Promise.promisify(require('rimraf'))
const rmContent = require('./lib/content/rm')

module.exports.all = all
function all (cache) {
memo.clearMemoized()
return rimraf(cache)
}

module.exports.entry = entry
function entry (cache, key) {
memo.clearMemoized()
return index.delete(cache, key)
}

module.exports.content = content
function content (cache, address) {
memo.clearMemoized()
return rmContent(cache, address)
}

0 comments on commit 4205cf0

Please sign in to comment.