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 isFailure(fn: () => unknown): boolean { try { fn() return false } catch { return true } }