sindresorhus/quick-lru

How to get the `maxSize` of a cache instance?

tbontb-iaq opened this issue · 2 comments

const cache = new QuickLRU({ maxSize: 10 });

/// cache.maxSize ???

When using resize to update maxSize, you may need to compare the new and old maxSizes.

Quick job.
It can be obtained through maxSize, but it must be set through resize.
Is it better to define the getter and setter for maxSize?

Yeah, not worth removing resize, but we could make maxSize setter just call it internally.