@@ -76,7 +76,7 @@ function Optimizely(config) {
7676 skipJSONValidation : config . skipJSONValidation ,
7777 } ) ;
7878
79- this . __disposeOnUpdate = this . projectConfigManager . onUpdate ( function ( configObj ) {
79+ this . __disposeOnUpdate = this . projectConfigManager . onUpdate ( function ( configObj ) {
8080 this . logger . log ( LOG_LEVEL . INFO , jsSdkUtils . sprintf ( LOG_MESSAGES . UPDATED_OPTIMIZELY_CONFIG , MODULE_NAME , configObj . revision , configObj . projectId ) ) ;
8181 this . notificationCenter . sendNotifications ( NOTIFICATION_TYPES . OPTIMIZELY_CONFIG_UPDATE ) ;
8282 } . bind ( this ) ) ;
@@ -124,7 +124,7 @@ function Optimizely(config) {
124124 * constructor was also valid.
125125 * @return {* }
126126 */
127- Optimizely . prototype . __isValidInstance = function ( ) {
127+ Optimizely . prototype . __isValidInstance = function ( ) {
128128 return this . __isOptimizelyConfigValid && this . projectConfigManager . getConfig ( ) ;
129129} ;
130130
@@ -135,7 +135,7 @@ Optimizely.prototype.__isValidInstance = function() {
135135 * @param {Object } attributes
136136 * @return {string|null } variation key
137137 */
138- Optimizely . prototype . activate = function ( experimentKey , userId , attributes ) {
138+ Optimizely . prototype . activate = function ( experimentKey , userId , attributes ) {
139139 try {
140140 if ( ! this . __isValidInstance ( ) ) {
141141 this . logger . log ( LOG_LEVEL . ERROR , jsSdkUtils . sprintf ( LOG_MESSAGES . INVALID_OBJECT , MODULE_NAME , 'activate' ) ) ;
@@ -194,7 +194,7 @@ Optimizely.prototype.activate = function(experimentKey, userId, attributes) {
194194 * @param {string } userId ID of user to whom the variation was shown
195195 * @param {Object } attributes Optional user attributes
196196 */
197- Optimizely . prototype . _sendImpressionEvent = function ( experimentKey , variationKey , userId , attributes ) {
197+ Optimizely . prototype . _sendImpressionEvent = function ( experimentKey , variationKey , userId , attributes ) {
198198 var configObj = this . projectConfigManager . getConfig ( ) ;
199199 if ( ! configObj ) {
200200 return ;
@@ -221,7 +221,7 @@ Optimizely.prototype._sendImpressionEvent = function(experimentKey, variationKey
221221 * @param {string } userId ID of user to whom the variation was shown
222222 * @param {Object } attributes Optional user attributes
223223 */
224- Optimizely . prototype . __emitNotificationCenterActivate = function ( experimentKey , variationKey , userId , attributes ) {
224+ Optimizely . prototype . __emitNotificationCenterActivate = function ( experimentKey , variationKey , userId , attributes ) {
225225 var configObj = this . projectConfigManager . getConfig ( ) ;
226226 if ( ! configObj ) {
227227 return ;
@@ -268,7 +268,7 @@ Optimizely.prototype.__emitNotificationCenterActivate = function(experimentKey,
268268 * @param {string } attributes
269269 * @param {Object } eventTags Values associated with the event.
270270 */
271- Optimizely . prototype . track = function ( eventKey , userId , attributes , eventTags ) {
271+ Optimizely . prototype . track = function ( eventKey , userId , attributes , eventTags ) {
272272 try {
273273 if ( ! this . __isValidInstance ( ) ) {
274274 this . logger . log ( LOG_LEVEL . ERROR , jsSdkUtils . sprintf ( LOG_MESSAGES . INVALID_OBJECT , MODULE_NAME , 'track' ) ) ;
@@ -318,7 +318,7 @@ Optimizely.prototype.track = function(eventKey, userId, attributes, eventTags) {
318318 * @param {string } attributes
319319 * @param {Object } eventTags Values associated with the event.
320320 */
321- Optimizely . prototype . __emitNotificationCenterTrack = function ( eventKey , userId , attributes , eventTags ) {
321+ Optimizely . prototype . __emitNotificationCenterTrack = function ( eventKey , userId , attributes , eventTags ) {
322322 try {
323323 var configObj = this . projectConfigManager . getConfig ( ) ;
324324 if ( ! configObj ) {
@@ -357,7 +357,7 @@ Optimizely.prototype.__emitNotificationCenterTrack = function(eventKey, userId,
357357 * @param {Object } attributes
358358 * @return {string|null } variation key
359359 */
360- Optimizely . prototype . getVariation = function ( experimentKey , userId , attributes ) {
360+ Optimizely . prototype . getVariation = function ( experimentKey , userId , attributes ) {
361361 try {
362362 if ( ! this . __isValidInstance ( ) ) {
363363 this . logger . log ( LOG_LEVEL . ERROR , jsSdkUtils . sprintf ( LOG_MESSAGES . INVALID_OBJECT , MODULE_NAME , 'getVariation' ) ) ;
@@ -417,7 +417,7 @@ Optimizely.prototype.getVariation = function(experimentKey, userId, attributes)
417417 * @param {string|null } variationKey user will be forced into. If null, then clear the existing experiment-to-variation mapping.
418418 * @return boolean A boolean value that indicates if the set completed successfully.
419419 */
420- Optimizely . prototype . setForcedVariation = function ( experimentKey , userId , variationKey ) {
420+ Optimizely . prototype . setForcedVariation = function ( experimentKey , userId , variationKey ) {
421421 if ( ! this . __validateInputs ( { experiment_key : experimentKey , user_id : userId } ) ) {
422422 return false ;
423423 }
@@ -442,7 +442,7 @@ Optimizely.prototype.setForcedVariation = function(experimentKey, userId, variat
442442 * @param {string } userId
443443 * @return {string|null } The forced variation key.
444444 */
445- Optimizely . prototype . getForcedVariation = function ( experimentKey , userId ) {
445+ Optimizely . prototype . getForcedVariation = function ( experimentKey , userId ) {
446446 if ( ! this . __validateInputs ( { experiment_key : experimentKey , user_id : userId } ) ) {
447447 return null ;
448448 }
@@ -469,7 +469,7 @@ Optimizely.prototype.getForcedVariation = function(experimentKey, userId) {
469469 * @return {boolean } True if inputs are valid
470470 *
471471 */
472- Optimizely . prototype . __validateInputs = function ( stringInputs , userAttributes , eventTags ) {
472+ Optimizely . prototype . __validateInputs = function ( stringInputs , userAttributes , eventTags ) {
473473 try {
474474 // Null, undefined or non-string user Id is invalid.
475475 if ( stringInputs . hasOwnProperty ( 'user_id' ) ) {
@@ -508,7 +508,7 @@ Optimizely.prototype.__validateInputs = function(stringInputs, userAttributes, e
508508 * @param userId
509509 * @return {null }
510510 */
511- Optimizely . prototype . __notActivatingExperiment = function ( experimentKey , userId ) {
511+ Optimizely . prototype . __notActivatingExperiment = function ( experimentKey , userId ) {
512512 var failedActivationLogMessage = jsSdkUtils . sprintf ( LOG_MESSAGES . NOT_ACTIVATING_USER , MODULE_NAME , userId , experimentKey ) ;
513513 this . logger . log ( LOG_LEVEL . INFO , failedActivationLogMessage ) ;
514514 return null ;
@@ -519,7 +519,7 @@ Optimizely.prototype.__notActivatingExperiment = function(experimentKey, userId)
519519 * @param map
520520 * @returns {Object } map
521521 */
522- Optimizely . prototype . __filterEmptyValues = function ( map ) {
522+ Optimizely . prototype . __filterEmptyValues = function ( map ) {
523523 for ( var key in map ) {
524524 if ( map . hasOwnProperty ( key ) && ( map [ key ] === null || map [ key ] === undefined ) ) {
525525 delete map [ key ] ;
@@ -535,7 +535,7 @@ Optimizely.prototype.__filterEmptyValues = function(map) {
535535 * @param {Object } attributes Optional user attributes
536536 * @return {boolean } True if the feature is enabled for the user, false otherwise
537537 */
538- Optimizely . prototype . isFeatureEnabled = function ( featureKey , userId , attributes ) {
538+ Optimizely . prototype . isFeatureEnabled = function ( featureKey , userId , attributes ) {
539539 try {
540540 if ( ! this . __isValidInstance ( ) ) {
541541 this . logger . log ( LOG_LEVEL . ERROR , jsSdkUtils . sprintf ( LOG_MESSAGES . INVALID_OBJECT , MODULE_NAME , 'isFeatureEnabled' ) ) ;
@@ -612,7 +612,7 @@ Optimizely.prototype.isFeatureEnabled = function(featureKey, userId, attributes)
612612 * @param {Object } attributes
613613 * @return {Array } Array of feature keys (strings)
614614 */
615- Optimizely . prototype . getEnabledFeatures = function ( userId , attributes ) {
615+ Optimizely . prototype . getEnabledFeatures = function ( userId , attributes ) {
616616 try {
617617 var enabledFeatures = [ ] ;
618618 if ( ! this . __isValidInstance ( ) ) {
@@ -658,7 +658,7 @@ Optimizely.prototype.getEnabledFeatures = function(userId, attributes) {
658658 * the variable key is invalid
659659 */
660660
661- Optimizely . prototype . getFeatureVariable = function ( featureKey , variableKey , userId , attributes ) {
661+ Optimizely . prototype . getFeatureVariable = function ( featureKey , variableKey , userId , attributes ) {
662662 try {
663663 return this . _getFeatureVariableForType ( featureKey , variableKey , null , userId , attributes ) ;
664664 } catch ( e ) {
@@ -690,7 +690,7 @@ Optimizely.prototype.getFeatureVariable = function(featureKey, variableKey, user
690690 * variable key is invalid, or there is a mismatch
691691 * with the type of the variable
692692 */
693- Optimizely . prototype . _getFeatureVariableForType = function ( featureKey , variableKey , variableType , userId , attributes ) {
693+ Optimizely . prototype . _getFeatureVariableForType = function ( featureKey , variableKey , variableType , userId , attributes ) {
694694 if ( ! this . __isValidInstance ( ) ) {
695695 var apiName = ( variableType ) ? 'getFeatureVariable' + variableType . charAt ( 0 ) . toUpperCase ( ) + variableType . slice ( 1 ) : 'getFeatureVariable' ;
696696 this . logger . log ( LOG_LEVEL . ERROR , jsSdkUtils . sprintf ( LOG_MESSAGES . INVALID_OBJECT , MODULE_NAME , apiName ) ) ;
@@ -792,7 +792,7 @@ Optimizely.prototype._getFeatureVariableForType = function(featureKey, variableK
792792 * invalid, or there is a mismatch with the type
793793 * of the variable
794794 */
795- Optimizely . prototype . getFeatureVariableBoolean = function ( featureKey , variableKey , userId , attributes ) {
795+ Optimizely . prototype . getFeatureVariableBoolean = function ( featureKey , variableKey , userId , attributes ) {
796796 try {
797797 return this . _getFeatureVariableForType ( featureKey , variableKey , FEATURE_VARIABLE_TYPES . BOOLEAN , userId , attributes ) ;
798798 } catch ( e ) {
@@ -816,7 +816,7 @@ Optimizely.prototype.getFeatureVariableBoolean = function(featureKey, variableKe
816816 * invalid, or there is a mismatch with the type
817817 * of the variable
818818 */
819- Optimizely . prototype . getFeatureVariableDouble = function ( featureKey , variableKey , userId , attributes ) {
819+ Optimizely . prototype . getFeatureVariableDouble = function ( featureKey , variableKey , userId , attributes ) {
820820 try {
821821 return this . _getFeatureVariableForType ( featureKey , variableKey , FEATURE_VARIABLE_TYPES . DOUBLE , userId , attributes ) ;
822822 } catch ( e ) {
@@ -840,7 +840,7 @@ Optimizely.prototype.getFeatureVariableDouble = function(featureKey, variableKey
840840 * invalid, or there is a mismatch with the type
841841 * of the variable
842842 */
843- Optimizely . prototype . getFeatureVariableInteger = function ( featureKey , variableKey , userId , attributes ) {
843+ Optimizely . prototype . getFeatureVariableInteger = function ( featureKey , variableKey , userId , attributes ) {
844844 try {
845845 return this . _getFeatureVariableForType ( featureKey , variableKey , FEATURE_VARIABLE_TYPES . INTEGER , userId , attributes ) ;
846846 } catch ( e ) {
@@ -864,7 +864,7 @@ Optimizely.prototype.getFeatureVariableInteger = function(featureKey, variableKe
864864 * invalid, or there is a mismatch with the type
865865 * of the variable
866866 */
867- Optimizely . prototype . getFeatureVariableString = function ( featureKey , variableKey , userId , attributes ) {
867+ Optimizely . prototype . getFeatureVariableString = function ( featureKey , variableKey , userId , attributes ) {
868868 try {
869869 return this . _getFeatureVariableForType ( featureKey , variableKey , FEATURE_VARIABLE_TYPES . STRING , userId , attributes ) ;
870870 } catch ( e ) {
@@ -910,7 +910,7 @@ Optimizely.prototype.getFeatureVariableString = function(featureKey, variableKey
910910 * }
911911 * }
912912 */
913- Optimizely . prototype . getOptimizelyConfig = function ( ) {
913+ Optimizely . prototype . getOptimizelyConfig = function ( ) {
914914 try {
915915 var configObj = this . projectConfigManager . getConfig ( ) ;
916916 if ( ! configObj ) {
@@ -955,7 +955,7 @@ Optimizely.prototype.getOptimizelyConfig = function() {
955955 *
956956 * @return {Promise }
957957 */
958- Optimizely . prototype . close = function ( ) {
958+ Optimizely . prototype . close = function ( ) {
959959 try {
960960 var eventProcessorStoppedPromise = this . eventProcessor . stop ( ) ;
961961 if ( this . __disposeOnUpdate ) {
@@ -965,19 +965,19 @@ Optimizely.prototype.close = function() {
965965 if ( this . projectConfigManager ) {
966966 this . projectConfigManager . stop ( ) ;
967967 }
968- Object . keys ( this . __readyTimeouts ) . forEach ( function ( readyTimeoutId ) {
968+ Object . keys ( this . __readyTimeouts ) . forEach ( function ( readyTimeoutId ) {
969969 var readyTimeoutRecord = this . __readyTimeouts [ readyTimeoutId ] ;
970970 clearTimeout ( readyTimeoutRecord . readyTimeout ) ;
971971 readyTimeoutRecord . onClose ( ) ;
972972 } . bind ( this ) ) ;
973973 this . __readyTimeouts = { } ;
974974 return eventProcessorStoppedPromise . then (
975- function ( ) {
975+ function ( ) {
976976 return {
977977 success : true ,
978978 } ;
979979 } ,
980- function ( err ) {
980+ function ( err ) {
981981 return {
982982 success : false ,
983983 reason : String ( err ) ,
@@ -1021,7 +1021,7 @@ Optimizely.prototype.close = function() {
10211021 * @param {number|undefined } options.timeout
10221022 * @return {Promise }
10231023 */
1024- Optimizely . prototype . onReady = function ( options ) {
1024+ Optimizely . prototype . onReady = function ( options ) {
10251025 var timeout ;
10261026 if ( typeof options === 'object' && options !== null ) {
10271027 timeout = options . timeout ;
@@ -1031,22 +1031,22 @@ Optimizely.prototype.onReady = function(options) {
10311031 }
10321032
10331033 var resolveTimeoutPromise ;
1034- var timeoutPromise = new Promise ( function ( resolve ) {
1034+ var timeoutPromise = new Promise ( function ( resolve ) {
10351035 resolveTimeoutPromise = resolve ;
10361036 } ) ;
10371037
10381038 var timeoutId = this . __nextReadyTimeoutId ;
10391039 this . __nextReadyTimeoutId ++ ;
10401040
1041- var onReadyTimeout = function ( ) {
1041+ var onReadyTimeout = function ( ) {
10421042 delete this . __readyTimeouts [ timeoutId ] ;
10431043 resolveTimeoutPromise ( {
10441044 success : false ,
10451045 reason : jsSdkUtils . sprintf ( 'onReady timeout expired after %s ms' , timeout ) ,
10461046 } ) ;
10471047 } . bind ( this ) ;
10481048 var readyTimeout = setTimeout ( onReadyTimeout , timeout ) ;
1049- var onClose = function ( ) {
1049+ var onClose = function ( ) {
10501050 resolveTimeoutPromise ( {
10511051 success : false ,
10521052 reason : 'Instance closed' ,
@@ -1058,7 +1058,7 @@ Optimizely.prototype.onReady = function(options) {
10581058 onClose : onClose ,
10591059 } ;
10601060
1061- this . __readyPromise . then ( function ( ) {
1061+ this . __readyPromise . then ( function ( ) {
10621062 clearTimeout ( readyTimeout ) ;
10631063 delete this . __readyTimeouts [ timeoutId ] ;
10641064 resolveTimeoutPromise ( {
0 commit comments