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: MaybePromise<T>
    • OptionalfailureMessage: string

    Returns Promise<T>