@whatwg-node/node-fetch
Advanced tools
Comparing version 0.4.0-alpha-20230515131253-e1eec20 to 0.4.0-alpha-20230515132257-4514d91
@@ -58,2 +58,3 @@ "use strict"; | ||
return new Promise((resolve, reject) => { | ||
var _a; | ||
try { | ||
@@ -84,2 +85,12 @@ const url = new URL_js_1.PonyfillURL(fetchRequest.url, 'http://localhost'); | ||
}); | ||
// TODO: will be removed after v16 reaches EOL | ||
(_a = fetchRequest.signal) === null || _a === void 0 ? void 0 : _a.addEventListener('abort', () => { | ||
if (!nodeRequest.aborted) { | ||
nodeRequest.abort(); | ||
} | ||
}); | ||
// TODO: will be removed after v16 reaches EOL | ||
nodeRequest.once('abort', (reason) => { | ||
reject(new AbortError_js_1.PonyfillAbortError(reason)); | ||
}); | ||
nodeRequest.once('response', nodeResponse => { | ||
@@ -128,6 +139,2 @@ let responseBody = nodeResponse; | ||
}); | ||
// TODO: will be removed after v16 reaches EOL | ||
nodeRequest.once('abort', (reason) => { | ||
reject(new AbortError_js_1.PonyfillAbortError(reason)); | ||
}); | ||
nodeRequest.once('error', reject); | ||
@@ -134,0 +141,0 @@ if (nodeReadable) { |
@@ -55,2 +55,3 @@ import { createReadStream } from 'fs'; | ||
return new Promise((resolve, reject) => { | ||
var _a; | ||
try { | ||
@@ -81,2 +82,12 @@ const url = new PonyfillURL(fetchRequest.url, 'http://localhost'); | ||
}); | ||
// TODO: will be removed after v16 reaches EOL | ||
(_a = fetchRequest.signal) === null || _a === void 0 ? void 0 : _a.addEventListener('abort', () => { | ||
if (!nodeRequest.aborted) { | ||
nodeRequest.abort(); | ||
} | ||
}); | ||
// TODO: will be removed after v16 reaches EOL | ||
nodeRequest.once('abort', (reason) => { | ||
reject(new PonyfillAbortError(reason)); | ||
}); | ||
nodeRequest.once('response', nodeResponse => { | ||
@@ -125,6 +136,2 @@ let responseBody = nodeResponse; | ||
}); | ||
// TODO: will be removed after v16 reaches EOL | ||
nodeRequest.once('abort', (reason) => { | ||
reject(new PonyfillAbortError(reason)); | ||
}); | ||
nodeRequest.once('error', reject); | ||
@@ -131,0 +138,0 @@ if (nodeReadable) { |
{ | ||
"name": "@whatwg-node/node-fetch", | ||
"version": "0.4.0-alpha-20230515131253-e1eec20", | ||
"version": "0.4.0-alpha-20230515132257-4514d91", | ||
"description": "Fetch API implementation for Node", | ||
"sideEffects": false, | ||
"dependencies": { | ||
"@whatwg-node/events": "0.1.0-alpha-20230515131253-e1eec20", | ||
"@whatwg-node/events": "0.1.0-alpha-20230515132257-4514d91", | ||
"busboy": "^1.6.0", | ||
@@ -9,0 +9,0 @@ "fast-querystring": "^1.1.1", |
129339
3172
+ Added@whatwg-node/events@0.1.0-alpha-20230515132257-4514d91(transitive)
- Removed@whatwg-node/events@0.1.0-alpha-20230515131253-e1eec20(transitive)
Updated@whatwg-node/events@0.1.0-alpha-20230515132257-4514d91