Skip to content

Commit

Permalink
Merge pull request #961 from blackflux/dev
Browse files Browse the repository at this point in the history
[Gally]: master <- dev
  • Loading branch information
simlu authored May 3, 2022
2 parents cf1e734 + b95bce9 commit a93be31
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import LRU from 'lru-cache';
export default class LRUe extends LRU {
constructor({ cacheNull = true, ...options }) {
super(options);
assert(!('maxAge' in options), 'Please use "ttl" instead of "maxAge"');
assert('max' in options, 'Please add a "max" value');
this.cacheNull = cacheNull;
}

Expand Down
4 changes: 2 additions & 2 deletions test/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ describe('Testing LRUe', () => {
let cache;
let cacheNoNull;
beforeEach(() => {
cache = new LRU({ maxAge: 5 * 60 * 1000 });
cacheNoNull = new LRU({ maxAge: 5 * 60 * 1000, cacheNull: false });
cache = new LRU({ max: 10000, ttl: 5 * 60 * 1000 });
cacheNoNull = new LRU({ max: 10000, ttl: 5 * 60 * 1000, cacheNull: false });
});

describe('Testing memoize', () => {
Expand Down

0 comments on commit a93be31

Please sign in to comment.