nuxt-custom-fetch 4.0.0-alpha.13 → 4.0.0-alpha.14
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/dist/runtime/ajax.js +24 -28
- package/package.json +9 -9
package/dist/runtime/ajax.js
CHANGED
|
@@ -73,41 +73,37 @@ export class CustomFetch {
|
|
|
73
73
|
const interceptors = this._interceptors;
|
|
74
74
|
const _config = reactive({ ...asyncDataOptions });
|
|
75
75
|
const defaultOptions = {
|
|
76
|
-
onRequest(ctx) {
|
|
77
|
-
[interceptors.onRequest, onRequest].
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
fns?.(ctx);
|
|
76
|
+
async onRequest(ctx) {
|
|
77
|
+
const allFns = [interceptors.onRequest, onRequest].flat();
|
|
78
|
+
for (const fn of allFns) {
|
|
79
|
+
if (fn) {
|
|
80
|
+
await fn(ctx);
|
|
82
81
|
}
|
|
83
|
-
}
|
|
82
|
+
}
|
|
84
83
|
},
|
|
85
|
-
onRequestError(ctx) {
|
|
86
|
-
[interceptors.onRequestError, onRequestError].
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
fns?.(ctx);
|
|
84
|
+
async onRequestError(ctx) {
|
|
85
|
+
const allFns = [interceptors.onRequestError, onRequestError].flat();
|
|
86
|
+
for (const fn of allFns) {
|
|
87
|
+
if (fn) {
|
|
88
|
+
await fn(ctx);
|
|
91
89
|
}
|
|
92
|
-
}
|
|
90
|
+
}
|
|
93
91
|
},
|
|
94
|
-
onResponse(ctx) {
|
|
95
|
-
[interceptors.onResponse, onResponse].
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
fns?.(ctx);
|
|
92
|
+
async onResponse(ctx) {
|
|
93
|
+
const allFns = [interceptors.onResponse, onResponse].flat();
|
|
94
|
+
for (const fn of allFns) {
|
|
95
|
+
if (fn) {
|
|
96
|
+
await fn(ctx);
|
|
100
97
|
}
|
|
101
|
-
}
|
|
98
|
+
}
|
|
102
99
|
},
|
|
103
|
-
onResponseError(ctx) {
|
|
104
|
-
[interceptors.onResponseError, onResponseError].
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
fns?.(ctx);
|
|
100
|
+
async onResponseError(ctx) {
|
|
101
|
+
const allFns = [interceptors.onResponseError, onResponseError].flat();
|
|
102
|
+
for (const fn of allFns) {
|
|
103
|
+
if (fn) {
|
|
104
|
+
await fn(ctx);
|
|
109
105
|
}
|
|
110
|
-
}
|
|
106
|
+
}
|
|
111
107
|
}
|
|
112
108
|
};
|
|
113
109
|
const hashValue = ["custom_fetch:", url];
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-custom-fetch",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "4.0.0-alpha.
|
|
4
|
+
"version": "4.0.0-alpha.14",
|
|
5
5
|
"packageManager": "pnpm@8.15.3+sha1.64838798f519c18029c1e8a1310e16101fc2eda0",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -42,21 +42,21 @@
|
|
|
42
42
|
"vue": "^3.5.17"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@antfu/eslint-config": "^4.
|
|
45
|
+
"@antfu/eslint-config": "^4.17.0",
|
|
46
46
|
"@commitlint/cli": "^19.8.1",
|
|
47
47
|
"@commitlint/config-conventional": "^19.8.1",
|
|
48
|
-
"@nuxt/kit": "3.17.
|
|
48
|
+
"@nuxt/kit": "3.17.7",
|
|
49
49
|
"@nuxt/module-builder": "^1.0.1",
|
|
50
|
-
"@nuxt/schema": "3.17.
|
|
51
|
-
"@types/node": "^24.0.
|
|
52
|
-
"changelogen": "^0.6.
|
|
50
|
+
"@nuxt/schema": "3.17.7",
|
|
51
|
+
"@types/node": "^24.0.13",
|
|
52
|
+
"changelogen": "^0.6.2",
|
|
53
53
|
"commitizen": "^4.3.1",
|
|
54
|
-
"cz-git": "^1.
|
|
55
|
-
"eslint": "^9.
|
|
54
|
+
"cz-git": "^1.12.0",
|
|
55
|
+
"eslint": "^9.31.0",
|
|
56
56
|
"husky": "^9.1.7",
|
|
57
57
|
"lint-staged": "^16.1.2",
|
|
58
58
|
"nitro": "npm:nitropack@^2.11.13",
|
|
59
|
-
"nuxt": "3.17.
|
|
59
|
+
"nuxt": "3.17.7",
|
|
60
60
|
"typescript": "5.8.3"
|
|
61
61
|
},
|
|
62
62
|
"husky": {
|