packages/optimizely-sdk/lib/core/custom_attribute_condition_evaluator/index.js
function greaterThanEvaluator(condition, userAttributes, logger) {
  var conditionName = condition.name;
  var userValue = userAttributes[conditionName];
  var userValueType = typeof userValue;
  var conditionValue = condition.value;

  if (!fns.isFinite(conditionValue)) {
    logger.log(LOG_LEVEL.WARNING, sprintf(LOG_MESSAGES.UNEXPECTED_CONDITION_VALUE, MODULE_NAME, JSON.stringify(condition)));
    return null;
  }

  if (userValue === null) {
    logger.log(LOG_LEVEL.DEBUG, sprintf(LOG_MESSAGES.UNEXPECTED_TYPE_NULL, MODULE_NAME, JSON.stringify(condition), conditionName));
    return null;
  }

  if (!fns.isNumber(userValue)) {
    logger.log(LOG_LEVEL.WARNING, sprintf(LOG_MESSAGES.UNEXPECTED_TYPE, MODULE_NAME, JSON.stringify(condition), userValueType, conditionName));
    return null;
  }

  if (!fns.isFinite(userValue)) {
    logger.log(LOG_LEVEL.WARNING, sprintf(LOG_MESSAGES.OUT_OF_BOUNDS, MODULE_NAME, JSON.stringify(condition), conditionName));
    return null;
  }

  return userValue > conditionValue;
}
function greaterThanEvaluator(condition, userAttributes, logger) {
  var conditionName = condition.name;
  var userValue = userAttributes[conditionName];
  var userValueType = typeof userValue;
  var conditionValue = condition.value;

  if (!fns.isFinite(conditionValue)) {
    logger.log(LOG_LEVEL.WARNING, sprintf(LOG_MESSAGES.UNEXPECTED_CONDITION_VALUE, MODULE_NAME, JSON.stringify(condition)));
    return null;
  }

  if (userValue === null) {
    logger.log(LOG_LEVEL.DEBUG, sprintf(LOG_MESSAGES.UNEXPECTED_TYPE_NULL, MODULE_NAME, JSON.stringify(condition), conditionName));
    return null;
  }

  if (!fns.isNumber(userValue)) {
    logger.log(LOG_LEVEL.WARNING, sprintf(LOG_MESSAGES.UNEXPECTED_TYPE, MODULE_NAME, JSON.stringify(condition), userValueType, conditionName));
    return null;
  }

  if (!fns.isFinite(userValue)) {
    logger.log(LOG_LEVEL.WARNING, sprintf(LOG_MESSAGES.OUT_OF_BOUNDS, MODULE_NAME, JSON.stringify(condition), conditionName));
    return null;
  }

  return userValue > conditionValue;
}
function greaterThanEvaluator ( condition , userAttributes , logger ) { var conditionName = condition . name ; var userValue = userAttributes [ conditionName ] ; var userValueType = typeof userValue ; var conditionValue = condition . value ; if ( ! fns . isFinite ( conditionValue ) ) { logger . log ( LOG_LEVEL . WARNING , sprintf ( LOG_MESSAGES . UNEXPECTED_CONDITION_VALUE , MODULE_NAME , JSON . stringify ( condition ) ) ) ; return null ; } if ( userValue === null ) { logger . log ( LOG_LEVEL . DEBUG , sprintf ( LOG_MESSAGES . UNEXPECTED_TYPE_NULL , MODULE_NAME , JSON . stringify ( condition ) , conditionName ) ) ; return null ; } if ( ! fns . isNumber ( userValue ) ) { logger . log ( LOG_LEVEL . WARNING , sprintf ( LOG_MESSAGES . UNEXPECTED_TYPE , MODULE_NAME , JSON . stringify ( condition ) , userValueType , conditionName ) ) ; return null ; } if ( ! fns . isFinite ( userValue ) ) { logger . log ( LOG_LEVEL . WARNING , sprintf ( LOG_MESSAGES . OUT_OF_BOUNDS , MODULE_NAME , JSON . stringify ( condition ) , conditionName ) ) ; return null ; } return userValue > conditionValue ; }
Evaluate the given greater than match condition for the given user attributes
@param   {Object}    condition
@param   {Object}    userAttributes
@param   {Object}    logger
@returns {?Boolean}  true if the user attribute value is greater than the condition value,
false if the user attribute value is less than or equal to the condition value,
null if the condition value isn't a number or the user attribute value
isn't a number
Evaluate the given greater than match condition for the given user attributes