@e-mc/request 0.10.18 → 0.10.19

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.
Files changed (3) hide show
  1. package/README.md +4 -4
  2. package/index.js +8 -8
  3. 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.18/lib/index.d.ts)
12
+ * [View Source](https://www.unpkg.com/@e-mc/types@0.10.19/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.18/lib/http.d.ts
209
- - https://www.unpkg.com/@e-mc/types@0.10.18/lib/request.d.ts
210
- - https://www.unpkg.com/@e-mc/types@0.10.18/lib/settings.d.ts
208
+ - https://www.unpkg.com/@e-mc/types@0.10.19/lib/http.d.ts
209
+ - https://www.unpkg.com/@e-mc/types@0.10.19/lib/request.d.ts
210
+ - https://www.unpkg.com/@e-mc/types@0.10.19/lib/settings.d.ts
211
211
 
212
212
  * https://www.npmjs.com/package/@types/node
213
213
 
package/index.js CHANGED
@@ -150,11 +150,9 @@ function getProxySettings(request, agentTimeout) {
150
150
  return null;
151
151
  }
152
152
  function closeTorrent(pid) {
153
- if (typeof pid === 'number') {
154
- const index = ARIA2.PID_QUEUE.findIndex(value => pid === value[0]);
155
- if (index !== -1) {
156
- ARIA2.PID_QUEUE.splice(index, 1);
157
- }
153
+ const index = ARIA2.PID_QUEUE.findIndex(value => value[0] === pid);
154
+ if (index !== -1) {
155
+ ARIA2.PID_QUEUE.splice(index, 1);
158
156
  }
159
157
  }
160
158
  function clearDnsLookup() {
@@ -176,7 +174,7 @@ function resetHttpHost(version) {
176
174
  const host = HTTP.HOST[origin];
177
175
  if (host.secure && host.version === 1) {
178
176
  const failed = host.failed(2, true);
179
- if (failed === 0 && host.failed(2, true) < 10 || failed < 3 && host.success(2, true) > 0) {
177
+ if (failed === 0 && host.error(2, true) < 10 || failed < 3 && host.success(2, true) > 0) {
180
178
  host.version = version;
181
179
  }
182
180
  }
@@ -343,8 +341,10 @@ function abortHeaders(href, request, options, statusCode = '') {
343
341
  request.destroy(reason);
344
342
  }
345
343
  function resetAria2() {
346
- clearInterval(ARIA2.PID_TIMER);
347
- ARIA2.PID_TIMER = null;
344
+ if (ARIA2.PID_TIMER) {
345
+ clearInterval(ARIA2.PID_TIMER);
346
+ ARIA2.PID_TIMER = null;
347
+ }
348
348
  }
349
349
  function escapeShellQuote(value) {
350
350
  value = value.replace(/(?<!\\)"/g, '\\"');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e-mc/request",
3
- "version": "0.10.18",
3
+ "version": "0.10.19",
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": "MIT",
21
21
  "homepage": "https://github.com/anpham6/e-mc#readme",
22
22
  "dependencies": {
23
- "@e-mc/module": "0.10.18",
24
- "@e-mc/types": "0.10.18",
23
+ "@e-mc/module": "0.10.19",
24
+ "@e-mc/types": "0.10.19",
25
25
  "combined-stream": "^1.0.8",
26
26
  "js-yaml": "^4.1.1",
27
27
  "picomatch": "^4.0.3",