bruce-models 4.0.7 → 4.0.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.
@@ -278,13 +278,28 @@
278
278
  else if (encoding === "iso-8859-1") {
279
279
  encoding = "utf-8";
280
280
  }
281
- const text = yield (encoding && encoding !== "utf-8"
281
+ let text = yield (encoding && encoding !== "utf-8"
282
282
  ? new TextDecoder(encoding).decode(yield data.arrayBuffer())
283
283
  : data.text());
284
284
  if (!(text === null || text === void 0 ? void 0 : text.trim())) {
285
285
  return null;
286
286
  }
287
- return (type === null || type === void 0 ? void 0 : type.includes("text/csv")) ? text : JSON.parse(text);
287
+ if (!type) {
288
+ type = "";
289
+ }
290
+ if (type.includes("application/octet-stream")) {
291
+ return new Blob([text]);
292
+ }
293
+ else if (type.includes("text/csv")) {
294
+ return text;
295
+ }
296
+ if (text && typeof text == "string") {
297
+ text = text.trim();
298
+ }
299
+ if (text && text.startsWith("{") && text.endsWith("}")) {
300
+ return JSON.parse(text);
301
+ }
302
+ return text;
288
303
  });
289
304
  }
290
305
  /**
@@ -11647,7 +11662,7 @@
11647
11662
  })(exports.DataSource || (exports.DataSource = {}));
11648
11663
 
11649
11664
  // This is updated with the package.json version on build.
11650
- const VERSION = "4.0.7";
11665
+ const VERSION = "4.0.8";
11651
11666
 
11652
11667
  exports.VERSION = VERSION;
11653
11668
  exports.AbstractApi = AbstractApi;