upgrade lru-memoize to v4 with backwards-compatible maxAge support#68
Merged
Conversation
- Bump @digitalbazaar/lru-memoize dependency from ^3.0.0 to ^4.0.0 - Translate v3-style `maxAge` option to v4-style `ttl` in CachedResolver constructor; if neither is provided the prior default of 5000ms is kept - `ttl` takes precedence when both `ttl` and `maxAge` are supplied - Update JSDoc to document `ttl` as the preferred option and `maxAge` as a deprecated v3 compatibility alias - Add test/CachedResolver.spec.js with full coverage of the constructor option-translation logic and all public methods (get, use, generate) - Update README Cache management section to reflect the renamed option
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #68 +/- ##
===========================================
+ Coverage 77.68% 88.91% +11.23%
===========================================
Files 4 4
Lines 345 361 +16
===========================================
+ Hits 268 321 +53
+ Misses 77 40 -37
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
dlongley
approved these changes
May 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
maxAgeoption to v4-stylettlin CachedResolver constructor; if neither is provided the prior default of 5000ms is keptttltakes precedence when bothttlandmaxAgeare suppliedttlas the preferred option andmaxAgeas a deprecated v3 compatibility alias