@e-mc/request 0.10.3 → 0.10.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/index.js +7 -9
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
## Interface
|
|
11
11
|
|
|
12
|
-
* [View Source](https://www.unpkg.com/@e-mc/types@0.10.
|
|
12
|
+
* [View Source](https://www.unpkg.com/@e-mc/types@0.10.5/lib/index.d.ts)
|
|
13
13
|
|
|
14
14
|
```typescript
|
|
15
15
|
import type { IModule, ModuleConstructor } from "./index";
|
|
@@ -205,9 +205,9 @@ instance.get("http://hostname/path/config.yml", options).then(data => {
|
|
|
205
205
|
|
|
206
206
|
## References
|
|
207
207
|
|
|
208
|
-
- https://www.unpkg.com/@e-mc/types@0.10.
|
|
209
|
-
- https://www.unpkg.com/@e-mc/types@0.10.
|
|
210
|
-
- https://www.unpkg.com/@e-mc/types@0.10.
|
|
208
|
+
- https://www.unpkg.com/@e-mc/types@0.10.5/lib/http.d.ts
|
|
209
|
+
- https://www.unpkg.com/@e-mc/types@0.10.5/lib/request.d.ts
|
|
210
|
+
- https://www.unpkg.com/@e-mc/types@0.10.5/lib/settings.d.ts
|
|
211
211
|
|
|
212
212
|
* https://www.npmjs.com/package/@types/node
|
|
213
213
|
|
package/index.js
CHANGED
|
@@ -419,10 +419,7 @@ class Fetch {
|
|
|
419
419
|
});
|
|
420
420
|
}
|
|
421
421
|
init() {
|
|
422
|
-
|
|
423
|
-
this.cleanup();
|
|
424
|
-
this.aborted = false;
|
|
425
|
-
}
|
|
422
|
+
this.aborted = false;
|
|
426
423
|
this.setWriteStream();
|
|
427
424
|
const config = this.config;
|
|
428
425
|
const client = this.instance.open(this.uri, config);
|
|
@@ -569,6 +566,7 @@ class Fetch {
|
|
|
569
566
|
}
|
|
570
567
|
this.aborted = true;
|
|
571
568
|
this.client.destroy();
|
|
569
|
+
this.cleanup();
|
|
572
570
|
}
|
|
573
571
|
retryDownload(downgrade, message) {
|
|
574
572
|
if (this.aborted) {
|
|
@@ -850,15 +848,15 @@ class Fetch {
|
|
|
850
848
|
clearTimeout(this.timeout);
|
|
851
849
|
}
|
|
852
850
|
this.closed = true;
|
|
851
|
+
if (this.aborted && !this.client.aborted && !this.client.destroyed) {
|
|
852
|
+
this.opts.outAbort?.abort();
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
cleanup() {
|
|
853
856
|
const outAbort = this.opts.outAbort;
|
|
854
857
|
if (outAbort) {
|
|
855
858
|
this.downloading.delete(outAbort);
|
|
856
|
-
if (this.aborted && !this.client.aborted && !this.client.destroyed) {
|
|
857
|
-
outAbort.abort();
|
|
858
|
-
}
|
|
859
859
|
}
|
|
860
|
-
}
|
|
861
|
-
cleanup() {
|
|
862
860
|
if ((0, types_1.isString)(this.pipeTo) && this.outStream) {
|
|
863
861
|
(0, util_1.cleanupStream)(this.outStream, this.pipeTo);
|
|
864
862
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@e-mc/request",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.5",
|
|
4
4
|
"description": "Request constructor for E-mc.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
"license": "BSD-3-Clause",
|
|
21
21
|
"homepage": "https://github.com/anpham6/e-mc#readme",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@e-mc/module": "0.10.
|
|
24
|
-
"@e-mc/types": "0.10.
|
|
23
|
+
"@e-mc/module": "0.10.5",
|
|
24
|
+
"@e-mc/types": "0.10.5",
|
|
25
25
|
"combined-stream": "^1.0.8",
|
|
26
26
|
"js-yaml": "^4.1.0",
|
|
27
27
|
"picomatch": "^4.0.2",
|