openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
2 lines • 386 B
JavaScript
//!src/infra/mutation-authority.ts
function retainMutationAuthority(e){let t;return(...n)=>{if(t)throw t.error;try{const t=e(...n);if(t!==null&&(typeof t===`object`||typeof t===`function`)&&typeof t.then===`function`){Promise.resolve(t).catch(()=>void 0);throw new TypeError(`mutation authority must be synchronous`)}}catch(e){t={error:e};throw e}}}export{retainMutationAuthority as t};