From dbb08b02d65e89a5526d900862e3a43b4abd5d36 Mon Sep 17 00:00:00 2001 From: Andrew Pietila Date: Wed, 1 Nov 2023 13:06:34 -0500 Subject: [PATCH] Explicit type return on Promise TypeScript's automatic type resolution for the promise returned by the function in getExponentialBackoffResponseHandler determines that it returns a Promise. This commit forces TypeScript to recognize that the resolved object is of type Promise. --- src/base/RequestClient.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/base/RequestClient.ts b/src/base/RequestClient.ts index 002f2866e4..3d573e26b1 100644 --- a/src/base/RequestClient.ts +++ b/src/base/RequestClient.ts @@ -57,7 +57,7 @@ function getExponentialBackoffResponseHandler( ); const delay = Math.floor(baseDelay * Math.random()); // Full jitter backoff - return new Promise((resolve) => { + return new Promise((resolve: (value: Promise) => void) => { setTimeout(() => resolve(axios(config)), delay); }); }