async function allProps(promises) {
  if(!(promises && typeof promises === 'object')) {
    throw new Error(`"promises" must be an object`);
  }
  const keys = Object.keys(promises);
  const values = Object.values(promises);
  const results = await Promise.all(values);
  return keys.reduce((mapped, key, idx) => {
    mapped[key] = results[idx];
    return mapped;
  }, {});
}
/**
 * Like Promise.all over an object.
 * @param {Object<any,Promise>} promises An object with promises as values.
 * @returns {Object<any,any>} A new object with the resolved promise values mapped to keys.
 */
Like Promise.all over an object.
@param {Object} promises An object with promises as values.
@returns {Object} A new object with the resolved promise values mapped to keys.
Like Promise . all over an object . @param { Object } promises An object with promises as values . @returns { Object } A new object with the resolved promise values mapped to keys .
async function allProps(promises) {
  if(!(promises && typeof promises === 'object')) {
    throw new Error(`"promises" must be an object`);
  }
  const keys = Object.keys(promises);
  const values = Object.values(promises);
  const results = await Promise.all(values);
  return keys.reduce((mapped, key, idx) => {
    mapped[key] = results[idx];
    return mapped;
  }, {});
}
async function allProps ( promises ) { if ( ! ( promises && typeof promises === 'object' ) ) { throw new Error ( ` ` ) ; } const keys = Object . keys ( promises ) ; const values = Object . values ( promises ) ; const results = await Promise . all ( values ) ; return keys . reduce ( ( mapped , key , idx ) => { mapped [ key ] = results [ idx ] ; return mapped ; } , { } ) ; }
Like Promise.all over an object.
Like Promise . all over an object .