<commit_before>export default function ajaxUpload({
  files = [],
  url = '',
  data = {},
  method = 'POST',
  onError = ()=>undefined,
  onProgress = ()=>undefined,
  onSuccess = ()=>undefined,
  filesFieldName = 'files'
  }) {

  files = Array.isArray(files) ? files : [files];

  var xhr = new XMLHttpRequest();
  var formData = new FormData();

  files.forEach(function (file) {
    formData.append(filesFieldName + '[]', file, file.name);
  });
  Object.keys(data || {}).forEach(function (key) {
    formData.append(key, data[key])
  });

  xhr.open(method, url, true);<commit_msg>changed export type<commit_after>export default function ajaxUpload({
  files = [],
  url = '',
  data = {},
  method = 'POST',
  onError = ()=>undefined,
  onProgress = ()=>undefined,
  onSuccess = ()=>undefined,
  filesFieldName = 'files'
  }) {

  files = Array.isArray(files) ? files : [files];

  var xhr = new XMLHttpRequest();
  var formData = new FormData();

  files.forEach(function (file, i) {
    formData.append(filesFieldName + '[' + i + ']', file, file.name);
  });
  Object.keys(data || {}).forEach(function (key) {
    formData.append(key, data[key])
  });

  xhr.open(method, url, true);
{'fraction_non_alphanumeric': 0.18708053691275167, 'fraction_numerical': 0.0, 'mean_word_length': 3.810483870967742, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '5122464', 'n_tokens_mistral': 406, 'n_tokens_neox': 403, 'n_words': 87}