From 35e2378534e9d5dfe0f05f252a42f80fdcd851ee Mon Sep 17 00:00:00 2001 From: Jorge Sanz Date: Wed, 12 Mar 2025 18:09:47 +0100 Subject: [PATCH 1/2] Upgrade to lru-cache 11.0.2 --- package.json | 6 +++--- src/ems_client.ts | 4 ++-- tsconfig.json | 2 +- yarn.lock | 31 ++++++++++--------------------- 4 files changed, 16 insertions(+), 27 deletions(-) diff --git a/package.json b/package.json index 15adb1d..5759a43 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@elastic/ems-client", - "version": "8.6.4", + "version": "8.6.3", "description": "JavaScript client library for the Elastic Maps Service", "main": "target/node/index.js", "browser": "target/web/index.js", @@ -35,7 +35,7 @@ "@types/topojson-client": "3.1.5", "chroma-js": "2.4.2", "lodash": "^4.17.21", - "lru-cache": "^4.1.5", + "lru-cache": "11.0.2", "maplibre-gl": "5.1.1", "semver": "7.7.1", "topojson-client": "^3.1.0" @@ -52,7 +52,7 @@ "@types/eslint__js": "8.42.3", "@types/jest": "29.5.14", "@types/lodash": "4.17.16", - "@types/lru-cache": "5.1.1", + "@types/lru-cache": "7.10.10", "@types/node": "22.13.10", "@types/semver": "7.5.8", "@types/topojson-specification": "1.0.5", diff --git a/src/ems_client.ts b/src/ems_client.ts index 44d207e..6b1d240 100644 --- a/src/ems_client.ts +++ b/src/ems_client.ts @@ -17,7 +17,7 @@ import semverMinor from 'semver/functions/minor'; import { format as formatUrl, parse as parseUrl, UrlObject } from 'url'; import { toAbsoluteUrl } from './utils'; import { ParsedUrlQueryInput } from 'querystring'; -import LRUCache from 'lru-cache'; +import { LRUCache } from 'lru-cache'; const REST_API_REGEX = /\d{4}-\d{2}-\d{2}/; export const LATEST_API_URL_PATH = 'latest'; @@ -429,7 +429,7 @@ export class EMSClient { } private _invalidateSettings(): void { - this._cache.reset(); + this._cache.clear(); this._getMainCatalog = _.once(async (): Promise => { const services = []; if (this._tileApiUrl) { diff --git a/tsconfig.json b/tsconfig.json index f68136b..91642ac 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,7 +2,7 @@ "compilerOptions": { /* Basic Options */ // "incremental": true, /* Enable incremental compilation */ - "target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */ + "target": "ES2015", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */ "module": "commonjs", "resolveJsonModule": true, /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */ // "lib": [], /* Specify library files to be included in the compilation. */ diff --git a/yarn.lock b/yarn.lock index 48e422e..2c75020 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2110,10 +2110,12 @@ resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.17.16.tgz#94ae78fab4a38d73086e962d0b65c30d816bfb0a" integrity sha512-HX7Em5NYQAXKW+1T+FiuG27NGwzJfCX3s1GjOa7ujxZa52kjJLOr4FUxT+giF6Tgxv1e+/czV/iTtBw27WTU9g== -"@types/lru-cache@5.1.1": - version "5.1.1" - resolved "https://registry.yarnpkg.com/@types/lru-cache/-/lru-cache-5.1.1.tgz#c48c2e27b65d2a153b19bfc1a317e30872e01eef" - integrity sha512-ssE3Vlrys7sdIzs5LOxCzTVMsU7i9oa/IaW92wF32JFb3CVczqOkru2xspuKczHEbG3nvmPY7IFqVmGGHdNbYw== +"@types/lru-cache@7.10.10": + version "7.10.10" + resolved "https://registry.yarnpkg.com/@types/lru-cache/-/lru-cache-7.10.10.tgz#3fa937c35ff4b3f6753d5737915c9bf8e693a713" + integrity sha512-nEpVRPWW9EBmx2SCfNn3ClYxPL7IktPX12HhIoSc/H5mMjdeW3+YsXIpseLQ2xF35+OcpwKQbEUw5VtqE4PDNA== + dependencies: + lru-cache "*" "@types/mapbox__point-geometry@*": version "0.1.2" @@ -3907,13 +3909,10 @@ lodash@^4.17.21: resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== -lru-cache@^4.1.5: - version "4.1.5" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd" - integrity sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g== - dependencies: - pseudomap "^1.0.2" - yallist "^2.1.2" +lru-cache@*, lru-cache@11.0.2: + version "11.0.2" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-11.0.2.tgz#fbd8e7cf8211f5e7e5d91905c415a3f55755ca39" + integrity sha512-123qHRfJBmo2jXDbo/a5YOQrJoHF/GNQTLzQ5+IdK5pWpceK17yRc6ozlWd25FxvGKQbIUs91fDFkXmDHTKcyA== lru-cache@^5.1.1: version "5.1.1" @@ -4265,11 +4264,6 @@ protocol-buffers-schema@^3.3.1: resolved "https://registry.yarnpkg.com/protocol-buffers-schema/-/protocol-buffers-schema-3.6.0.tgz#77bc75a48b2ff142c1ad5b5b90c94cd0fa2efd03" integrity sha512-TdDRD+/QNdrCGCE7v8340QyuXd4kIWIgapsE2+n/SaGiSSbomYl4TjHlvIoCWRpE7wFt02EpB35VVA2ImcBVqw== -pseudomap@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" - integrity sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ== - punycode@^2.1.0: version "2.3.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.1.tgz#027422e2faec0b25e1549c3e1bd8309b9133b6e5" @@ -4822,11 +4816,6 @@ y18n@^5.0.5: resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== -yallist@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" - integrity sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A== - yallist@^3.0.2: version "3.1.1" resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" From c2dc5a1e2422cb6bb405e1f71820d9cba717cbf2 Mon Sep 17 00:00:00 2001 From: Jorge Sanz Date: Wed, 12 Mar 2025 18:13:51 +0100 Subject: [PATCH 2/2] Fix version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5759a43..f2ef85a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@elastic/ems-client", - "version": "8.6.3", + "version": "8.6.4", "description": "JavaScript client library for the Elastic Maps Service", "main": "target/node/index.js", "browser": "target/web/index.js",