From eca111aaa76343419b4c923e3275cd213756cb99 Mon Sep 17 00:00:00 2001 From: Yarmo Mackenbach Date: Thu, 10 Dec 2020 23:21:22 +0100 Subject: [PATCH] Allow promises to reject without blocking execution --- src/claims.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/claims.js b/src/claims.js index f47d2c2..a3993dd 100644 --- a/src/claims.js +++ b/src/claims.js @@ -123,8 +123,10 @@ const verify = async (input, fingerprint, opts) => { }) }) - return Promise.all(promises).then((values) => { - return values + return Promise.allSettled(promises).then((values) => { + return values.map((obj, i) => { + return obj.value + }) }) } if (input instanceof Array) { @@ -140,8 +142,10 @@ const verify = async (input, fingerprint, opts) => { }) }) - return Promise.all(promises).then((values) => { - return values + return Promise.allSettled(promises).then((values) => { + return values.map((obj, i) => { + return obj.value + }) }) }