packages/optimizely-sdk/lib/utils/user_profile_service_validator/index.js
function(userProfileServiceInstance) {
    if (typeof userProfileServiceInstance.lookup !== 'function') {
      throw new Error(sprintf(ERROR_MESSAGES.INVALID_USER_PROFILE_SERVICE, MODULE_NAME, 'Missing function \'lookup\''));
    } else if (typeof userProfileServiceInstance.save !== 'function') {
      throw new Error(sprintf(ERROR_MESSAGES.INVALID_USER_PROFILE_SERVICE, MODULE_NAME, 'Missing function \'save\''));
    }
    return true;
  }
function(userProfileServiceInstance) {
    if (typeof userProfileServiceInstance.lookup !== 'function') {
      throw new Error(sprintf(ERROR_MESSAGES.INVALID_USER_PROFILE_SERVICE, MODULE_NAME, 'Missing function \'lookup\''));
    } else if (typeof userProfileServiceInstance.save !== 'function') {
      throw new Error(sprintf(ERROR_MESSAGES.INVALID_USER_PROFILE_SERVICE, MODULE_NAME, 'Missing function \'save\''));
    }
    return true;
  }
function ( userProfileServiceInstance ) { if ( typeof userProfileServiceInstance . lookup !== 'function' ) { throw new Error ( sprintf ( ERROR_MESSAGES . INVALID_USER_PROFILE_SERVICE , MODULE_NAME , 'Missing function \'lookup\'' ) ) ; } else if ( typeof userProfileServiceInstance . save !== 'function' ) { throw new Error ( sprintf ( ERROR_MESSAGES . INVALID_USER_PROFILE_SERVICE , MODULE_NAME , 'Missing function \'save\'' ) ) ; } return true ; }
Validates user's provided user profile service instance
@param  {Object}  userProfileServiceInstance
@return {boolean} True if the instance is valid
@throws If the instance is not valid
Validates user s provided user profile service instance