cloudcmd/common/try-to-promise-all.js
2025-12-31 14:13:10 +02:00

13 lines
246 B
JavaScript

'use strict';
const {tryToCatch} = require('try-to-catch');
const all = Promise.all.bind(Promise);
module.exports = async (a) => {
const [e, result = []] = await tryToCatch(all, a);
return [
e,
...result,
];
};