nodeshift / opossum

Node.js circuit breaker - fails fast ⚡️
https://nodeshift.dev/opossum/
Apache License 2.0
1.31k stars 107 forks source link

Incorrect default value of maxEntries for MemoryCache #904

Open IvanPenga opened 1 day ago

IvanPenga commented 1 day ago

Added in opossum version 8.2.0, if cacheSize property is not provided to MemoryCache constructor, it will default to 2 ^ 24 - 1, which is 21, because caret (^) operator is bitwise operator, not exponentiation operator. This should be replaced with ** operator, or Math.pow function.