shred-api-client 2.11.3 → 2.11.4
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.js +9 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -156,11 +156,16 @@ var HTTPClient = class {
|
|
|
156
156
|
}
|
|
157
157
|
throw toException(response.status, message);
|
|
158
158
|
}
|
|
159
|
+
const raw = await response.text();
|
|
159
160
|
let result;
|
|
160
|
-
|
|
161
|
-
result =
|
|
162
|
-
}
|
|
163
|
-
|
|
161
|
+
if (raw === "") {
|
|
162
|
+
result = void 0;
|
|
163
|
+
} else {
|
|
164
|
+
try {
|
|
165
|
+
result = JSON.parse(raw);
|
|
166
|
+
} catch {
|
|
167
|
+
result = raw;
|
|
168
|
+
}
|
|
164
169
|
}
|
|
165
170
|
if (schema) return schema.parse(result);
|
|
166
171
|
return result;
|