• If the incoming function returns a promise, return the promise. Otherwise, return a promise that resolves to the incoming function's return value.

    Type Parameters

    • T

    Parameters

    • result: T

    Returns
        | (T extends Promise<U> ? Promise<U> : never)
        | (T extends Promise<unknown> ? never : Promise<T>)