<commit_before>//
// Copyright (c) 2016 DrSmugleaf
//

"use strict"

class ObjectUtil {
  constructor() {}
}

ObjectUtil.prototype.hasKey = function(obj, key) {
  return obj.hasOwnProperty(key)
}

ObjectUtil.prototype.hasValue = function(obj, value) {
  for(let v in obj) {
    if(value === v) return true
  }
}

ObjectUtil.prototype.hasKeyAndValue = function(obj, key, value) {
  return obj.hasOwnProperty(key) && obj[key] === value
}

module.exports = ObjectUtil
<commit_msg>Changed ObjectUtil.hasValue to check if the property is from the object instance and not inherited<commit_after>//
// Copyright (c) 2016 DrSmugleaf
//

"use strict"

class ObjectUtil {
  constructor() {}
}

ObjectUtil.prototype.hasKey = function(object, key) {
  return object.hasOwnProperty(key)
}

ObjectUtil.prototype.hasValue = function(object, value) {
  for(var property in object) {
    if(object.hasOwnProperty(property) && object[property] === value) return property
  }
}

ObjectUtil.prototype.hasKeyAndValue = function(obj, key, value) {
  return obj.hasOwnProperty(key) && obj[key] === value
}

module.exports = ObjectUtil

{'fraction_non_alphanumeric': 0.12949640287769784, 'fraction_numerical': 0.007194244604316547, 'mean_word_length': 4.537313432835821, 'pattern_counts': {'":': 0, '<': 3, '<?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': '3271880', 'n_tokens_mistral': 360, 'n_tokens_neox': 356, 'n_words': 87}