Skip to content

upgrade lru-memoize to v4 with backwards-compatible maxAge support#68

Merged
dlongley merged 3 commits into
mainfrom
upgrade-lru-memoize-v4
May 16, 2026
Merged

upgrade lru-memoize to v4 with backwards-compatible maxAge support#68
dlongley merged 3 commits into
mainfrom
upgrade-lru-memoize-v4

Conversation

@djscruggs
Copy link
Copy Markdown
Contributor

  • 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

- 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-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.91%. Comparing base (63adaab) to head (2265600).

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     
Files with missing lines Coverage Δ
lib/CachedResolver.js 100.00% <100.00%> (+37.75%) ⬆️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 63adaab...2265600. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@djscruggs djscruggs requested a review from dlongley May 15, 2026 21:15
Copy link
Copy Markdown
Member

@dlongley dlongley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Comment thread lib/CachedResolver.js Outdated
Comment thread test/CachedResolver.spec.js Outdated
@dlongley dlongley merged commit 8fad103 into main May 16, 2026
1 check passed
@dlongley dlongley deleted the upgrade-lru-memoize-v4 branch May 16, 2026 22:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants