Skip to content

Instantly share code, notes, and snippets.

@isaacs
Last active October 23, 2019 01:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save isaacs/f5e33bff9eeab07aad1cc80a9a3c2425 to your computer and use it in GitHub Desktop.
Save isaacs/f5e33bff9eeab07aad1cc80a9a3c2425 to your computer and use it in GitHub Desktop.
diff --git a/cache.js b/cache.js
index ee2ba68..ff7e1a4 100644
--- a/cache.js
+++ b/cache.js
@@ -65,10 +65,10 @@ module.exports = class Cache {
// avoid opening cache file handles until a user actually tries to
// read from it.
const body = new Minipass()
- const notFitInMemory = false && info.size > MAX_MEM_SIZE
+ const fitInMemory = info.size < MAX_MEM_SIZE
const removeOnResume = () => body.removeListener('resume', onResume)
const onResume =
- opts.memoize !== notFitInMemory
+ opts.memoize !== false && fitInMemory
? () => {
const c = cacache.get.stream.byDigest(cachePath, info.integrity, {
memoize: opts.memoize
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment