fix: normalize abort signals for fetch
This commit is contained in:
@@ -28,3 +28,9 @@ export function wrapFetchWithAbortSignal(fetchImpl: typeof fetch): typeof fetch
|
||||
}) as typeof fetch;
|
||||
return Object.assign(wrapped, fetchImpl);
|
||||
}
|
||||
|
||||
export function resolveFetch(fetchImpl?: typeof fetch): typeof fetch | undefined {
|
||||
const resolved = fetchImpl ?? globalThis.fetch;
|
||||
if (!resolved) return undefined;
|
||||
return wrapFetchWithAbortSignal(resolved);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user