packages/optimizely-sdk/lib/core/project_config/index.js
function(projectConfig, experimentKey) {
    if (projectConfig.experimentKeyMap.hasOwnProperty(experimentKey)) {
      var experiment = projectConfig.experimentKeyMap[experimentKey];
      if (!!experiment) {
        return experiment;
      }
    }

    throw new Error(sprintf(ERROR_MESSAGES.EXPERIMENT_KEY_NOT_IN_DATAFILE, MODULE_NAME, experimentKey));
  }
function(projectConfig, experimentKey) {
    if (projectConfig.experimentKeyMap.hasOwnProperty(experimentKey)) {
      var experiment = projectConfig.experimentKeyMap[experimentKey];
      if (!!experiment) {
        return experiment;
      }
    }

    throw new Error(sprintf(ERROR_MESSAGES.EXPERIMENT_KEY_NOT_IN_DATAFILE, MODULE_NAME, experimentKey));
  }
function ( projectConfig , experimentKey ) { if ( projectConfig . experimentKeyMap . hasOwnProperty ( experimentKey ) ) { var experiment = projectConfig . experimentKeyMap [ experimentKey ] ; if ( ! ! experiment ) { return experiment ; } } throw new Error ( sprintf ( ERROR_MESSAGES . EXPERIMENT_KEY_NOT_IN_DATAFILE , MODULE_NAME , experimentKey ) ) ; }
Get experiment from provided experiment key
@param  {Object} projectConfig  Object representing project configuration
@param  {string} experimentKey  Event key for which experiment IDs are to be retrieved
@return {Object} experiment
@throws If experiment key is not in datafile
Get experiment from provided experiment key