packages/optimizely-sdk/lib/core/project_config/index.js
function(projectConfig, experimentKey) {
    var experiment = projectConfig.experimentKeyMap[experimentKey];
    if (fns.isEmpty(experiment)) {
      throw new Error(sprintf(ERROR_MESSAGES.INVALID_EXPERIMENT_KEY, MODULE_NAME, experimentKey));
    }
    return experiment.trafficAllocation;
  }
function(projectConfig, experimentKey) {
    var experiment = projectConfig.experimentKeyMap[experimentKey];
    if (fns.isEmpty(experiment)) {
      throw new Error(sprintf(ERROR_MESSAGES.INVALID_EXPERIMENT_KEY, MODULE_NAME, experimentKey));
    }
    return experiment.trafficAllocation;
  }
function ( projectConfig , experimentKey ) { var experiment = projectConfig . experimentKeyMap [ experimentKey ] ; if ( fns . isEmpty ( experiment ) ) { throw new Error ( sprintf ( ERROR_MESSAGES . INVALID_EXPERIMENT_KEY , MODULE_NAME , experimentKey ) ) ; } return experiment . trafficAllocation ; }
Given an experiment key, returns the traffic allocation within that experiment
@param  {Object} projectConfig Object representing project configuration
@param  {string} experimentKey Key representing the experiment
@return {Array<Object>}        Traffic allocation for the experiment
@throws If experiment key is not in datafile
Given an experiment key returns the traffic allocation within that experiment