From 22e4d555c87224d4720cf27fc33823efd9279d73 Mon Sep 17 00:00:00 2001 From: Thomas Hunter II Date: Mon, 24 Jun 2024 23:55:12 -0700 Subject: [PATCH] deps: upgrade lru-cache@^7.14.0 -> ^10.2.2 (#4435) --- package.json | 2 +- packages/dd-trace/src/appsec/iast/vulnerability-reporter.js | 4 ++-- packages/dd-trace/src/datastreams/pathway.js | 2 +- yarn.lock | 5 +++++ 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index ef694907f99..481878c38db 100644 --- a/package.json +++ b/package.json @@ -88,7 +88,7 @@ "koalas": "^1.0.2", "limiter": "1.1.5", "lodash.sortby": "^4.7.0", - "lru-cache": "^7.14.0", + "lru-cache": "^10.2.2", "module-details-from-path": "^1.0.3", "msgpack-lite": "^0.1.26", "opentracing": ">=0.12.1", diff --git a/packages/dd-trace/src/appsec/iast/vulnerability-reporter.js b/packages/dd-trace/src/appsec/iast/vulnerability-reporter.js index cc25d51b1e9..8bd00c40596 100644 --- a/packages/dd-trace/src/appsec/iast/vulnerability-reporter.js +++ b/packages/dd-trace/src/appsec/iast/vulnerability-reporter.js @@ -1,14 +1,14 @@ 'use strict' const { MANUAL_KEEP } = require('../../../../../ext/tags') -const LRU = require('lru-cache') +const { LRUCache } = require('lru-cache') const vulnerabilitiesFormatter = require('./vulnerabilities-formatter') const { IAST_ENABLED_TAG_KEY, IAST_JSON_TAG_KEY } = require('./tags') const standalone = require('../standalone') const VULNERABILITIES_KEY = 'vulnerabilities' const VULNERABILITY_HASHES_MAX_SIZE = 1000 -const VULNERABILITY_HASHES = new LRU({ max: VULNERABILITY_HASHES_MAX_SIZE }) +const VULNERABILITY_HASHES = new LRUCache({ max: VULNERABILITY_HASHES_MAX_SIZE }) const RESET_VULNERABILITY_CACHE_INTERVAL = 60 * 60 * 1000 // 1 hour let tracer diff --git a/packages/dd-trace/src/datastreams/pathway.js b/packages/dd-trace/src/datastreams/pathway.js index b813b622ca6..dc954a9428f 100644 --- a/packages/dd-trace/src/datastreams/pathway.js +++ b/packages/dd-trace/src/datastreams/pathway.js @@ -3,7 +3,7 @@ // this inconsistency is ok because hashes do not need to be consistent across services const crypto = require('crypto') const { encodeVarint, decodeVarint } = require('./encoding') -const LRUCache = require('lru-cache') +const { LRUCache } = require('lru-cache') const options = { max: 500 } const cache = new LRUCache(options) diff --git a/yarn.lock b/yarn.lock index 0c9111dd1b2..0e8f6319d62 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3455,6 +3455,11 @@ loupe@^2.3.1: dependencies: get-func-name "^2.0.0" +lru-cache@^10.2.2: + version "10.2.2" + resolved "https://registry.yarnpkg.com/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.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz"