From 333acd5c0d5df455c1b61fc03c7a2f0d859c38b6 Mon Sep 17 00:00:00 2001 From: Yarmo Mackenbach Date: Tue, 26 Jan 2021 21:44:17 +0100 Subject: [PATCH] Add promise.allSettled polyfill --- src/claims.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/claims.js b/src/claims.js index e18695a..04435bb 100644 --- a/src/claims.js +++ b/src/claims.js @@ -21,6 +21,18 @@ const serviceproviders = require('./serviceproviders') const keys = require('./keys') const utils = require('./utils') +// Promise.allSettled polyfill +Promise.allSettled = Promise.allSettled || ((promises) => Promise.all(promises.map(p => p + .then(v => ({ + status: 'fulfilled', + value: v, + })) + .catch(e => ({ + status: 'rejected', + reason: e, + })) +))); + const runVerificationJson = ( res, proofData,