UNPKG

return-style

Version:

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

10 lines (8 loc) 156 B
import { pass } from '@blackglory/prelude' export function getResult<T>(fn: () => T): T | undefined { try { return fn() } catch { pass() } }