cloudcmd/common/try-to-promise-all.js
2020-12-22 13:29:19 +02:00

12 lines
223 B
JavaScript

import tryToCatch from 'try-to-catch';
const all = Promise.all.bind(Promise);
export default async (a) => {
const [e, result = []] = await tryToCatch(all, a);
return [
e,
...result,
];
};