@@ -75,17 +75,17 @@ function makeDefaultInitialContext() {
7575
7676export class ClientEntity {
7777 constructor (
78- private readonly client : LDClient ,
79- private readonly logger : LDLogger ,
78+ private readonly _client : LDClient ,
79+ private readonly _logger : LDLogger ,
8080 ) { }
8181
8282 close ( ) {
83- this . client . close ( ) ;
84- this . logger . info ( 'Test ended' ) ;
83+ this . _client . close ( ) ;
84+ this . _logger . info ( 'Test ended' ) ;
8585 }
8686
8787 async doCommand ( params : CommandParams ) {
88- this . logger . info ( `Received command: ${ params . command } ` ) ;
88+ this . _logger . info ( `Received command: ${ params . command } ` ) ;
8989 switch ( params . command ) {
9090 case CommandType . EvaluateFlag : {
9191 const evaluationParams = params . evaluate ;
@@ -95,23 +95,23 @@ export class ClientEntity {
9595 if ( evaluationParams . detail ) {
9696 switch ( evaluationParams . valueType ) {
9797 case ValueType . Bool :
98- return this . client . boolVariationDetail (
98+ return this . _client . boolVariationDetail (
9999 evaluationParams . flagKey ,
100100 evaluationParams . defaultValue as boolean ,
101101 ) ;
102102 case ValueType . Int : // Intentional fallthrough.
103103 case ValueType . Double :
104- return this . client . numberVariationDetail (
104+ return this . _client . numberVariationDetail (
105105 evaluationParams . flagKey ,
106106 evaluationParams . defaultValue as number ,
107107 ) ;
108108 case ValueType . String :
109- return this . client . stringVariationDetail (
109+ return this . _client . stringVariationDetail (
110110 evaluationParams . flagKey ,
111111 evaluationParams . defaultValue as string ,
112112 ) ;
113113 default :
114- return this . client . variationDetail (
114+ return this . _client . variationDetail (
115115 evaluationParams . flagKey ,
116116 evaluationParams . defaultValue ,
117117 ) ;
@@ -120,42 +120,45 @@ export class ClientEntity {
120120 switch ( evaluationParams . valueType ) {
121121 case ValueType . Bool :
122122 return {
123- value : this . client . boolVariation (
123+ value : this . _client . boolVariation (
124124 evaluationParams . flagKey ,
125125 evaluationParams . defaultValue as boolean ,
126126 ) ,
127127 } ;
128128 case ValueType . Int : // Intentional fallthrough.
129129 case ValueType . Double :
130130 return {
131- value : this . client . numberVariation (
131+ value : this . _client . numberVariation (
132132 evaluationParams . flagKey ,
133133 evaluationParams . defaultValue as number ,
134134 ) ,
135135 } ;
136136 case ValueType . String :
137137 return {
138- value : this . client . stringVariation (
138+ value : this . _client . stringVariation (
139139 evaluationParams . flagKey ,
140140 evaluationParams . defaultValue as string ,
141141 ) ,
142142 } ;
143143 default :
144144 return {
145- value : this . client . variation ( evaluationParams . flagKey , evaluationParams . defaultValue ) ,
145+ value : this . _client . variation (
146+ evaluationParams . flagKey ,
147+ evaluationParams . defaultValue ,
148+ ) ,
146149 } ;
147150 }
148151 }
149152
150153 case CommandType . EvaluateAllFlags :
151- return { state : this . client . allFlags ( ) } ;
154+ return { state : this . _client . allFlags ( ) } ;
152155
153156 case CommandType . IdentifyEvent : {
154157 const identifyParams = params . identifyEvent ;
155158 if ( ! identifyParams ) {
156159 throw malformedCommand ;
157160 }
158- await this . client . identify ( identifyParams . user || identifyParams . context ) ;
161+ await this . _client . identify ( identifyParams . user || identifyParams . context ) ;
159162 return undefined ;
160163 }
161164
@@ -164,7 +167,7 @@ export class ClientEntity {
164167 if ( ! customEventParams ) {
165168 throw malformedCommand ;
166169 }
167- this . client . track (
170+ this . _client . track (
168171 customEventParams . eventKey ,
169172 customEventParams . data ,
170173 customEventParams . metricValue ,
@@ -173,7 +176,7 @@ export class ClientEntity {
173176 }
174177
175178 case CommandType . FlushEvents :
176- this . client . flush ( ) ;
179+ this . _client . flush ( ) ;
177180 return undefined ;
178181
179182 default :
0 commit comments