Initial commit: KidsAI Explorer with complete functionality
- Complete KidsAI Explorer application - Multi-language support (English/German) - AI-powered educational guidance using OpenAI - Interactive chat interface for children - Proper placeholder translation fixes - Mobile-responsive design - Educational framework for critical thinking
This commit is contained in:
22
node_modules/openai/lib/Util.mjs
generated
vendored
Normal file
22
node_modules/openai/lib/Util.mjs
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* Like `Promise.allSettled()` but throws an error if any promises are rejected.
|
||||
*/
|
||||
export 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;
|
||||
};
|
||||
//# sourceMappingURL=Util.mjs.map
|
||||
Reference in New Issue
Block a user