@@ -3,11 +3,9 @@ import { logger } from '../application-logger';
33import { IAssignmentEvent , IAssignmentLogger } from '../assignment-logger' ;
44import { BanditEvaluator } from '../bandit-evaluator' ;
55import { IBanditEvent , IBanditLogger } from '../bandit-logger' ;
6- import {
7- AssignmentCache ,
8- LRUInMemoryAssignmentCache ,
9- NonExpiringInMemoryAssignmentCache ,
10- } from '../cache/abstract-assignment-cache' ;
6+ import { AssignmentCache } from '../cache/abstract-assignment-cache' ;
7+ import { LRUInMemoryAssignmentCache } from '../cache/lru-in-memory-assignment-cache' ;
8+ import { NonExpiringInMemoryAssignmentCache } from '../cache/non-expiring-in-memory-cache-assignment' ;
119import ConfigurationRequestor from '../configuration-requestor' ;
1210import { IConfigurationStore } from '../configuration-store/configuration-store' ;
1311import {
@@ -254,25 +252,6 @@ export default class EppoClient {
254252 return this . getBooleanAssignment ( flagKey , subjectKey , subjectAttributes , defaultValue ) ;
255253 }
256254
257- /**
258- * Maps a subject to a boolean variation for a given experiment.
259- *
260- * @param flagKey feature flag identifier
261- * @param subjectKey an identifier of the experiment subject, for example a user ID.
262- * @param subjectAttributes optional attributes associated with the subject, for example name and email.
263- * @param defaultValue default value to return if the subject is not part of the experiment sample
264- * @returns a boolean variation value if the subject is part of the experiment sample, otherwise the default value
265- */
266- public getBooleanAssignment (
267- flagKey : string ,
268- subjectKey : string ,
269- subjectAttributes : Attributes ,
270- defaultValue : boolean ,
271- ) : boolean {
272- return this . getBooleanAssignmentDetails ( flagKey , subjectKey , subjectAttributes , defaultValue )
273- . variation ;
274- }
275-
276255 /**
277256 * Maps a subject to a boolean variation for a given experiment and provides additional details about the
278257 * variation assigned and the reason for the assignment.
@@ -657,6 +636,25 @@ export default class EppoClient {
657636 return result ;
658637 }
659638
639+ /**
640+ * Maps a subject to a boolean variation for a given experiment.
641+ *
642+ * @param flagKey feature flag identifier
643+ * @param subjectKey an identifier of the experiment subject, for example a user ID.
644+ * @param subjectAttributes optional attributes associated with the subject, for example name and email.
645+ * @param defaultValue default value to return if the subject is not part of the experiment sample
646+ * @returns a boolean variation value if the subject is part of the experiment sample, otherwise the default value
647+ */
648+ public getBooleanAssignment (
649+ flagKey : string ,
650+ subjectKey : string ,
651+ subjectAttributes : Attributes ,
652+ defaultValue : boolean ,
653+ ) : boolean {
654+ return this . getBooleanAssignmentDetails ( flagKey , subjectKey , subjectAttributes , defaultValue )
655+ . variation ;
656+ }
657+
660658 private ensureActionsWithContextualAttributes (
661659 actions : BanditActions ,
662660 ) : Record < string , ContextAttributes > {
0 commit comments