Skip to content

Commit 6e247ad

Browse files
fix(deps): update dependency lru-cache to v9 (#321)
Signed-off-by: Todd Baert <[email protected]> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Todd Baert <[email protected]>
1 parent 951d2d8 commit 6e247ad

File tree

3 files changed

+15
-16
lines changed

3 files changed

+15
-16
lines changed

libs/providers/flagd/src/lib/service/grpc/service.ts

+6-7
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,12 @@ import {
99
ParseError,
1010
ResolutionDetails,
1111
StandardResolutionReasons,
12-
TypeMismatchError,
12+
TypeMismatchError
1313
} from '@openfeature/js-sdk';
1414
import { GrpcTransport } from '@protobuf-ts/grpc-transport';
15-
import type { JsonValue as PbJsonValue } from '@protobuf-ts/runtime';
1615
import type { UnaryCall } from '@protobuf-ts/runtime-rpc';
1716
import { RpcError } from '@protobuf-ts/runtime-rpc';
18-
import LRU from 'lru-cache';
17+
import { LRUCache } from 'lru-cache';
1918
import { Struct } from '../../../proto/ts/google/protobuf/struct';
2019
import {
2120
EventStreamResponse,
@@ -28,7 +27,7 @@ import {
2827
ResolveObjectRequest,
2928
ResolveObjectResponse,
3029
ResolveStringRequest,
31-
ResolveStringResponse,
30+
ResolveStringResponse
3231
} from '../../../proto/ts/schema/v1/schema';
3332
import { ServiceClient } from '../../../proto/ts/schema/v1/schema.client';
3433
import { Config } from '../../configuration';
@@ -37,7 +36,7 @@ import {
3736
DEFAULT_MAX_CACHE_SIZE,
3837
DEFAULT_MAX_EVENT_STREAM_RETRIES,
3938
EVENT_CONFIGURATION_CHANGE,
40-
EVENT_PROVIDER_READY,
39+
EVENT_PROVIDER_READY
4140
} from '../../constants';
4241
import { FlagdProvider } from '../../flagd-provider';
4342
import { Service } from '../service';
@@ -75,7 +74,7 @@ export const Codes = {
7574

7675
export class GRPCService implements Service {
7776
private _client: ServiceClient;
78-
private _cache: LRU<string, ResolutionDetails<FlagValue>> | undefined;
77+
private _cache: LRUCache<string, ResolutionDetails<FlagValue>> | undefined;
7978
private _cacheEnabled = false;
8079
private _streamAlive = false;
8180
private _streamConnectAttempt = 0;
@@ -104,7 +103,7 @@ export class GRPCService implements Service {
104103
// for now, we only need streaming if the cache is enabled (will need to be pulled out once we support events)
105104
if (config.cache === 'lru') {
106105
this._cacheEnabled = true;
107-
this._cache = new LRU({ maxSize: config.maxCacheSize || DEFAULT_MAX_CACHE_SIZE, sizeCalculation: () => 1 });
106+
this._cache = new LRUCache({ maxSize: config.maxCacheSize || DEFAULT_MAX_CACHE_SIZE, sizeCalculation: () => 1 });
108107
this.streamConnection = this.connectStream();
109108
}
110109
}

package-lock.json

+8-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"@protobuf-ts/grpc-transport": "2.9.0",
2020
"axios": "1.4.0",
2121
"configcat-js": "^7.0.0",
22-
"lru-cache": "^8.0.0",
22+
"lru-cache": "^9.0.0",
2323
"object-hash": "^3.0.0",
2424
"tslib": "2.5.0"
2525
},

0 commit comments

Comments
 (0)