import { CB } from './utilityTypes'; export function withCatch(cb: CB): () => T | unknown { return () => { try { return cb(); } catch (error) { return error; } }; }