This patch release fixes behavior of resultEqualityCheck
in weakMapMemoize
, fixes the case of lruMemoize
being given a maxSize
less than 1, and tweaks the internal implementation of lruMemoize
. (We've also updated our general build tooling.)
Changelog
Bug fixes
Previously, providing the resultEqualityCheck
option to weakMapMemoize
resulted in it being called with empty objects as part of the initialization / dev check process. That could be an issue if your comparison function expected different values. We've updated the logic to avoid that, as well as improving a couple other perf aspects.
Previously, passing a maxSize
< 1 to lruMemoize
would result in it creating a larger cache. That's now fixed.
lruMemoize
now uses a symbol for its NOT_FOUND
value instead of a string.
What's Changed
- Ensure
lruMemoize
correctly memoizes whenmaxSize
is set to a number less than 1 by @aryaemami59 in #698 - Fix
resultEqualityCheck
behavior inweakMapMemoize
by @aryaemami59 in #699 - Update TypeScript to 5.4 by @aryaemami59 in #708
- Upgrade to Yarn 4 by @aryaemami59 in #705
- Fix: use unique value for NOT_FOUND by @romgrk in #709
Full Changelog: v5.1.0...v5.1.1