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 d2c8475
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions index.js
Expand Up @@ -28,6 +28,8 @@ module.exports = (fn, opts) => {

if (typeof opts.maxAge !== 'number' || Date.now() < c.maxAge) {
return c.data;
} else {
cache.delete(key);
}
}

Expand Down

0 comments on commit d2c8475

Please sign in to comment.