@@ -260,18 +260,6 @@ export const createProjectConfig = function(datafileObj?: JSON, datafileStr: str
260260 projectConfig . experimentKeyMap = keyBy ( projectConfig . experiments , 'key' ) ;
261261 projectConfig . experimentIdMap = keyBy ( projectConfig . experiments , 'id' ) ;
262262
263- const validExperimentTypes = new Set ( Object . values ( EXPERIMENT_TYPES ) ) ;
264- ( projectConfig . experiments || [ ] ) . forEach ( experiment => {
265- if ( experiment . type != null && ! validExperimentTypes . has ( experiment . type ) ) {
266- throw new OptimizelyError (
267- 'Experiment "%s" has invalid type "%s". Valid types: %s.' ,
268- experiment . key ,
269- experiment . type ,
270- Array . from ( validExperimentTypes ) . join ( ', ' ) ,
271- ) ;
272- }
273- } ) ;
274-
275263 projectConfig . variationIdMap = { } ;
276264 projectConfig . variationVariableUsageMap = { } ;
277265 ( projectConfig . experiments || [ ] ) . forEach ( experiment => {
@@ -319,6 +307,7 @@ export const createProjectConfig = function(datafileObj?: JSON, datafileStr: str
319307 if ( ! everyoneElseVariation ) {
320308 return ;
321309 }
310+
322311 ( featureFlag . experimentIds || [ ] ) . forEach ( experimentId => {
323312 const experiment = projectConfig . experimentIdMap [ experimentId ] ;
324313 if ( experiment && experiment . type === EXPERIMENT_TYPES . FR ) {
@@ -327,12 +316,9 @@ export const createProjectConfig = function(datafileObj?: JSON, datafileStr: str
327316 entityId : everyoneElseVariation . id ,
328317 endOfRange : 10000 ,
329318 } ) ;
330- // Update variation lookup maps
319+
320+ // Update variation lookup map
331321 experiment . variationKeyMap [ everyoneElseVariation . key ] = everyoneElseVariation ;
332- projectConfig . variationIdMap [ everyoneElseVariation . id ] = everyoneElseVariation ;
333- if ( everyoneElseVariation . variables ) {
334- projectConfig . variationVariableUsageMap [ everyoneElseVariation . id ] = keyBy ( everyoneElseVariation . variables , 'id' ) ;
335- }
336322 }
337323 } ) ;
338324 } ) ;
0 commit comments