Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const allPromises = Object.keys(obj).map(key =>
pReflect(obj[key]).then(val => {
if (val.isFulfilled) {
returnValue[key] = val.value;
} else if (val.isRejected) {
errors[key] = val.reason;
}
return val;
})
);