UNPKG

return-style

Version:

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

10 lines (9 loc) 159 B
export async function getResultPromise<T>( promise: PromiseLike<T> ): Promise<T | undefined> { try { return await promise } catch { return } }