'use strict'

// Wait until all the promises in the array settle
// and then resolve a promise with all the fulfilment values and/or rejections.

module.exports = (array) => Promise.all(array.map((promise) => {
  return Promise.resolve(promise) // Make sure it is a promise
  .then((value) => {
    return {
      fulfilled: true,
      rejected: false,
      value: value,
      reason: null
    }
  }, (err) => {
    return {
      fulfilled: false,
      rejected: true,
      value: null,
      reason: err
    }
  })
}))

@@ -205,19 +205,10 @@
 ) =%3E
+%0A
  
-%7B%0A  return
  Pro
@@ -273,37 +273,25 @@
 ((value) =%3E 
-%7B%0A    return 
+(
 %7B%0A      fulf
@@ -365,25 +365,20 @@
 n: null%0A
-  
   %7D
-%0A  %7D
+)
 , (err) 
@@ -384,21 +384,9 @@
  =%3E 
-%7B%0A    return 
+(
 %7B%0A  
@@ -470,19 +470,13 @@
 err%0A
-  
   %7D
-%0A  %7D
+)
 )%0A
-%7D
 ))%0A

update promise/settle — streamline