@whatwg-node/node-fetch
Advanced tools
Comparing version 0.8.0-alpha-20241212151314-570907b87da5f77c7c6a2d7476cd10a1bdd2b3dc to 0.8.0-alpha-20241212154840-0a0effe808a6614e0a3afd853126a38641485756
@@ -42,12 +42,18 @@ "use strict"; | ||
any(signals) { | ||
// eslint-disable-next-line @typescript-eslint/no-this-alias | ||
const thisSignal = this; | ||
function onAbort(ev) { | ||
const signal = ev.target || this; | ||
this.sendAbort(signal.reason); | ||
for (const signal of signals) { | ||
signal.removeEventListener('abort', onAbort); | ||
signal.reason = this.reason; | ||
if (signal.sendAbort) { | ||
signal.sendAbort(this.reason); | ||
const signal = ev.target; | ||
thisSignal.sendAbort(signal.reason); | ||
thisSignal.reason = signal.reason; | ||
thisSignal.aborted = true; | ||
for (const otherSignal of signals) { | ||
otherSignal.removeEventListener('abort', onAbort); | ||
if (otherSignal !== signal && !otherSignal.aborted) { | ||
if (otherSignal.sendAbort) { | ||
otherSignal.sendAbort(signal.reason); | ||
} | ||
otherSignal.reason = signal.reason; | ||
otherSignal.aborted = true; | ||
} | ||
signal.aborted = true; | ||
} | ||
@@ -54,0 +60,0 @@ } |
@@ -39,12 +39,18 @@ import { DisposableSymbols } from '@whatwg-node/disposablestack'; | ||
any(signals) { | ||
// eslint-disable-next-line @typescript-eslint/no-this-alias | ||
const thisSignal = this; | ||
function onAbort(ev) { | ||
const signal = ev.target || this; | ||
this.sendAbort(signal.reason); | ||
for (const signal of signals) { | ||
signal.removeEventListener('abort', onAbort); | ||
signal.reason = this.reason; | ||
if (signal.sendAbort) { | ||
signal.sendAbort(this.reason); | ||
const signal = ev.target; | ||
thisSignal.sendAbort(signal.reason); | ||
thisSignal.reason = signal.reason; | ||
thisSignal.aborted = true; | ||
for (const otherSignal of signals) { | ||
otherSignal.removeEventListener('abort', onAbort); | ||
if (otherSignal !== signal && !otherSignal.aborted) { | ||
if (otherSignal.sendAbort) { | ||
otherSignal.sendAbort(signal.reason); | ||
} | ||
otherSignal.reason = signal.reason; | ||
otherSignal.aborted = true; | ||
} | ||
signal.aborted = true; | ||
} | ||
@@ -51,0 +57,0 @@ } |
{ | ||
"name": "@whatwg-node/node-fetch", | ||
"version": "0.8.0-alpha-20241212151314-570907b87da5f77c7c6a2d7476cd10a1bdd2b3dc", | ||
"version": "0.8.0-alpha-20241212154840-0a0effe808a6614e0a3afd853126a38641485756", | ||
"description": "Fetch API implementation for Node", | ||
@@ -5,0 +5,0 @@ "sideEffects": false, |
247772
6269