Skip to content

Commit

Permalink
Merge pull request #971 from blackflux/dev
Browse files Browse the repository at this point in the history
[Gally]: master <- dev
  • Loading branch information
simlu authored Aug 24, 2024
2 parents e1b81ff + 85b72d8 commit 3a04c4e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default class LRUe extends LRU {
async memoize(key, valueFn, ...args) {
assert(typeof valueFn === 'function');
if (!this.has(key)) {
this.set(key, valueFn(args));
this.set(key, valueFn(...args));
}
try {
const r = await this.peek(key);
Expand All @@ -29,7 +29,7 @@ export default class LRUe extends LRU {
memoizeSync(key, valueFn, ...args) {
assert(typeof valueFn === 'function');
if (!this.has(key)) {
const r = valueFn(args);
const r = valueFn(...args);
assert(!(r instanceof Promise), 'Use memoize() instead');
this.set(key, r);
}
Expand Down

0 comments on commit 3a04c4e

Please sign in to comment.