Skip to content

Commit d6843f9

Browse files
committed
fix: normalize fetch props in fetchAdvanced()
1 parent 96c4274 commit d6843f9

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

.changeset/whole-zoos-grab.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@sv443-network/coreutils": patch
3+
---
4+
5+
Fixed underlying `fetch()` props in `fetchAdvanced()` in stricter environments

lib/misc.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,9 @@ export type FetchAdvancedOpts = Prettify<
5656

5757
/** Calls the fetch API with special options like a timeout */
5858
export async function fetchAdvanced(input: string | RequestInfo | URL, options: FetchAdvancedOpts = {}): Promise<Response> {
59-
const { timeout = 10000 } = options;
59+
const { timeout = 10000, signal, ...restOpts } = options;
6060
const ctl = new AbortController();
6161

62-
const { signal, ...restOpts } = options;
63-
6462
signal?.addEventListener("abort", () => ctl.abort());
6563

6664
let sigOpts: Partial<RequestInit> = {},

0 commit comments

Comments
 (0)