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 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
- try {
161
- result = await response.json();
162
- } catch {
163
- result = await response.text();
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;