@e-mc/request 0.9.22 → 0.9.23

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 CHANGED
@@ -9,7 +9,7 @@
9
9
 
10
10
  ## Interface
11
11
 
12
- * [View Source](https://www.unpkg.com/@e-mc/types@0.9.22/lib/index.d.ts)
12
+ * [View Source](https://www.unpkg.com/@e-mc/types@0.9.23/lib/index.d.ts)
13
13
 
14
14
  ```typescript
15
15
  import type { IModule, ModuleConstructor } from "./index";
@@ -202,9 +202,9 @@ instance.get("http://hostname/path/config.yml", options).then(data => {
202
202
 
203
203
  ## References
204
204
 
205
- - https://www.unpkg.com/@e-mc/types@0.9.22/lib/http.d.ts
206
- - https://www.unpkg.com/@e-mc/types@0.9.22/lib/request.d.ts
207
- - https://www.unpkg.com/@e-mc/types@0.9.22/lib/settings.d.ts
205
+ - https://www.unpkg.com/@e-mc/types@0.9.23/lib/http.d.ts
206
+ - https://www.unpkg.com/@e-mc/types@0.9.23/lib/request.d.ts
207
+ - https://www.unpkg.com/@e-mc/types@0.9.23/lib/settings.d.ts
208
208
 
209
209
  * https://www.npmjs.com/package/@types/node
210
210
 
@@ -26,13 +26,7 @@ class HttpAdapter {
26
26
  return err instanceof Error && err.message.startsWith("Aborted");
27
27
  }
28
28
  static isConnectionError(err) {
29
- switch (err instanceof Error && err.code) {
30
- case 'ETIMEDOUT':
31
- case 'ECONNRESET':
32
- return true;
33
- default:
34
- return false;
35
- }
29
+ return (0, types_1.isErrorCode)(err, 'ETIMEDOUT', 'ECONNRESET');
36
30
  }
37
31
  static defineHostConfig({ settings }) {
38
32
  const time_format = settings?.time_format;
package/index.js CHANGED
@@ -662,7 +662,7 @@ class Request extends module_1 {
662
662
  break;
663
663
  }
664
664
  if (expires !== undefined) {
665
- if (typeof expires === 'string') {
665
+ if ((0, types_1.isString)(expires)) {
666
666
  expires = (0, types_1.parseExpires)(expires);
667
667
  }
668
668
  if (expires >= 0) {
@@ -891,8 +891,12 @@ class Request extends module_1 {
891
891
  }
892
892
  break;
893
893
  case 'readExpect':
894
- if ((0, types_1.isString)(value)) {
895
- this[name] = value;
894
+ switch (value) {
895
+ case 'string':
896
+ case 'always':
897
+ case 'none':
898
+ this[name] = value;
899
+ break;
896
900
  }
897
901
  break;
898
902
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e-mc/request",
3
- "version": "0.9.22",
3
+ "version": "0.9.23",
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.9.22",
24
- "@e-mc/types": "0.9.22",
23
+ "@e-mc/module": "0.9.23",
24
+ "@e-mc/types": "0.9.23",
25
25
  "combined-stream": "^1.0.8",
26
26
  "js-yaml": "^4.1.0",
27
27
  "picomatch": "^4.0.2",