Skip to content

Commit

Permalink
feat: add .has() method in cache/ttl lib
Browse files Browse the repository at this point in the history
  • Loading branch information
julianlam committed Oct 2, 2023
1 parent 857433d commit d478de1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/cache/ttl.js
Expand Up @@ -30,6 +30,14 @@ module.exports = function (opts) {
});
});

cache.has = (key) => {
if (!cache.enabled) {
return false;
}

return ttlCache.has(key);
};

cache.set = function (key, value, ttl) {
if (!cache.enabled) {
return;
Expand Down

0 comments on commit d478de1

Please sign in to comment.