<commit_before>define(['underscore', 'jquery'], function(_, $) {
  return function(app) {
    app.components.before('initialize', function(options) {
      var dfd = $.Deferred();
      var optionKeys = _.keys(options);
      _.each(this.requiredOptions || [], function (name) {
        if (!_.contains(optionKeys, name)) {
          dfd.reject('Missing option to component ' + this.componentName + ': ' + name);
        }
      });
      dfd.resolve();
      return dfd.promise();
    });
  };
});<commit_msg>Refactors for easier testing<commit_after>define(['underscore', 'jquery'], function(_, $) {
  var extension = {
    initialize: function (app) {
      app.components.before('initialize', extension.checkOptions);
    },
    checkOptions: function(options) {
      var dfd = $.Deferred();
      var optionKeys = _.keys(options);
      _.each(this.requiredOptions || [], function (name) {
        if (!_.contains(optionKeys, name)) {
          dfd.reject('Missing option to component ' + this.componentName + ': ' + name);
        }
      });
      dfd.resolve();
      return dfd.promise();
    }
  };
  return extension;
});
{'fraction_non_alphanumeric': 0.16946160635481025, 'fraction_numerical': 0.0, 'mean_word_length': 2.8181818181818183, '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': '7548861', 'n_tokens_mistral': 331, 'n_tokens_neox': 325, 'n_words': 66}