UNPKG

return-style

Version:

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

9 lines (8 loc) 124 B
export function isSuccess(fn: () => unknown): boolean { try { fn() return true } catch { return false } }