diff --git a/packages/internal/src/utils.js b/packages/internal/src/utils.js index d5ca684c8e5..bbc2954fb50 100644 --- a/packages/internal/src/utils.js +++ b/packages/internal/src/utils.js @@ -349,21 +349,6 @@ export const allValues = async obj => { return harden(fromEntries(zip(keys(obj), resolved))); }; -/** - * Just like allValues above but use this when you want to silently handle rejected promises - * and still keep using the values of resolved ones. - * - * @type - * { >>(obj: T) => Promise<{ [K in keyof T]: Awaited}> } - */ -export const allValuesSettled = async obj => { - const resolved = await Promise.allSettled(values(obj)); - // @ts-expect-error - const valuesMapped = resolved.map(({ value }) => value); - // @ts-expect-error cast - return harden(fromEntries(zip(keys(obj), valuesMapped))); -}; - /** * A tee implementation where all readers are synchronized with each other. * They all consume the source stream in lockstep, and any one returning or diff --git a/packages/internal/test/test-utils.js b/packages/internal/test/test-utils.js index 41f4c6a9319..4e64c0e1632 100644 --- a/packages/internal/test/test-utils.js +++ b/packages/internal/test/test-utils.js @@ -13,7 +13,6 @@ import { forever, deeplyFulfilledObject, synchronizedTee, - allValuesSettled, } from '../src/utils.js'; test('fromUniqueEntries', t => { @@ -264,17 +263,3 @@ test('synchronizedTee - consume synchronized', async t => { t.deepEqual(output1, sourceData.slice(0, i)); t.deepEqual(output2, sourceData.slice(0, i)); }); - -test('allValuesSettled', async t => { - const result = await allValuesSettled({ - promiseOne: Promise.resolve('I am a happy promise - One'), - promiseTwo: Promise.reject(new Error('I am an upset promise')), - promiseThree: Promise.resolve('I am a happy promise - Three'), - }); - - t.deepEqual(result, { - promiseOne: 'I am a happy promise - One', - promiseTwo: undefined, - promiseThree: 'I am a happy promise - Three', - }); -});