Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Galcarmi committed Apr 30, 2024
1 parent a197605 commit 0d6d26b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/util/path.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"use strict";

const path = require("path");
const { LRUCache } = require("lru-cache");

const CHAR_HASH = "#".charCodeAt(0);
const CHAR_SLASH = "/".charCodeAt(0);
Expand Down Expand Up @@ -170,8 +171,8 @@ const join = (rootPath, request) => {
};
exports.join = join;

/** @type {Map<string, Map<string, string | undefined>>} */
const joinCache = new Map();
/** @type {LRUCache<string, Map<string, string | undefined>>} */
const joinCache = new LRUCache({ max: 500 });

/**
* @param {string} rootPath the root path
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
},
"dependencies": {
"graceful-fs": "^4.2.4",
"lru-cache": "^10.2.2",
"tapable": "^2.2.0"
},
"license": "MIT",
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3063,6 +3063,11 @@ log-update@^4.0.0:
slice-ansi "^4.0.0"
wrap-ansi "^6.2.0"

lru-cache@^10.2.2:
version "10.2.2"
resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.2.tgz#48206bc114c1252940c41b25b41af5b545aca878"
integrity sha512-9hp3Vp2/hFQUiIwKo8XCeFVnrg8Pk3TYNPIR7tJADKi5YfcF7vEaK7avFHTlSy3kOKYaJQaalfEo6YuXdceBOQ==

lru-cache@^5.1.1:
version "5.1.1"
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920"
Expand Down

0 comments on commit 0d6d26b

Please sign in to comment.