@ribbon-studios/js-utils 1.6.0 → 2.0.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/index.cjs CHANGED
@@ -81,18 +81,17 @@ async function rfetch(url, { params, body, ...options } = {}) {
81
81
  if (requestInit.method !== "GET" && body) {
82
82
  if (body instanceof FormData) {
83
83
  requestInit.body = body;
84
- requestInit.headers = {
85
- "Content-Type": "application/x-www-form-urlencoded"
86
- };
87
84
  } else if (typeof body === "string") {
88
85
  requestInit.body = body;
89
86
  requestInit.headers = {
90
- "Content-Type": "application/json"
87
+ "Content-Type": "application/json",
88
+ ...requestInit.headers
91
89
  };
92
90
  } else {
93
91
  requestInit.body = JSON.stringify(body);
94
92
  requestInit.headers = {
95
- "Content-Type": "application/json"
93
+ "Content-Type": "application/json",
94
+ ...requestInit.headers
96
95
  };
97
96
  }
98
97
  }
package/dist/index.js CHANGED
@@ -79,18 +79,17 @@ async function rfetch(url, { params, body, ...options } = {}) {
79
79
  if (requestInit.method !== "GET" && body) {
80
80
  if (body instanceof FormData) {
81
81
  requestInit.body = body;
82
- requestInit.headers = {
83
- "Content-Type": "application/x-www-form-urlencoded"
84
- };
85
82
  } else if (typeof body === "string") {
86
83
  requestInit.body = body;
87
84
  requestInit.headers = {
88
- "Content-Type": "application/json"
85
+ "Content-Type": "application/json",
86
+ ...requestInit.headers
89
87
  };
90
88
  } else {
91
89
  requestInit.body = JSON.stringify(body);
92
90
  requestInit.headers = {
93
- "Content-Type": "application/json"
91
+ "Content-Type": "application/json",
92
+ ...requestInit.headers
94
93
  };
95
94
  }
96
95
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ribbon-studios/js-utils",
3
- "version": "1.6.0",
3
+ "version": "2.0.0",
4
4
  "description": "Collection of generic javascript utilities curated by the Rainbow Cafe~",
5
5
  "type": "module",
6
6
  "source": "src/*.ts",