<commit_before>/**
 * UniqueItems
 */
var uniqueItemsAttribute = function uniqueItems(property, propertyValue, attributeValue, propertyAttributes, callback) {

  var self =  this;

  each(propertyValue, function(index, value) {
    if ((propertyValue.indexOf(value) < index)) {
      self.addError();
    }
  });

  return callback();

};

// Export
Validation.prototype.addAttribute('uniqueItems', uniqueItemsAttribute);<commit_msg>The ‘uniqueItems’ attribute is now fully compliant with the JSON Schema Internet Draft<commit_after>(function() {

  /**
   * UniqueItems
   */
  var attribute = function uniqueItems(property, propertyValue, attributeValue, propertyAttributes, callback) {

    var self =  this;

    each(propertyValue, function(index, value) {

      if (isString(value)) {
        if ((propertyValue.indexOf(value) < index)) {
          self.addError();
        }
      }

      if (isObject(value) || isArray(value)) {
        propertyValue.forEach(function(subValue, subIndex) {

          if (subIndex !== index) {
            if (isEqual(value, subValue)) {
              self.addError();
            }
          }

        });
      }

    });

    return callback();

  };

  // Export
  Validation.prototype.addAttribute('uniqueItems', attribute);

}());
{'fraction_non_alphanumeric': 0.13125, 'fraction_numerical': 0.0, 'mean_word_length': 2.8700906344410875, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '516455', 'n_tokens_mistral': 366, 'n_tokens_neox': 344, 'n_words': 75}