{"size": 454, "ext": "js", "max_stars_repo_path": "src/main/modules/search/promise-extends.js", "max_stars_repo_name": "nsplup/aReader", "max_stars_repo_stars_event_min_datetime": "2022-01-31T03:04:00.000Z", "max_stars_repo_stars_event_max_datetime": "2022-01-31T03:04:00.000Z", "max_issues_repo_path": "src/main/modules/search/promise-extends.js", "max_issues_repo_name": "nsplup/aReader", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/main/modules/search/promise-extends.js", "max_forks_repo_name": "nsplup/aReader", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 21.619047619, "max_line_length": 45, "alphanum_fraction": 0.4955947137}
function finish (promises) {
  return new Promise((res, rej) => {
    const resolve = []
    const reject = []
    let finished = 0

    promises.forEach(promise => {
      promise
        .then(res => resolve.push(res))
        .catch(res => reject.push(res))
        .finally(() => {
          finished += 1
          if (finished === promises.length) {
            res({ resolve, reject })
          }
        })
    })
  })
}

module.exports = finish