• Helper method to support old NodeJS callback style on promises

    Type Parameters

    • P extends PromiseLike<T>

    • T = Awaited<P>

    Parameters

    • promise: P
    • Optional callback: ((err, value) => any)

      the callback to register

        • (err, value): any
        • Parameters

          • err: any
          • value: undefined | T

          Returns any

    Returns PromiseLike<T> | P

    Promise object on which the callback is integrated