Skip to content

Commit 15ee586

Browse files
committed
fix!: Replace mergeAbortSignals with AbortSignal.any
1 parent dee9874 commit 15ee586

File tree

4 files changed

+2
-34
lines changed

4 files changed

+2
-34
lines changed

src/adapters/config/http-config.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { type HttpConfig, type Serializer } from "../../interfaces";
2-
import { mergeAbortSignals } from "./merge-abort-signals";
32
import { mergeHeadersInit } from "./merge-headers-init";
43

54
export interface MastoHttpConfigProps {
@@ -93,6 +92,6 @@ export class HttpConfigImpl implements HttpConfig {
9392
signals.push(signal);
9493
}
9594

96-
return signals.length === 1 ? signals[0] : mergeAbortSignals(signals);
95+
return AbortSignal.any(signals);
9796
}
9897
}

src/adapters/config/merge-abort-signals.spec.ts

Lines changed: 0 additions & 16 deletions
This file was deleted.

src/adapters/config/merge-abort-signals.ts

Lines changed: 0 additions & 13 deletions
This file was deleted.

src/adapters/http/http-native-impl.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,7 @@ export class HttpNativeImpl extends BaseHttp implements Http {
115115
);
116116
}
117117

118-
// TODO: Remove this handling when `AbortSignal.any` is shipped
119-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
120-
if (error != undefined && (error as any).name === "TimeoutError") {
118+
if (error instanceof DOMException && error.name === "TimeoutError") {
121119
return new MastoTimeoutError(`Request timed out`, { cause: error });
122120
}
123121

0 commit comments

Comments
 (0)