function x(){const i=[],u={run:c,use:p};return u;function c(...n){let h=-1;const t=n.pop();if(typeof t!="function")throw new TypeError("Expected function as last argument, not "+t);f(null,...n);function f(e,...o){const r=i[++h];let l=-1;if(e){t(e);return}for(;++lt.length;let e;f&&t.push(n);try{e=i.apply(this,t)}catch(o){const r=o;if(f&&c)throw r;return n(r)}f||(e&&e.then&&typeof e.then=="function"?e.then(h,n):e instanceof Error?n(e):h(e))}function n(t,...f){c||(c=!0,u(t,...f))}function h(t){n(null,t)}}export{x as t};