@aws-amplify/geo 1.2.5-geo.11 → 1.2.5-geo.17

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.
@@ -29034,8 +29034,8 @@ function () {
29034
29034
  };
29035
29035
  /**
29036
29036
  * Get a single geofence by geofenceId
29037
- * @param geofenceId: string
29038
- * @param options?: GeofenceOptions
29037
+ * @param geofenceId: GeofenceId - The string id of the geofence to get
29038
+ * @param options?: GeofenceOptions - Optional parameters for getting a geofence
29039
29039
  * @returns Promise<Geofence> - Promise that resolves to a geofence object
29040
29040
  */
29041
29041
 
@@ -29670,7 +29670,7 @@ function () {
29670
29670
 
29671
29671
  AmazonLocationServiceProvider.prototype.saveGeofences = function (geofences, options) {
29672
29672
  return __awaiter(this, void 0, void 0, function () {
29673
- var credentialsOK, PascalGeofences, results, batches, apiLimit;
29673
+ var credentialsOK, PascalGeofences, results, geofenceBatches, apiLimit;
29674
29674
 
29675
29675
  var _this = this;
29676
29676
 
@@ -29715,16 +29715,16 @@ function () {
29715
29715
  successes: [],
29716
29716
  errors: []
29717
29717
  };
29718
- batches = [];
29718
+ geofenceBatches = [];
29719
29719
 
29720
29720
  while (PascalGeofences.length > 0) {
29721
29721
  apiLimit = 10;
29722
- batches.push(PascalGeofences.splice(0, apiLimit));
29722
+ geofenceBatches.push(PascalGeofences.splice(0, apiLimit));
29723
29723
  }
29724
29724
 
29725
29725
  return [4
29726
29726
  /*yield*/
29727
- , Promise.all(batches.map(function (batch) {
29727
+ , Promise.all(geofenceBatches.map(function (batch) {
29728
29728
  return __awaiter(_this, void 0, void 0, function () {
29729
29729
  var response, error_3;
29730
29730
  return __generator(this, function (_a) {
@@ -29988,7 +29988,7 @@ function () {
29988
29988
 
29989
29989
  AmazonLocationServiceProvider.prototype.deleteGeofences = function (geofenceIds, options) {
29990
29990
  return __awaiter(this, void 0, void 0, function () {
29991
- var credentialsOK, badGeofenceIds, results, batches, count;
29991
+ var credentialsOK, badGeofenceIds, results, geofenceIdBatches, count;
29992
29992
 
29993
29993
  var _this = this;
29994
29994
 
@@ -30028,16 +30028,16 @@ function () {
30028
30028
  successes: [],
30029
30029
  errors: []
30030
30030
  };
30031
- batches = [];
30031
+ geofenceIdBatches = [];
30032
30032
  count = 0;
30033
30033
 
30034
30034
  while (count < geofenceIds.length) {
30035
- batches.push(geofenceIds.slice(count, count += 10));
30035
+ geofenceIdBatches.push(geofenceIds.slice(count, count += 10));
30036
30036
  }
30037
30037
 
30038
30038
  return [4
30039
30039
  /*yield*/
30040
- , Promise.all(batches.map(function (batch) {
30040
+ , Promise.all(geofenceIdBatches.map(function (batch) {
30041
30041
  return __awaiter(_this, void 0, void 0, function () {
30042
30042
  var response, error_6, badGeofenceIds;
30043
30043
 
@@ -30352,9 +30352,9 @@ function validateCoordinates(lng, lat) {
30352
30352
  throw new Error("Invalid coordinates: [" + lng + "," + lat + "]");
30353
30353
  }
30354
30354
 
30355
- if (lat < -90 || lat > 90) {
30355
+ if (lat < -90 || 90 < lat) {
30356
30356
  throw new Error('Latitude must be between -90 and 90 degrees inclusive.');
30357
- } else if (lng < -180 || lng > 180) {
30357
+ } else if (lng < -180 || 180 < lng) {
30358
30358
  throw new Error('Longitude must be between -180 and 180 degrees inclusive.');
30359
30359
  }
30360
30360
  }
@@ -30463,7 +30463,7 @@ function validateGeofencesInput(geofences) {
30463
30463
  try {
30464
30464
  validatePolygon(polygon, geofenceId);
30465
30465
  } catch (error) {
30466
- if (error.message === "Polygon has more than the maximum 1000 vertices.") {
30466
+ if (error.message.includes('Polygon has more than the maximum 1000 vertices.')) {
30467
30467
  throw new Error("Geofence '" + geofenceId + "' has more than the maximum of 1000 vertices");
30468
30468
  }
30469
30469
  } // Validate LinearRing length, structure, and coordinates