await-result
Version:
Error handling for async functions without try/catch blocks
3 lines (2 loc) • 683 B
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.awaitResult=t()}(this,function(){return"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator"))),function(e,t){try{return Promise.resolve(function(t,o){try{var n=Promise.resolve(e).then(function(e){return[void 0,e]})}catch(e){return o(e)}return n&&n.then?n.then(void 0,o):n}(0,function(e){return"function"==typeof t?[t(e)]:[e]}))}catch(e){return Promise.reject(e)}}});
//# sourceMappingURL=index.umd.js.map