Skip to content

Commit

Permalink
fix(maxAge): delete cache entries older than max age.
Browse files Browse the repository at this point in the history
Fixes #14
  • Loading branch information
keithamus committed Feb 21, 2018
1 parent 74439cc commit aedb787
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions index.js
Expand Up @@ -29,6 +29,8 @@ module.exports = (fn, opts) => {
if (typeof opts.maxAge !== 'number' || Date.now() < c.maxAge) {
return c.data;
}

cache.delete(key);
}

const ret = fn.apply(this, arguments);
Expand Down

0 comments on commit aedb787

Please sign in to comment.