@bubblesjs/request 0.0.6 → 0.0.7

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 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.6",
3
+ "version": "0.0.7",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "repository": {