D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
etb1lp46s9ed
/
washeet.softurecs.com
/
node_modules
/
openai
/
lib
/
Filename :
Util.js
back
Copy
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.allSettledWithThrow = void 0; /** * Like `Promise.allSettled()` but throws an error if any promises are rejected. */ const allSettledWithThrow = async (promises) => { const results = await Promise.allSettled(promises); const rejected = results.filter((result) => result.status === 'rejected'); if (rejected.length) { for (const result of rejected) { console.error(result.reason); } throw new Error(`${rejected.length} promise(s) failed - see the above errors`); } // Note: TS was complaining about using `.filter().map()` here for some reason const values = []; for (const result of results) { if (result.status === 'fulfilled') { values.push(result.value); } } return values; }; exports.allSettledWithThrow = allSettledWithThrow; //# sourceMappingURL=Util.js.map