UNPKG

return-style

Version:

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

12 lines (10 loc) 203 B
import { pass } from '@blackglory/prelude' export async function getResultPromise<T>( promise: PromiseLike<T> ): Promise<T | undefined> { try { return await promise } catch { pass() } }