packages/optimizely-sdk/lib/utils/attributes_validator/index.js
function(attributes) {
    if (typeof attributes === 'object' && !Array.isArray(attributes) && attributes !== null) {
      lodashForOwn(attributes, function(value, key) {
        if (typeof value === 'undefined') {
          throw new Error(sprintf(ERROR_MESSAGES.UNDEFINED_ATTRIBUTE, MODULE_NAME, key));
        }
      });
      return true;
    } else {
      throw new Error(sprintf(ERROR_MESSAGES.INVALID_ATTRIBUTES, MODULE_NAME));
    }
  }
function(attributes) {
    if (typeof attributes === 'object' && !Array.isArray(attributes) && attributes !== null) {
      lodashForOwn(attributes, function(value, key) {
        if (typeof value === 'undefined') {
          throw new Error(sprintf(ERROR_MESSAGES.UNDEFINED_ATTRIBUTE, MODULE_NAME, key));
        }
      });
      return true;
    } else {
      throw new Error(sprintf(ERROR_MESSAGES.INVALID_ATTRIBUTES, MODULE_NAME));
    }
  }
function ( attributes ) { if ( typeof attributes === 'object' && ! Array . isArray ( attributes ) && attributes !== null ) { lodashForOwn ( attributes , function ( value , key ) { if ( typeof value === 'undefined' ) { throw new Error ( sprintf ( ERROR_MESSAGES . UNDEFINED_ATTRIBUTE , MODULE_NAME , key ) ) ; } } ) ; return true ; } else { throw new Error ( sprintf ( ERROR_MESSAGES . INVALID_ATTRIBUTES , MODULE_NAME ) ) ; } }
Validates user's provided attributes
@param  {Object}  attributes
@return {boolean} True if the attributes are valid
@throws If the attributes are not valid
Validates user s provided attributes