Validate CLI memory-backed cached objects against CLI path

This commit is contained in:
Mario Campos
2026-07-13 23:22:43 -05:00
parent ec96b5271e
commit 0daa052859
3 changed files with 47 additions and 2 deletions

5
lib/entry-points.js generated
View File

@@ -145838,7 +145838,10 @@ function cacheCommandOutput(key, cmd, output) {
function getCachedCommandOutput(key, cmd) {
const memoized = inMemoryCache.get(key);
if (memoized !== void 0) {
return memoized.output;
if (cmd === void 0 || memoized.cmd === cmd) {
return memoized.output;
}
inMemoryCache.delete(key);
}
const entry = readCommandCacheFile()[key];
if (!isObject(entry) || !isString(entry.cmd) || cmd !== void 0 && entry.cmd !== cmd || !commandCacheValidators[key](entry.output)) {