UNPKG

prutill

Version:

Environment-agnostic production-ready promise utility library for managing promise stacks and race conditions. Supports Node.js, Deno, and browsers.

2 lines 184 B
export function promiseWrapper(e){return new Promise(((r,t)=>{try{const n=e();n instanceof Promise?n.then(r).catch(t):r(n)}catch(e){t(e)}}))} //# sourceMappingURL=promiseWrapper.js.map