dashboard-ui/modules/polyfills/promise.js
2023-08-31 15:30:17 +02:00

1 line
474 B
JavaScript

"function"!=typeof Promise.any&&(Promise.any=function(n){return new Promise(function(e,o,t,i){t=[],i=n.map(function(n,r){return Promise.resolve(n).then(e,function(n){return t[r]=n,--i||o({errors:t})})}).length})}),"function"!=typeof Promise.allSettled&&(Promise.allSettled=function(t){var e=this;return e.all(t.map(function(t){return e.resolve(t).then(this.$,this._)},{$:function(t){return{status:"fulfilled",value:t}},_:function(t){return{status:"rejected",reason:t}}}))});