packages/optimizely-sdk/lib/utils/config_validator/index.js
function(config) {
    if (config.errorHandler && (typeof config.errorHandler.handleError !== 'function')) {
      throw new Error(sprintf(ERROR_MESSAGES.INVALID_ERROR_HANDLER, MODULE_NAME));
    }

    if (config.eventDispatcher && (typeof config.eventDispatcher.dispatchEvent !== 'function')) {
      throw new Error(sprintf(ERROR_MESSAGES.INVALID_EVENT_DISPATCHER, MODULE_NAME));
    }

    if (config.logger && (typeof config.logger.log !== 'function')) {
      throw new Error(sprintf(ERROR_MESSAGES.INVALID_LOGGER, MODULE_NAME));
    }

    return true;
  }
function(config) {
    if (config.errorHandler && (typeof config.errorHandler.handleError !== 'function')) {
      throw new Error(sprintf(ERROR_MESSAGES.INVALID_ERROR_HANDLER, MODULE_NAME));
    }

    if (config.eventDispatcher && (typeof config.eventDispatcher.dispatchEvent !== 'function')) {
      throw new Error(sprintf(ERROR_MESSAGES.INVALID_EVENT_DISPATCHER, MODULE_NAME));
    }

    if (config.logger && (typeof config.logger.log !== 'function')) {
      throw new Error(sprintf(ERROR_MESSAGES.INVALID_LOGGER, MODULE_NAME));
    }

    return true;
  }
function ( config ) { if ( config . errorHandler && ( typeof config . errorHandler . handleError !== 'function' ) ) { throw new Error ( sprintf ( ERROR_MESSAGES . INVALID_ERROR_HANDLER , MODULE_NAME ) ) ; } if ( config . eventDispatcher && ( typeof config . eventDispatcher . dispatchEvent !== 'function' ) ) { throw new Error ( sprintf ( ERROR_MESSAGES . INVALID_EVENT_DISPATCHER , MODULE_NAME ) ) ; } if ( config . logger && ( typeof config . logger . log !== 'function' ) ) { throw new Error ( sprintf ( ERROR_MESSAGES . INVALID_LOGGER , MODULE_NAME ) ) ; } return true ; }
Validates the given config options
@param  {Object} config
@param  {Object} config.errorHandler
@param  {Object} config.eventDispatcher
@param  {Object} config.logger
@return {Boolean} True if the config options are valid
@throws If any of the config options are not valid
Validates the given config options