feat: add .has() method in cache/ttl lib

This commit is contained in:
Julian Lam
2023-09-29 17:02:03 -04:00
parent 857433d12a
commit d478de1635

8
src/cache/ttl.js vendored
View File

@@ -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;