bruce-models 5.2.4 → 5.2.5

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.
@@ -1256,6 +1256,51 @@ var BruceApi;
1256
1256
  });
1257
1257
  });
1258
1258
  }
1259
+ /**
1260
+ * Version check that returns true if the version is at least the provided version.
1261
+ * @param version
1262
+ */
1263
+ IsVersionAtLeast(version) {
1264
+ if (!this.version) {
1265
+ return false;
1266
+ }
1267
+ // Debug.
1268
+ if (typeof this.version == "string" && this.version.toLowerCase().includes("debug")) {
1269
+ return true;
1270
+ }
1271
+ // Bad data.
1272
+ if (!this.version.includes(".")) {
1273
+ return false;
1274
+ }
1275
+ /**
1276
+ * Compares two arrays of version parts.
1277
+ * Returns -1 if `a` is less than `b`, 1 if `a` is greater than `b`, or 0 if they are equal.
1278
+ * @param a
1279
+ * @param b
1280
+ */
1281
+ function compareVersions(a, b) {
1282
+ for (let i = 0; i < a.length; i++) {
1283
+ if (a[i] < b[i]) {
1284
+ return -1;
1285
+ }
1286
+ else if (a[i] > b[i]) {
1287
+ return 1;
1288
+ }
1289
+ }
1290
+ return 0;
1291
+ }
1292
+ /**
1293
+ * Splits a version string into an array of version parts.
1294
+ * Example format: "1.0.4836".
1295
+ * @param version
1296
+ */
1297
+ function splitVersion(version) {
1298
+ return version.split(".").map(part => parseInt(part));
1299
+ }
1300
+ const curSplit = splitVersion(this.version);
1301
+ const reqSplit = splitVersion(version);
1302
+ return compareVersions(curSplit, reqSplit) >= 0;
1303
+ }
1259
1304
  }
1260
1305
  BruceApi$$1.Api = Api$$1;
1261
1306
  })(BruceApi || (BruceApi = {}));
@@ -14555,7 +14600,7 @@ var DataSource;
14555
14600
  })(DataSource || (DataSource = {}));
14556
14601
 
14557
14602
  // This is updated with the package.json version on build.
14558
- const VERSION = "5.2.4";
14603
+ const VERSION = "5.2.5";
14559
14604
 
14560
14605
  export { VERSION, AnnDocument, CustomForm, AbstractApi, Api, BruceApi, GlobalApi, GuardianApi, ApiGetters, Calculator, Bounds, BruceEvent, CacheControl, Camera, Cartes, Carto, Color, DelayQueue, Geometry, UTC, BruceVariable, LRUCache, GeoJson, EntityAttachmentType, EntityAttachment, EntityComment, EntityLink, EntityLod, EntityLodCategory, EntityRelationType, EntityRelation, EntitySource, EntityTag, EntityType, Entity, EntityCoords, EntityTypeVisualSettings, EntityAttribute, EntityHistoricData, EntityTableView, Comment, ClientFile, ProgramKey, ZoomControl, MenuItem, ProjectViewBookmark, ProjectView, ProjectViewLegacyTile, ProjectViewTile, ProjectViewLegacy, ProjectViewLegacyBookmark, PendingAction, MessageBroker, HostingLocation, Style, Tileset, Permission, Session, UserGroup, User, Account, AccountInvite, AccountFeatures, AccountLimits, EncryptUtils, MathUtils, ObjectUtils, PathUtils, UrlUtils, DataLab, ImportAssembly, ImportCad, ImportCsv, ImportJson, ImportGeoJson, ImportKml, ImportedFile, ExportBrz, ExportUsd, Markup, Uploader, Plugin, ENVIRONMENT, DataSource };
14561
14606
  //# sourceMappingURL=bruce-models.es5.js.map