From 759e0397c3f2c8e6048d5b877c3ac4f1933a5837 Mon Sep 17 00:00:00 2001 From: Jorge Sanz Date: Wed, 12 Mar 2025 18:16:14 +0100 Subject: [PATCH 1/2] Upgrade to lru-cache 11.0.2 (#663) * Upgrade to lru-cache 11.0.2 * Fix version (cherry picked from commit 12cb43c8161f75ac74a0f9c9116d78bea6df29bc) # Conflicts: # package.json # yarn.lock --- package.json | 4 ++-- src/ems_client.ts | 4 ++-- tsconfig.json | 2 +- yarn.lock | 31 ++++++++++--------------------- 4 files changed, 15 insertions(+), 26 deletions(-) diff --git a/package.json b/package.json index 92ee5d83..07687f42 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "@types/geojson": "7946.0.16", "@types/topojson-client": "3.1.5", "lodash": "4.17.21", - "lru-cache": "4.1.5", + "lru-cache": "11.0.2", "semver": "7.7.1", "topojson-client": "3.1.0" }, @@ -53,7 +53,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.14.0", "@types/semver": "7.7.0", "@types/topojson-specification": "1.0.5", diff --git a/src/ems_client.ts b/src/ems_client.ts index d60d03d6..a738bcac 100644 --- a/src/ems_client.ts +++ b/src/ems_client.ts @@ -13,7 +13,7 @@ import semver from 'semver'; 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 DEFAULT_EMS_VERSION = '7.17'; @@ -420,7 +420,7 @@ export class EMSClient { } private _invalidateSettings(): void { - this._cache.reset(); + this._cache.clear(); this._getMainCatalog = _.once(async (): Promise => { // Preserve manifestServiceUrl parameter for backwards compatibility with EMS v7.2 if (this._manifestServiceUrl) { diff --git a/tsconfig.json b/tsconfig.json index f68136b1..91642ac9 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 f2d92d81..2b4b4f05 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1439,10 +1439,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/node@*": version "20.14.2" @@ -2996,13 +2998,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" @@ -3271,11 +3270,6 @@ prompts@^2.0.1: kleur "^3.0.3" sisteransi "^1.0.5" -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" @@ -3730,11 +3724,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 3ba2713b69514f8188460005af52d140800fa769 Mon Sep 17 00:00:00 2001 From: Jorge Sanz Date: Mon, 7 Apr 2025 15:38:25 +0200 Subject: [PATCH 2/2] Upgrade to lru-cache@11.1.0 --- package.json | 2 +- yarn.lock | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 07687f42..29266dbf 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "@types/geojson": "7946.0.16", "@types/topojson-client": "3.1.5", "lodash": "4.17.21", - "lru-cache": "11.0.2", + "lru-cache": "11.1.0", "semver": "7.7.1", "topojson-client": "3.1.0" }, diff --git a/yarn.lock b/yarn.lock index 2b4b4f05..563b56e3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2998,11 +2998,16 @@ lodash@4.17.21: resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== -lru-cache@*, lru-cache@11.0.2: +lru-cache@*: 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@11.1.0: + version "11.1.0" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-11.1.0.tgz#afafb060607108132dbc1cf8ae661afb69486117" + integrity sha512-QIXZUBJUx+2zHUdQujWejBkcD9+cs94tLn0+YL8UrCh+D5sCXZ4c7LaEH48pNwRY3MLDgqUFyhlCyjJPf1WP0A== + lru-cache@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920"