UNPKG

return-style

Version:

Non-intrusively convert the result of any function or promise to the user's desired style.

8 lines (7 loc) 112 B
export function getResult<T>(fn: () => T): T | undefined { try { return fn() } catch { return } }