UNPKG

return-style

Version:

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

9 lines (8 loc) 167 B
export async function isFailurePromise(promise: PromiseLike<unknown>): Promise<boolean> { try { await promise return false } catch { return true } }