prom-utils
Advanced tools
Comparing version 0.12.0 to 0.12.1
@@ -0,1 +1,5 @@ | ||
# 0.12.1 | ||
- Fixed type for `raceTimeout`. | ||
# 0.12.0 | ||
@@ -2,0 +6,0 @@ |
@@ -140,2 +140,2 @@ import makeError from 'make-error'; | ||
*/ | ||
export declare const raceTimeout: <A>(prom: Promise<A>, timeout: number) => Promise<unknown>; | ||
export declare const raceTimeout: <A>(prom: Promise<A>, timeout: number) => Promise<typeof TIMEOUT | Awaited<A>>; |
{ | ||
"name": "prom-utils", | ||
"version": "0.12.0", | ||
"version": "0.12.1", | ||
"description": "Promise utilities: rate limiting, queueing/batching, defer, etc.", | ||
@@ -5,0 +5,0 @@ "author": "GovSpend", |
@@ -477,5 +477,5 @@ import _debug from 'debug' | ||
export const raceTimeout = <A>(prom: Promise<A>, timeout: number) => | ||
Promise.race([ | ||
Promise.race<A | typeof TIMEOUT>([ | ||
prom, | ||
new Promise((resolve) => setTimeout(() => resolve(TIMEOUT), timeout)), | ||
]) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
63654