Skip to content

Commit 8608a7b

Browse files
committed
Update variationKey type to be string
1 parent 5b407d5 commit 8608a7b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/optimizely-sdk/lib/core/event_builder/event_helpers.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { EventTags, UserAttributes } from '../../shared_types';
1818

1919
interface ImpressionConfig {
2020
experimentKey: string;
21-
variationKey: string | null;
21+
variationKey: string;
2222
flagKey: string;
2323
ruleType: string;
2424
userId: string;

packages/optimizely-sdk/lib/core/project_config/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ export var getVariationKeyFromId = function(projectConfig, variationId) {
297297
*/
298298
export var getVariationIdFromExperimentAndVariationKey = function(projectConfig, experimentKey, variationKey) {
299299
var experiment = projectConfig.experimentKeyMap[experimentKey];
300-
if (variationKey && experiment.variationKeyMap.hasOwnProperty(variationKey)) {
300+
if (variationKey !== '' && experiment.variationKeyMap.hasOwnProperty(variationKey)) {
301301
return experiment.variationKeyMap[variationKey].id;
302302
}
303303
return null;

0 commit comments

Comments
 (0)