feat: if third argument is a number to `set(key, value, opts || maxAge)`, then assume it is `maxAge`
titanism opened this issue · 3 comments
titanism commented
In
Line 115 in 7713928
ioredis
, it would be nice (and backwards compatible) if you pass a third argument that is not an Object, but a Number. If a Number, it would be inferred as options.maxAge
value.titanism commented
@sindresorhus please see #43! 🎉
titanism commented
Current workaround until this PR is merged and released to npm:
const cache = new QuickLRU(this.options.quickLRU);
const set = cache.set;
cache.set = function(key, value, maxAge) {
set.call(cache, key, value, { maxAge });
}
sindresorhus commented
I'm not interested in this, sorry. I don't want my API to be worse just to be compatible with another random package.