fix: pass createKey option through wrap methods#1269
fix: pass createKey option through wrap methods#1269jaredwray merged 1 commit intojaredwray:mainfrom
Conversation
The createKey option was not being passed from wrap() methods to the underlying wrapSync/wrap functions, preventing custom cache key generation as documented. Fixed in: - @cacheable/cacheable: CacheableMemory.wrap() and Cacheable.wrap() - @cacheable/memory: CacheableMemory.wrap() Added tests to verify the fix works correctly.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1269 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 35 35
Lines 4183 4186 +3
Branches 1246 1227 -19
=========================================
+ Hits 4183 4186 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@amit13k - thanks for adding this. Would you also be willing to update @cacheable/memoize as we will be moving to that shortly. |
|
@jaredwray Thanks for the awesome library! I hit that createKey bug and attempted to fix it, but honestly I'm not familiar enough with the memoize package to confidently make changes there right now. |
|
@amit13k - ok. It is pretty much the same code as what we have in |
|
@amit13k - this should get released in the next week or so. |
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
Bug fix - pass createKey option through wrap methods
The
createKeyoption was not being passed fromwrap()methods to the underlyingwrapSync/wrapfunctions, preventing custom cache key generation from working.Fixed in:
@cacheable/cacheable:CacheableMemory.wrap()andCacheable.wrap()@cacheable/memory:CacheableMemory.wrap()