@alwatr/fetch 5.2.1 → 5.4.0
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/CHANGELOG.md +46 -0
- package/README.md +0 -2
- package/dist/main.cjs +2 -3
- package/dist/main.mjs +2 -3
- package/package.json +11 -11
- package/src/main.test.js +4 -1
- package/dist/main.cjs.LEGAL.txt +0 -0
- package/dist/main.mjs.LEGAL.txt +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,52 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [5.4.0](https://github.com/Alwatr/nanolib/compare/@alwatr/fetch@4.2.1...@alwatr/fetch@5.4.0) (2025-02-18)
|
|
7
|
+
|
|
8
|
+
## 5.3.0 (2025-02-03)
|
|
9
|
+
|
|
10
|
+
### Miscellaneous Chores
|
|
11
|
+
|
|
12
|
+
* edit README ([3860b3d](https://github.com/Alwatr/nanolib/commit/3860b3df48ab82dc479d5236c2e8579df614aabf)) by @
|
|
13
|
+
|
|
14
|
+
### Dependencies update
|
|
15
|
+
|
|
16
|
+
* bump the development-dependencies group across 1 directory with 11 updates ([cb79d07](https://github.com/Alwatr/nanolib/commit/cb79d072a57c79e1c01abff1a293d6757bb65350)) by @
|
|
17
|
+
* update typescript and @types/node to version 5.7.3 and 22.13.0 respectively across multiple packages ([ddab05b](https://github.com/Alwatr/nanolib/commit/ddab05b5d767c30191f36a065e4bc88744e8e3fe)) by @
|
|
18
|
+
|
|
19
|
+
## 5.2.1 (2024-11-07)
|
|
20
|
+
|
|
21
|
+
### Bug Fixes
|
|
22
|
+
|
|
23
|
+
* **fetch:** refine error handling in fetchJson to improve response error structure ([2942563](https://github.com/Alwatr/nanolib/commit/29425639c268f091711ab195a4285e49b762e497)) by @
|
|
24
|
+
|
|
25
|
+
## 5.2.0 (2024-11-06)
|
|
26
|
+
|
|
27
|
+
### Features
|
|
28
|
+
|
|
29
|
+
* **fetch:** improve error handling for fetch responses and JSON parsing ([8692bb1](https://github.com/Alwatr/nanolib/commit/8692bb1123e8b3a6d6f8aea20464c55b344da9d2)) by @
|
|
30
|
+
|
|
31
|
+
## 5.0.0 (2024-11-02)
|
|
32
|
+
|
|
33
|
+
### ⚠ BREAKING CHANGES
|
|
34
|
+
|
|
35
|
+
* To simplify version management and ensure consistency, all nanolib packages now use the same version as @alwatr/nanolib. This may require updates to your project's dependencies.
|
|
36
|
+
|
|
37
|
+
### Code Refactoring
|
|
38
|
+
|
|
39
|
+
* use the same version as @alwatr/nanolib ([60eb860](https://github.com/Alwatr/nanolib/commit/60eb860a0e33dfffe2d1d95e63ce54c60876be06)) by @
|
|
40
|
+
|
|
41
|
+
## [5.3.0](https://github.com/Alwatr/nanolib/compare/v5.2.1...v5.3.0) (2025-02-03)
|
|
42
|
+
|
|
43
|
+
### Miscellaneous Chores
|
|
44
|
+
|
|
45
|
+
* edit README ([3860b3d](https://github.com/Alwatr/nanolib/commit/3860b3df48ab82dc479d5236c2e8579df614aabf)) by @ArmanAsadian
|
|
46
|
+
|
|
47
|
+
### Dependencies update
|
|
48
|
+
|
|
49
|
+
* bump the development-dependencies group across 1 directory with 11 updates ([cb79d07](https://github.com/Alwatr/nanolib/commit/cb79d072a57c79e1c01abff1a293d6757bb65350)) by @dependabot[bot]
|
|
50
|
+
* update typescript and @types/node to version 5.7.3 and 22.13.0 respectively across multiple packages ([ddab05b](https://github.com/Alwatr/nanolib/commit/ddab05b5d767c30191f36a065e4bc88744e8e3fe)) by @alimd
|
|
51
|
+
|
|
6
52
|
## [5.2.1](https://github.com/Alwatr/nanolib/compare/v5.2.0...v5.2.1) (2024-11-07)
|
|
7
53
|
|
|
8
54
|
### Bug Fixes
|
package/README.md
CHANGED
|
@@ -58,8 +58,6 @@ console.log(productList);
|
|
|
58
58
|
|
|
59
59
|
The following companies, organizations, and individuals support Nanolib ongoing maintenance and development. Become a Sponsor to get your logo on our README and website.
|
|
60
60
|
|
|
61
|
-
[](https://exirstudio.com)
|
|
62
|
-
|
|
63
61
|
### Contributing
|
|
64
62
|
|
|
65
63
|
Contributions are welcome! Please read our [contribution guidelines](https://github.com/Alwatr/.github/blob/next/CONTRIBUTING.md) before submitting a pull request.
|
package/dist/main.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @alwatr/fetch v5.
|
|
1
|
+
/* @alwatr/fetch v5.4.0 */
|
|
2
2
|
"use strict";
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -35,7 +35,7 @@ var import_http_primer = require("@alwatr/http-primer");
|
|
|
35
35
|
var import_logger = require("@alwatr/logger");
|
|
36
36
|
var import_package_tracer = require("@alwatr/package-tracer");
|
|
37
37
|
var import_parse_duration = require("@alwatr/parse-duration");
|
|
38
|
-
__dev_mode__: import_package_tracer.packageTracer.add("@alwatr/fetch", "5.
|
|
38
|
+
__dev_mode__: import_package_tracer.packageTracer.add("@alwatr/fetch", "5.4.0");
|
|
39
39
|
var logger_ = /* @__PURE__ */ (0, import_logger.createLogger)("@alwatr/fetch");
|
|
40
40
|
var globalThis_ = /* @__PURE__ */ (0, import_global_this.getGlobalThis)();
|
|
41
41
|
var cacheStorage_;
|
|
@@ -247,5 +247,4 @@ function fetch(options) {
|
|
|
247
247
|
fetch,
|
|
248
248
|
fetchJson
|
|
249
249
|
});
|
|
250
|
-
/*! For license information please see main.cjs.LEGAL.txt */
|
|
251
250
|
//# sourceMappingURL=main.cjs.map
|
package/dist/main.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @alwatr/fetch v5.
|
|
1
|
+
/* @alwatr/fetch v5.4.0 */
|
|
2
2
|
|
|
3
3
|
// src/main.ts
|
|
4
4
|
import { HttpStatusCodes as HttpStatusCodes2 } from "@alwatr/http-primer";
|
|
@@ -10,7 +10,7 @@ import { HttpStatusCodes, MimeTypes } from "@alwatr/http-primer";
|
|
|
10
10
|
import { createLogger } from "@alwatr/logger";
|
|
11
11
|
import { packageTracer } from "@alwatr/package-tracer";
|
|
12
12
|
import { parseDuration } from "@alwatr/parse-duration";
|
|
13
|
-
__dev_mode__: packageTracer.add("@alwatr/fetch", "5.
|
|
13
|
+
__dev_mode__: packageTracer.add("@alwatr/fetch", "5.4.0");
|
|
14
14
|
var logger_ = /* @__PURE__ */ createLogger("@alwatr/fetch");
|
|
15
15
|
var globalThis_ = /* @__PURE__ */ getGlobalThis();
|
|
16
16
|
var cacheStorage_;
|
|
@@ -221,5 +221,4 @@ export {
|
|
|
221
221
|
fetch,
|
|
222
222
|
fetchJson
|
|
223
223
|
};
|
|
224
|
-
/*! For license information please see main.mjs.LEGAL.txt */
|
|
225
224
|
//# sourceMappingURL=main.mjs.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alwatr/fetch",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.4.0",
|
|
4
4
|
"description": "Enhanced fetch API with cache strategy, retry pattern, timeout, helper methods and enhanced types.",
|
|
5
5
|
"author": "S. Ali Mihandoost <ali.mihandoost@gmail.com>",
|
|
6
6
|
"keywords": [
|
|
@@ -72,20 +72,20 @@
|
|
|
72
72
|
"clean": "rm -rfv dist *.tsbuildinfo"
|
|
73
73
|
},
|
|
74
74
|
"dependencies": {
|
|
75
|
-
"@alwatr/delay": "^5.
|
|
76
|
-
"@alwatr/global-this": "^5.
|
|
77
|
-
"@alwatr/http-primer": "^5.
|
|
78
|
-
"@alwatr/logger": "^5.
|
|
79
|
-
"@alwatr/package-tracer": "^5.
|
|
80
|
-
"@alwatr/parse-duration": "^5.
|
|
75
|
+
"@alwatr/delay": "^5.4.0",
|
|
76
|
+
"@alwatr/global-this": "^5.4.0",
|
|
77
|
+
"@alwatr/http-primer": "^5.4.0",
|
|
78
|
+
"@alwatr/logger": "^5.4.0",
|
|
79
|
+
"@alwatr/package-tracer": "^5.4.0",
|
|
80
|
+
"@alwatr/parse-duration": "^5.4.0"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
|
-
"@alwatr/nano-build": "^5.
|
|
83
|
+
"@alwatr/nano-build": "^5.4.0",
|
|
84
84
|
"@alwatr/prettier-config": "^5.0.0",
|
|
85
85
|
"@alwatr/tsconfig-base": "^5.0.0",
|
|
86
|
-
"@alwatr/type-helper": "^5.
|
|
86
|
+
"@alwatr/type-helper": "^5.3.0",
|
|
87
87
|
"jest": "^29.7.0",
|
|
88
|
-
"typescript": "^5.
|
|
88
|
+
"typescript": "^5.7.3"
|
|
89
89
|
},
|
|
90
|
-
"gitHead": "
|
|
90
|
+
"gitHead": "074be0d0fe780bf929e163045f8f598cd2697636"
|
|
91
91
|
}
|
package/src/main.test.js
CHANGED
|
@@ -25,6 +25,9 @@ describe('fetch with search params', () => {
|
|
|
25
25
|
|
|
26
26
|
describe('fetch json', () => {
|
|
27
27
|
it('should make a GET request to the specified URL with json body and parse valid json', async () => {
|
|
28
|
+
/**
|
|
29
|
+
* @type {import('@alwatr/fetch').FetchOptions}}
|
|
30
|
+
*/
|
|
28
31
|
const options = {
|
|
29
32
|
url: 'http://httpbin.org/post',
|
|
30
33
|
method: 'POST',
|
|
@@ -36,7 +39,7 @@ describe('fetch json', () => {
|
|
|
36
39
|
|
|
37
40
|
const responseJson = await fetchJson(options);
|
|
38
41
|
|
|
39
|
-
expect(responseJson.ok).toBe(
|
|
42
|
+
expect(responseJson.ok).toBe(undefined);
|
|
40
43
|
expect(responseJson.json.a).toBe(2);
|
|
41
44
|
});
|
|
42
45
|
|
package/dist/main.cjs.LEGAL.txt
DELETED
|
File without changes
|
package/dist/main.mjs.LEGAL.txt
DELETED
|
File without changes
|