@codebit-programando-solucoes/codebit-web 1.1.8 → 1.1.9
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 +2 -2
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -68,7 +68,7 @@ async function createApiError(response, request) {
|
|
|
68
68
|
let responseData;
|
|
69
69
|
try {
|
|
70
70
|
const contentType = response.headers.get('content-type');
|
|
71
|
-
responseData = response.bodyUsed ? null : contentType
|
|
71
|
+
responseData = response.bodyUsed ? null : contentType?.includes('application/json') ? await response.json() : await response.text();
|
|
72
72
|
} catch {
|
|
73
73
|
responseData = null;
|
|
74
74
|
}
|
|
@@ -179,7 +179,7 @@ async function makeRequest(url, options = {}) {
|
|
|
179
179
|
}
|
|
180
180
|
if (!response.ok) throw await createApiError(response, config);
|
|
181
181
|
const contentType = response.headers.get('content-type');
|
|
182
|
-
if (contentType
|
|
182
|
+
if (contentType?.includes('application/json')) {
|
|
183
183
|
const data = await response.json();
|
|
184
184
|
return {
|
|
185
185
|
data,
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codebit-programando-solucoes/codebit-web",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.9",
|
|
4
4
|
"main": "./dist/index.cjs",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"types": "./
|
|
6
|
+
"types": "./dist/index.d.ts",
|
|
7
7
|
"description": "",
|
|
8
8
|
"author": "",
|
|
9
9
|
"license": "UNLICENSED",
|