Add promise.allSettled polyfill

This commit is contained in:
Yarmo Mackenbach 2021-01-26 21:44:17 +01:00
parent 751a8cb6e3
commit 333acd5c0d
No known key found for this signature in database
GPG key ID: 37367F4AF4087AD1

View file

@ -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,