<commit_before>'use strict';
module.exports = function (promises) {

  if (!Array.isArray(promises)) {
    throw new Error('First argument need to be an array of Promises');
  }

  let count = 0;
  let results = [];

  const iterateeFunc = (previousPromise, currentPromise) => {
    return previousPromise
      .then(function (result) {
        if (count++ !== 0) results = results.concat(result);
        return currentPromise(result, results, count);
      })
  }

  return promises
  // reduce() concatenates the promises. E.g. p1.then(p2.then(p3.then()))<commit_msg>#1: updated comment<commit_after>'use strict';
module.exports = function (promises) {

  if (!Array.isArray(promises)) {
    throw new Error('First argument need to be an array of Promises');
  }

  let count = 0;
  let results = [];

  const iterateeFunc = (previousPromise, currentPromise) => {
    return previousPromise
      .then(function (result) {
        if (count++ !== 0) results = results.concat(result);
        return currentPromise(result, results, count);
      })
  }

  return promises
  // reduce() concatenates the promises. E.g. p1.then(p2).then(p3)
{'fraction_non_alphanumeric': 0.13584574934268187, 'fraction_numerical': 0.009640666082383873, 'mean_word_length': 3.3257575757575757, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '2901636', 'n_tokens_mistral': 351, 'n_tokens_neox': 336, 'n_words': 97}