<commit_before>import $ from 'jquery';

class Feedback {

  constructor(username, message, page, other) {
    this.username = username;
    this.message = message;
    this.page = page;
    this.other = other;
  }

  submit() {
    let data = {
      username: this.username || 'No Username',
      message: this.message || 'No message',
      page: this.page || 'No Page',
      other: this.other
    };
    const promise = $.ajax({
      type: 'POST',
      contentType: 'application/json',
      url: `${config.apiRoot}/feedback`,
      dataType: 'json',
      data: JSON.stringify(data)
    });

    return promise;
  }
}

export default Feedback;<commit_msg>move arguments into object that can be destructured<commit_after>import $ from 'jquery';

class Feedback {

  constructor(payload) {
    const {
      username,
      message,
      page,
      other
    } = payload;

    this.username = username;
    this.message = message;
    this.page = page;
    this.other = other;
  }

  submit() {
    let data = {
      username: this.username || 'No Username',
      message: this.message || 'No message',
      page: this.page || 'No Page',
      other: this.other
    };
    
    return $.ajax({
      type: 'POST',
      contentType: 'application/json',
      url: `${config.apiRoot}/feedback`,
      dataType: 'json',
      data: JSON.stringify(data)
    });
  }
}

export default Feedback;
{'fraction_non_alphanumeric': 0.13704496788008566, 'fraction_numerical': 0.0, 'mean_word_length': 2.378313253012048, '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': '2478318', 'n_tokens_mistral': 437, 'n_tokens_neox': 425, 'n_words': 110}