Skip to content

Commit df7a6d8

Browse files
ShreyasPatil3105ShreyasPatil3105
authored andcommitted
refactor(github): add type annotation to fetchWithRetry return type
1 parent e15a46a commit df7a6d8

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/github.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ const GRAPHQL_TIMEOUT_MS = 8000; // 8s for GraphQL endpoint
1717
const REST_TIMEOUT_MS = 5000; // 5s for REST endpoints
1818

1919
export async function fetchWithRetry(
20-
url: string,
20+
url: string | URL,
2121
options: RequestInit,
2222
attempt = 0,
2323
timeoutMs?: number
2424
): Promise<Response> {
2525
// Determine default timeout based on endpoint type if not explicitly provided.
2626
// GraphQL calls carry a larger payload and need a slightly longer window.
2727
const resolvedTimeout =
28-
timeoutMs ?? (url.includes('graphql') ? GRAPHQL_TIMEOUT_MS : REST_TIMEOUT_MS);
28+
timeoutMs ?? (url.toString().includes('graphql') ? GRAPHQL_TIMEOUT_MS : REST_TIMEOUT_MS);
2929

3030
if (options.signal?.aborted) {
3131
throw new Error('AbortError');

0 commit comments

Comments
 (0)