Function wrapPromiseInTimeout

  • Wraps an already-created Promise in a timeout, causing a rejection if the original Promise isn't resolved by then.

    Type Parameters

    • T

    Parameters

    • duration: Readonly<Partial<Record<DurationUnit, undefined | number>>>
    • originalPromise: PromiseLike<T>
    • OptionalfailureMessage: string

    Returns Promise<T>