@e-mc/request 0.13.9 → 0.13.11
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/http/adapter/index.js +1 -1
- package/index.js +6 -5
- package/package.json +4 -4
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.13.
|
|
12
|
+
* [View Source](https://www.unpkg.com/@e-mc/types@0.13.11/lib/index.d.ts)
|
|
13
13
|
|
|
14
14
|
```typescript
|
|
15
15
|
import type { IModule, ModuleConstructor } from "./index";
|
|
@@ -253,9 +253,9 @@ instance.get("http://hostname/path/config.yml", options).then(data => {
|
|
|
253
253
|
|
|
254
254
|
## References
|
|
255
255
|
|
|
256
|
-
- https://www.unpkg.com/@e-mc/types@0.13.
|
|
257
|
-
- https://www.unpkg.com/@e-mc/types@0.13.
|
|
258
|
-
- https://www.unpkg.com/@e-mc/types@0.13.
|
|
256
|
+
- https://www.unpkg.com/@e-mc/types@0.13.11/lib/http.d.ts
|
|
257
|
+
- https://www.unpkg.com/@e-mc/types@0.13.11/lib/request.d.ts
|
|
258
|
+
- https://www.unpkg.com/@e-mc/types@0.13.11/lib/settings.d.ts
|
|
259
259
|
|
|
260
260
|
* https://www.npmjs.com/package/@types/node
|
|
261
261
|
|
package/http/adapter/index.js
CHANGED
|
@@ -392,7 +392,7 @@ class HttpAdapter {
|
|
|
392
392
|
if (updating) {
|
|
393
393
|
this.updateProgress(0, this.contentLength);
|
|
394
394
|
}
|
|
395
|
-
if (enabled && this.instance.readExpect === 'always' && !empty) {
|
|
395
|
+
if (enabled && this.instance.readExpect === 'always' && !empty || opts.throwsEmpty) {
|
|
396
396
|
this.terminate("No data received");
|
|
397
397
|
return;
|
|
398
398
|
}
|
package/index.js
CHANGED
|
@@ -761,6 +761,9 @@ class Request extends module_1 {
|
|
|
761
761
|
this.readTimeout = (value = (0, util_1.fromSeconds)(read_timeout)) >= 0 ? value : READ_TIMEOUT;
|
|
762
762
|
this.keepAlive = typeof (value = agent?.keep_alive) === 'boolean' ? value : KEEP_ALIVE;
|
|
763
763
|
this.acceptEncoding = typeof (value = use?.accept_encoding) === 'boolean' ? value : ACCEPT_ENCODING;
|
|
764
|
+
if ((value = (0, util_1.asInt)(use?.http_version)) === 1 || value === 2) {
|
|
765
|
+
this.#httpVersion = value;
|
|
766
|
+
}
|
|
764
767
|
this.#ipVersion = (value = (0, util_1.asInt)(data.dns?.family)) && (value === 4 || value === 6) ? value : 0;
|
|
765
768
|
if ((value = (0, util_1.fromSeconds)(agent?.timeout)) >= 0) {
|
|
766
769
|
this.#agentTimeout = value;
|
|
@@ -769,9 +772,6 @@ class Request extends module_1 {
|
|
|
769
772
|
this.#agentTimeout = AGENT_TIMEOUT;
|
|
770
773
|
value = undefined;
|
|
771
774
|
}
|
|
772
|
-
if ((value = (0, util_1.asInt)(use?.http_version)) === 1 || value === 2) {
|
|
773
|
-
this.#httpVersion = value;
|
|
774
|
-
}
|
|
775
775
|
const proxy = getProxySettings(data, value);
|
|
776
776
|
if (proxy) {
|
|
777
777
|
this.proxy = proxy;
|
|
@@ -1397,6 +1397,7 @@ class Request extends module_1 {
|
|
|
1397
1397
|
silent ??= this.#singleton;
|
|
1398
1398
|
return new Promise((resolve, reject) => {
|
|
1399
1399
|
const init = [
|
|
1400
|
+
'--files-only=true',
|
|
1400
1401
|
'--links=false',
|
|
1401
1402
|
'--delete-excluded=false',
|
|
1402
1403
|
'--interactive=false',
|
|
@@ -2447,11 +2448,11 @@ class Request extends module_1 {
|
|
|
2447
2448
|
mergeBinOpts(args, opts, binOpts, options) {
|
|
2448
2449
|
if (binOpts) {
|
|
2449
2450
|
for (const leading of binOpts) {
|
|
2450
|
-
if (leading
|
|
2451
|
+
if (leading[0] === '-') {
|
|
2451
2452
|
const pattern = new RegExp(`^${leading}(?:=|$)`);
|
|
2452
2453
|
for (let i = 0; i < opts.length; ++i) {
|
|
2453
2454
|
if (pattern.test(opts[i])) {
|
|
2454
|
-
opts.splice(i
|
|
2455
|
+
opts.splice(i, 1);
|
|
2455
2456
|
break;
|
|
2456
2457
|
}
|
|
2457
2458
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@e-mc/request",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.11",
|
|
4
4
|
"description": "Request constructor for E-mc.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -19,11 +19,11 @@
|
|
|
19
19
|
"license": "BSD-3-Clause",
|
|
20
20
|
"homepage": "https://github.com/anpham6/e-mc#readme",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@e-mc/module": "0.13.
|
|
23
|
-
"@e-mc/types": "0.13.
|
|
22
|
+
"@e-mc/module": "0.13.11",
|
|
23
|
+
"@e-mc/types": "0.13.11",
|
|
24
24
|
"combined-stream": "^1.0.8",
|
|
25
25
|
"js-yaml": "^4.1.1",
|
|
26
|
-
"picomatch": "^4.0.
|
|
26
|
+
"picomatch": "^4.0.4",
|
|
27
27
|
"which": "^4.0.0"
|
|
28
28
|
}
|
|
29
29
|
}
|