@deliverart/sdk-js-core 2.1.7 → 2.1.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.cjs +6 -2
- package/dist/index.js +6 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -149,8 +149,12 @@ function createApiClient(config) {
|
|
|
149
149
|
let contentType = response.headers.get("Content-Type") ?? "";
|
|
150
150
|
let parsedBody;
|
|
151
151
|
try {
|
|
152
|
-
if (contentType.includes("application/
|
|
153
|
-
|
|
152
|
+
if (contentType.includes("application/")) {
|
|
153
|
+
if (contentType.includes("json")) {
|
|
154
|
+
parsedBody = await response.json();
|
|
155
|
+
} else {
|
|
156
|
+
parsedBody = await response.text();
|
|
157
|
+
}
|
|
154
158
|
} else if (contentType.includes("text/")) {
|
|
155
159
|
parsedBody = await response.text();
|
|
156
160
|
} else {
|
package/dist/index.js
CHANGED
|
@@ -110,8 +110,12 @@ function createApiClient(config) {
|
|
|
110
110
|
let contentType = response.headers.get("Content-Type") ?? "";
|
|
111
111
|
let parsedBody;
|
|
112
112
|
try {
|
|
113
|
-
if (contentType.includes("application/
|
|
114
|
-
|
|
113
|
+
if (contentType.includes("application/")) {
|
|
114
|
+
if (contentType.includes("json")) {
|
|
115
|
+
parsedBody = await response.json();
|
|
116
|
+
} else {
|
|
117
|
+
parsedBody = await response.text();
|
|
118
|
+
}
|
|
115
119
|
} else if (contentType.includes("text/")) {
|
|
116
120
|
parsedBody = await response.text();
|
|
117
121
|
} else {
|
package/package.json
CHANGED