bruce-models 4.0.7 → 4.0.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/bruce-models.es5.js +18 -6
- package/dist/bruce-models.es5.js.map +1 -1
- package/dist/bruce-models.umd.js +18 -6
- package/dist/bruce-models.umd.js.map +1 -1
- package/dist/lib/api/abstract-api.js +17 -5
- package/dist/lib/api/abstract-api.js.map +1 -1
- package/dist/lib/bruce-models.js +1 -1
- package/dist/types/bruce-models.d.ts +1 -1
- package/package.json +1 -1
package/dist/bruce-models.umd.js
CHANGED
|
@@ -259,9 +259,6 @@
|
|
|
259
259
|
}
|
|
260
260
|
}
|
|
261
261
|
|
|
262
|
-
// TODO: Currently checks for CSV vs json specifically,
|
|
263
|
-
// Need to see if our api is generally good at setting content-type headers.
|
|
264
|
-
// Make it less specific to CSV.
|
|
265
262
|
function parseResult(data) {
|
|
266
263
|
var _a, _b;
|
|
267
264
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -278,13 +275,28 @@
|
|
|
278
275
|
else if (encoding === "iso-8859-1") {
|
|
279
276
|
encoding = "utf-8";
|
|
280
277
|
}
|
|
281
|
-
|
|
278
|
+
let text = yield (encoding && encoding !== "utf-8"
|
|
282
279
|
? new TextDecoder(encoding).decode(yield data.arrayBuffer())
|
|
283
280
|
: data.text());
|
|
284
281
|
if (!(text === null || text === void 0 ? void 0 : text.trim())) {
|
|
285
282
|
return null;
|
|
286
283
|
}
|
|
287
|
-
|
|
284
|
+
if (!type) {
|
|
285
|
+
type = "";
|
|
286
|
+
}
|
|
287
|
+
if (type == "application/octet-stream" || type == "model/gltf-binary") {
|
|
288
|
+
return new Blob([text]);
|
|
289
|
+
}
|
|
290
|
+
else if (type.includes("text/csv")) {
|
|
291
|
+
return text;
|
|
292
|
+
}
|
|
293
|
+
if (text && typeof text == "string") {
|
|
294
|
+
text = text.trim();
|
|
295
|
+
}
|
|
296
|
+
if (text && text.startsWith("{") && text.endsWith("}")) {
|
|
297
|
+
return JSON.parse(text);
|
|
298
|
+
}
|
|
299
|
+
return text;
|
|
288
300
|
});
|
|
289
301
|
}
|
|
290
302
|
/**
|
|
@@ -11647,7 +11659,7 @@
|
|
|
11647
11659
|
})(exports.DataSource || (exports.DataSource = {}));
|
|
11648
11660
|
|
|
11649
11661
|
// This is updated with the package.json version on build.
|
|
11650
|
-
const VERSION = "4.0.
|
|
11662
|
+
const VERSION = "4.0.9";
|
|
11651
11663
|
|
|
11652
11664
|
exports.VERSION = VERSION;
|
|
11653
11665
|
exports.AbstractApi = AbstractApi;
|