@marianmeres/http-utils 1.6.4 → 1.7.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/dist/api.d.ts CHANGED
@@ -5,7 +5,7 @@ interface BaseParams {
5
5
  interface FetchParams {
6
6
  data?: any;
7
7
  token?: string | null;
8
- headers?: any;
8
+ headers?: null | Record<string, string>;
9
9
  signal?: any;
10
10
  credentials?: null | 'omit' | 'same-origin' | 'include';
11
11
  raw?: null | boolean;
package/dist/index.cjs CHANGED
@@ -254,7 +254,7 @@ cause) => {
254
254
  };
255
255
 
256
256
  const _fetchRaw = async ({ method, path, data = null, token = null, headers = null, signal = null, credentials, }) => {
257
- headers = Object.entries(headers || {}).map(([k, v]) => ({ [k.toLowerCase()]: v }));
257
+ headers = Object.entries(headers || {}).reduce((m, [k, v]) => ({ ...m, [k.toLowerCase()]: v }), {});
258
258
  const opts = { method, credentials, headers, signal };
259
259
  if (data) {
260
260
  const isObj = typeof data === 'object';
package/dist/index.js CHANGED
@@ -252,7 +252,7 @@ cause) => {
252
252
  };
253
253
 
254
254
  const _fetchRaw = async ({ method, path, data = null, token = null, headers = null, signal = null, credentials, }) => {
255
- headers = Object.entries(headers || {}).map(([k, v]) => ({ [k.toLowerCase()]: v }));
255
+ headers = Object.entries(headers || {}).reduce((m, [k, v]) => ({ ...m, [k.toLowerCase()]: v }), {});
256
256
  const opts = { method, credentials, headers, signal };
257
257
  if (data) {
258
258
  const isObj = typeof data === 'object';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marianmeres/http-utils",
3
- "version": "1.6.4",
3
+ "version": "1.7.0",
4
4
  "description": "Misc DRY http fetch related helpers",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",