<commit_before>/**
 * Form data into javascript object
 * @author <NAME> <<EMAIL>>
 * @version 0.0.1
 * @internal review jQuery .serializeArray() and optimize
 */
;(function ($) {

  'use strict';

  $.fn.extend({
    objectify: function (exclusions) {
      var formData = $(this).serializeArray();
      var obj = {};
      var key;

      exclusions = exclusions || [];

      for (key in formData) {
        if (formData.hasOwnProperty(key)) {
          if (exclusions.indexOf(formData[key].name) > -1) { continue; }
          obj[formData[key].name] = formData[key].value;
        }
      }

      return obj;
    }
  });
}(jQuery));<commit_msg>Refactor.<commit_after>/**
 * Form data into javascript object
 * @author <NAME> <<EMAIL>>
 * @version 0.0.2
 */
;(function ($) {

  'use strict';

  $.fn.extend({
    objectify: function (exclusions, sanitize) {
      var formData = $(this).serializeArray();
      var obj = {};
      var key;
      var name;

      exclusions = exclusions || [];
      sanitize = sanitize || false;

      for (key in formData) {
        name = formData[key].name;
        if (exclusions.indexOf(name) > -1) {
          continue;
        }
        if (sanitize && sanitize.hasOwnProperty(name)) {
          obj[name] = sanitize[name](formData[key].value);
          continue;
        }
        obj[name] = formData[key].value;
      }

      return obj;
    }
  });
}(jQuery));
{'fraction_non_alphanumeric': 0.16206652512384997, 'fraction_numerical': 0.005661712668082095, 'mean_word_length': 2.228310502283105, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, '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': '6114674', 'n_tokens_mistral': 460, 'n_tokens_neox': 442, 'n_words': 101}