@bubblesjs/request 0.0.6 → 0.0.8
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/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ interface RequestMeta {
|
|
|
23
23
|
interface BaseRequestOption<RC extends object = FetchRequestInit, RE = Response, RH = Headers, SE extends StatesExport<any> = StatesExport<any>> extends RequestMeta {
|
|
24
24
|
baseUrl?: string;
|
|
25
25
|
timeout?: number;
|
|
26
|
-
commonHeaders?: Record<string, HeaderValue>;
|
|
26
|
+
commonHeaders?: () => Record<string, HeaderValue>;
|
|
27
27
|
statusMap?: StatusMap<RE>;
|
|
28
28
|
codeMap?: CodeMap;
|
|
29
29
|
responseCodeKey?: string;
|
package/dist/index.js
CHANGED
|
@@ -116,7 +116,7 @@ function createInstance(option = {}) {
|
|
|
116
116
|
const methodConfig = method.config;
|
|
117
117
|
const headers = methodConfig.headers ?? {};
|
|
118
118
|
methodConfig.headers = headers;
|
|
119
|
-
for (const [key, value] of Object.entries(config.commonHeaders ?? {})) {
|
|
119
|
+
for (const [key, value] of Object.entries(config.commonHeaders?.() ?? {})) {
|
|
120
120
|
const resolvedValue = await resolveHeaderValue(value);
|
|
121
121
|
if (resolvedValue !== void 0) setHeader(headers, key, resolvedValue);
|
|
122
122
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bubblesjs/request",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"private": false,
|
|
6
6
|
"repository": {
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"dist"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@bubblesjs/utils": "^0.0.
|
|
25
|
+
"@bubblesjs/utils": "^0.0.10"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"alova": "^3.5.1"
|