Skip to content

Commit 2e8d703

Browse files
authored
Merge pull request #4 from maxnowack/patch-1
Fix error if no argument is passed to constructor
2 parents 6dd6380 + e896363 commit 2e8d703

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/lru-cache.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
const lru = require('lru-cache');
22

33
module.exports = class LruCache {
4-
constructor({ maxItems }) {
4+
constructor(options) {
5+
const maxItems = options && options.maxItems
56
this.cache = lru(maxItems);
67
}
78

0 commit comments

Comments
 (0)