packages/optimizely-sdk/lib/core/project_config/index.js
function(projectConfig, variable, variation, logger) {
    if (!variable || !variation) {
      return null;
    }

    if (!projectConfig.variationVariableUsageMap.hasOwnProperty(variation.id)) {
      logger.log(LOG_LEVEL.ERROR, sprintf(ERROR_MESSAGES.VARIATION_ID_NOT_IN_DATAFILE_NO_EXPERIMENT, MODULE_NAME, variation.id));
      return null;
    }

    var variableUsages = projectConfig.variationVariableUsageMap[variation.id];
    var variableUsage = variableUsages[variable.id];

    return variableUsage ? variableUsage.value : null;
  }
function(projectConfig, variable, variation, logger) {
    if (!variable || !variation) {
      return null;
    }

    if (!projectConfig.variationVariableUsageMap.hasOwnProperty(variation.id)) {
      logger.log(LOG_LEVEL.ERROR, sprintf(ERROR_MESSAGES.VARIATION_ID_NOT_IN_DATAFILE_NO_EXPERIMENT, MODULE_NAME, variation.id));
      return null;
    }

    var variableUsages = projectConfig.variationVariableUsageMap[variation.id];
    var variableUsage = variableUsages[variable.id];

    return variableUsage ? variableUsage.value : null;
  }
function ( projectConfig , variable , variation , logger ) { if ( ! variable || ! variation ) { return null ; } if ( ! projectConfig . variationVariableUsageMap . hasOwnProperty ( variation . id ) ) { logger . log ( LOG_LEVEL . ERROR , sprintf ( ERROR_MESSAGES . VARIATION_ID_NOT_IN_DATAFILE_NO_EXPERIMENT , MODULE_NAME , variation . id ) ) ; return null ; } var variableUsages = projectConfig . variationVariableUsageMap [ variation . id ] ; var variableUsage = variableUsages [ variable . id ] ; return variableUsage ? variableUsage . value : null ; }
Get the value of the given variable for the given variation. If the given
variable has no value for the given variation, return null. Log an error message if the variation is invalid. If the
variable or variation are invalid, return null.
@param {Object} projectConfig
@param {Object} variable
@param {Object} variation
@param {Object} logger
@return {string|null} The value of the given variable for the given
variation, or null if the given variable has no value
for the given variation or if the variation or variable are invalid
Get the value of the given variable for the given variation . If the given variable has no value for the given variation return null . Log an error message if the variation is invalid . If the variable or variation are invalid return null .