<commit_before>import Filterizr from './filterizr';
import DefaultOptions from './options';

(function($) {
  //Make sure jQuery exists
  if (!$) throw new Error('Filterizr requires jQuery to work.');

  // Extract .filterizr method on jQuery prototype
  $.fn.filterizr = function() {
    const selector  = `.${this.get(0).className}`;
    const args = arguments;

    console.log(this)


    // user is instantiating Filterizr
    if (!this._fltr && args.length === 0 || (args.length === 1 && typeof args[0] === 'object')) {
      const options = args.length > 0 ? args[0] : DefaultOptions;
      this._fltr = new Filterizr(selector, options);
    }
    // otherwise call the method called
    else if (args.length >= 1 && typeof args[0] === 'string') {
      const method = args[0];
      const methodArgs = Array.prototype.slice.call(args, 1);
      const filterizr = this._fltr;
      switch(method) {
        case 'filter':
          filterizr.filter(...methodArgs);
          return this;
        case 'toggleFilter':
          filterizr.toggleFilter(...methodArgs);
          return this;
        case 'sort':
          filterizr.sort(...methodArgs);
          return this;
        case 'shuffle':
          filterizr.shuffle(...methodArgs);
          return this;
        case 'search':
          filterizr.search(...methodArgs);
          return this;
        case 'setOptions':
          filterizr.setOptions(...methodArgs);
          return this;
        default:
          return;
      }
    }

    return this;
  }
})(jQuery);<commit_msg>remove logs and throw error if user tries to call a method not part of the filterizr api<commit_after>import Filterizr from './filterizr';
import DefaultOptions from './options';

(function($) {
  //Make sure jQuery exists
  if (!$) throw new Error('Filterizr requires jQuery to work.');

  // Extract .filterizr method on jQuery prototype
  $.fn.filterizr = function() {
    const selector  = `.${this.get(0).className}`;
    const args = arguments;

    // user is instantiating Filterizr
    if (!this._fltr && args.length === 0 || (args.length === 1 && typeof args[0] === 'object')) {
      const options = args.length > 0 ? args[0] : DefaultOptions;
      this._fltr = new Filterizr(selector, options);
    }
    // otherwise call the method called
    else if (args.length >= 1 && typeof args[0] === 'string') {
      const method = args[0];
      const methodArgs = Array.prototype.slice.call(args, 1);
      const filterizr = this._fltr;
      switch(method) {
        case 'filter':
          filterizr.filter(...methodArgs);
          return this;
        case 'toggleFilter':
          filterizr.toggleFilter(...methodArgs);
          return this;
        case 'sort':
          filterizr.sort(...methodArgs);
          return this;
        case 'shuffle':
          filterizr.shuffle(...methodArgs);
          return this;
        case 'search':
          filterizr.search(...methodArgs);
          return this;
        case 'setOptions':
          filterizr.setOptions(...methodArgs);
          return this;
        default:
          throw new Error(`${method} is not part of the Filterizr API. Please refer to the docs for more information.`);
          return;
      }
    }

    return this;
  }
})(jQuery);
{'fraction_non_alphanumeric': 0.13278388278388278, 'fraction_numerical': 0.006105006105006105, 'mean_word_length': 2.2253937007874014, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '4001117', 'n_tokens_mistral': 944, 'n_tokens_neox': 923, 'n_words': 267}