Skip to content

Commit aa8604a

Browse files
authoredJun 13, 2024··
fix: setMaxParserCache throws TypeError (#2757)
* fix #2752 setMaxParserCache throws TypeError
1 parent b924c5a commit aa8604a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎lib/parsers/parser_cache.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
const LRU = require('lru-cache').default;
44

5-
const parserCache = new LRU({
5+
let parserCache = new LRU({
66
max: 15000,
77
});
88

@@ -51,7 +51,7 @@ function getParser(type, fields, options, config, compiler) {
5151
}
5252

5353
function setMaxCache(max) {
54-
parserCache.max = max;
54+
parserCache = new LRU({ max });
5555
}
5656

5757
function clearCache() {

0 commit comments

Comments
 (0)
Please sign in to comment.