From 17225757d9394e25060f9b3f6a9710516373da03 Mon Sep 17 00:00:00 2001 From: Brent Schroeter Date: Sat, 7 Feb 2026 06:49:01 +0000 Subject: [PATCH] set retry config defaults without supplying empty object --- src/retries.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/retries.ts b/src/retries.ts index 07c9a6c..5ae8b2c 100644 --- a/src/retries.ts +++ b/src/retries.ts @@ -3,10 +3,10 @@ */ export function withRetry( fn: (...args: T) => Promise, - { attempts = 6, backoffMs = (attempt) => 1000 * 2 ** attempt }: { + { attempts, backoffMs }: { attempts: number; backoffMs(attempt: number): number; - }, + } = { attempts: 6, backoffMs: (attempt) => 1000 * 2 ** attempt }, ): (...args: T) => Promise { return async (...args: T) => { for (let attempt = 0; attempt < attempts - 1; attempt += 1) {