<commit_before>export default function combinations(...iterators) {
  const last = iterators.pop();

  if (iterators.length === 0) {
    return last.map(x => [x]);
  }
  const combs = combinations(...iterators);
  return combs
    .map(combination => last.map(l => [...combination, l]))
    .reduce((p, n) => p.concat(n), []);
}
<commit_msg>fix bug with combinations result<commit_after>export default function combinations(...iterators) {
  const last = iterators.pop();

  if (iterators.length === 0) {
    return last.toArray().map(x => [x]);
  }
  const combs = combinations(...iterators);
  return combs
    .map(combination => last.map(l => [...combination, l]))
    .reduce((p, n) => p.concat(n), []);
}

{'fraction_non_alphanumeric': 0.19831223628691982, 'fraction_numerical': 0.0028129395218002813, 'mean_word_length': 3.5063291139240507, 'pattern_counts': {'":': 0, '<': 3, '<?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': '203323', 'n_tokens_mistral': 238, 'n_tokens_neox': 235, 'n_words': 54}