<commit_before>/**
 * Convert a JSON to an (Opal) Hash.
 * @private
 */
var toHash = function (object) {
  return object && !('$$smap' in object) ? Opal.hash(object) : object;
};

/**
 * Convert an (Opal) Hash to JSON.
 * @private
 */
var fromHash = function (hash) {
  var object = {};
  var data = hash.$$smap;
  for (var key in data) {
    object[key] = data[key];<commit_msg>⚡️ Improve toHash function (#623)<commit_after>/**
 * Convert a JSON to an (Opal) Hash.
 * @private
 */
var toHash = function (object) {
  return object && !object.$$is_hash ? Opal.hash2(Object.keys(object), object) : object;
};

/**
 * Convert an (Opal) Hash to JSON.
 * @private
 */
var fromHash = function (hash) {
  var object = {};
  var data = hash.$$smap;
  for (var key in data) {
    object[key] = data[key];
{'fraction_non_alphanumeric': 0.17839195979899497, 'fraction_numerical': 0.005025125628140704, 'mean_word_length': 3.3315217391304346, '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': '6617051', 'n_tokens_mistral': 286, 'n_tokens_neox': 282, 'n_words': 88}