mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 18:48:27 +00:00
fix: validate AbortSignal instances before calling AbortSignal.any() (#7277) (thanks @Elarwei001)
This commit is contained in:
@@ -12,11 +12,7 @@ function throwAbortError(): never {
|
||||
* where the AbortSignal constructor may differ.
|
||||
*/
|
||||
function isAbortSignal(obj: unknown): obj is AbortSignal {
|
||||
if (!obj || typeof obj !== "object") {
|
||||
return false;
|
||||
}
|
||||
const signal = obj as Record<string, unknown>;
|
||||
return typeof signal.aborted === "boolean" && typeof signal.addEventListener === "function";
|
||||
return obj instanceof AbortSignal;
|
||||
}
|
||||
|
||||
function combineAbortSignals(a?: AbortSignal, b?: AbortSignal): AbortSignal | undefined {
|
||||
|
||||
Reference in New Issue
Block a user