@@ -9,13 +9,12 @@ import {
9
9
ParseError ,
10
10
ResolutionDetails ,
11
11
StandardResolutionReasons ,
12
- TypeMismatchError ,
12
+ TypeMismatchError
13
13
} from '@openfeature/js-sdk' ;
14
14
import { GrpcTransport } from '@protobuf-ts/grpc-transport' ;
15
- import type { JsonValue as PbJsonValue } from '@protobuf-ts/runtime' ;
16
15
import type { UnaryCall } from '@protobuf-ts/runtime-rpc' ;
17
16
import { RpcError } from '@protobuf-ts/runtime-rpc' ;
18
- import LRU from 'lru-cache' ;
17
+ import { LRUCache } from 'lru-cache' ;
19
18
import { Struct } from '../../../proto/ts/google/protobuf/struct' ;
20
19
import {
21
20
EventStreamResponse ,
@@ -28,7 +27,7 @@ import {
28
27
ResolveObjectRequest ,
29
28
ResolveObjectResponse ,
30
29
ResolveStringRequest ,
31
- ResolveStringResponse ,
30
+ ResolveStringResponse
32
31
} from '../../../proto/ts/schema/v1/schema' ;
33
32
import { ServiceClient } from '../../../proto/ts/schema/v1/schema.client' ;
34
33
import { Config } from '../../configuration' ;
@@ -37,7 +36,7 @@ import {
37
36
DEFAULT_MAX_CACHE_SIZE ,
38
37
DEFAULT_MAX_EVENT_STREAM_RETRIES ,
39
38
EVENT_CONFIGURATION_CHANGE ,
40
- EVENT_PROVIDER_READY ,
39
+ EVENT_PROVIDER_READY
41
40
} from '../../constants' ;
42
41
import { FlagdProvider } from '../../flagd-provider' ;
43
42
import { Service } from '../service' ;
@@ -75,7 +74,7 @@ export const Codes = {
75
74
76
75
export class GRPCService implements Service {
77
76
private _client : ServiceClient ;
78
- private _cache : LRU < string , ResolutionDetails < FlagValue > > | undefined ;
77
+ private _cache : LRUCache < string , ResolutionDetails < FlagValue > > | undefined ;
79
78
private _cacheEnabled = false ;
80
79
private _streamAlive = false ;
81
80
private _streamConnectAttempt = 0 ;
@@ -104,7 +103,7 @@ export class GRPCService implements Service {
104
103
// for now, we only need streaming if the cache is enabled (will need to be pulled out once we support events)
105
104
if ( config . cache === 'lru' ) {
106
105
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 } ) ;
108
107
this . streamConnection = this . connectStream ( ) ;
109
108
}
110
109
}
0 commit comments