bruce-models 4.0.9 → 4.1.1

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.
@@ -270,6 +270,12 @@ function parseResult(data) {
270
270
  else if (encoding === "iso-8859-1") {
271
271
  encoding = "utf-8";
272
272
  }
273
+ if (type == "application/octet-stream" || type == "model/gltf-binary") {
274
+ if (encoding !== "utf-8") {
275
+ console.warn("Binary data is being returned with an unexpected encoding:", encoding);
276
+ }
277
+ return data.blob();
278
+ }
273
279
  let text = yield (encoding && encoding !== "utf-8"
274
280
  ? new TextDecoder(encoding).decode(yield data.arrayBuffer())
275
281
  : data.text());
@@ -279,17 +285,17 @@ function parseResult(data) {
279
285
  if (!type) {
280
286
  type = "";
281
287
  }
282
- if (type == "application/octet-stream" || type == "model/gltf-binary") {
283
- return new Blob([text]);
284
- }
285
- else if (type.includes("text/csv")) {
288
+ if (type.includes("text/csv")) {
286
289
  return text;
287
290
  }
288
291
  if (text && typeof text == "string") {
289
292
  text = text.trim();
290
293
  }
291
- if (text && text.startsWith("{") && text.endsWith("}")) {
292
- return JSON.parse(text);
294
+ if (text) {
295
+ if ((text.startsWith("{") && text.endsWith("}")) ||
296
+ (text.startsWith("[") && text.endsWith("]"))) {
297
+ return JSON.parse(text);
298
+ }
293
299
  }
294
300
  return text;
295
301
  });
@@ -11918,7 +11924,7 @@ var DataSource;
11918
11924
  })(DataSource || (DataSource = {}));
11919
11925
 
11920
11926
  // This is updated with the package.json version on build.
11921
- const VERSION = "4.0.9";
11927
+ const VERSION = "4.1.1";
11922
11928
 
11923
11929
  export { VERSION, AnnDocument, CustomForm, AbstractApi, Api, BruceApi, GlobalApi, GuardianApi, ApiGetters, Calculator, Bounds, BruceEvent, CacheControl, Camera, Cartes, Carto, Color, DelayQueue, Geometry, UTC, BruceVariable, LRUCache, EntityAttachmentType, EntityAttachment, EntityComment, EntityLink, EntityLod, EntityLodCategory, EntityRelationType, EntityRelation, EntitySource, EntityTag, EntityType, Entity, EntityCoords, EntityTypeVisualSettings, EntityAttribute, EntityHistoricData, ClientFile, ProgramKey, ZoomControl, MenuItem, ProjectViewBookmark, ProjectView, ProjectViewLegacyTile, ProjectViewTile, ProjectViewLegacy, ProjectViewLegacyBookmark, PendingAction, MessageBroker, HostingLocation, Style, Tileset, Permission, Session, UserGroup, User, Account, AccountInvite, AccountFeatures, EncryptUtils, MathUtils, ObjectUtils, PathUtils, UrlUtils, DataLab, ImportCad, ImportCsv, ImportJson, ImportKml, ImportedFile, Markup, Uploader, Plugin, ENVIRONMENT, DataSource };
11924
11930
  //# sourceMappingURL=bruce-models.es5.js.map