parse 3.5.0-alpha.4 → 3.5.0-alpha.6

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/parse.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Parse JavaScript SDK v3.5.0-alpha.4
2
+ * Parse JavaScript SDK v3.5.0-alpha.6
3
3
  *
4
4
  * The source tree of this library can be found at
5
5
  * https://github.com/ParsePlatform/Parse-SDK-JS
@@ -699,7 +699,7 @@ var config
699
699
  SERVER_AUTH_TOKEN: null,
700
700
  LIVEQUERY_SERVER_URL: null,
701
701
  ENCRYPTED_KEY: null,
702
- VERSION: 'js' + "3.5.0-alpha.4",
702
+ VERSION: 'js' + "3.5.0-alpha.6",
703
703
  APPLICATION_ID: null,
704
704
  JAVASCRIPT_KEY: null,
705
705
  MASTER_KEY: null,
@@ -2390,8 +2390,10 @@ var _idbKeyval = _dereq_("idb-keyval");
2390
2390
  * @flow
2391
2391
  */
2392
2392
 
2393
+ /* global window */
2393
2394
 
2394
- try {
2395
+
2396
+ if (typeof window !== 'undefined' && window.indexedDB) {
2395
2397
  var ParseStore = (0, _idbKeyval.createStore)('parseDB', 'parseStore');
2396
2398
  var IndexedDBStorageController = {
2397
2399
  async: 1,
@@ -2420,7 +2422,9 @@ try {
2420
2422
  }
2421
2423
  };
2422
2424
  module.exports = IndexedDBStorageController;
2423
- } catch (e) {// IndexedDB not supported
2425
+ } else {
2426
+ // IndexedDB not supported
2427
+ module.exports = undefined;
2424
2428
  }
2425
2429
  },{"@babel/runtime-corejs3/core-js-stable/instance/keys":67,"idb-keyval":606}],10:[function(_dereq_,module,exports){
2426
2430
  "use strict";
@@ -6535,21 +6539,42 @@ function matchesKeyConstraints(className, object, objects, key, constraints) {
6535
6539
 
6536
6540
  case '$geoWithin':
6537
6541
  {
6538
- var _context4;
6542
+ if (compareTo.$polygon) {
6543
+ var _context4;
6539
6544
 
6540
- var points = (0, _map.default)(_context4 = compareTo.$polygon).call(_context4, function (geoPoint) {
6541
- return [geoPoint.latitude, geoPoint.longitude];
6542
- });
6543
- var polygon = new ParsePolygon(points);
6544
- return polygon.containsPoint(object[key]);
6545
+ var points = (0, _map.default)(_context4 = compareTo.$polygon).call(_context4, function (geoPoint) {
6546
+ return [geoPoint.latitude, geoPoint.longitude];
6547
+ });
6548
+ var polygon = new ParsePolygon(points);
6549
+ return polygon.containsPoint(object[key]);
6550
+ }
6551
+
6552
+ if (compareTo.$centerSphere) {
6553
+ var _compareTo$$centerSph = (0, _slicedToArray2.default)(compareTo.$centerSphere, 2),
6554
+ WGS84Point = _compareTo$$centerSph[0],
6555
+ maxDistance = _compareTo$$centerSph[1];
6556
+
6557
+ var centerPoint = new ParseGeoPoint({
6558
+ latitude: WGS84Point[1],
6559
+ longitude: WGS84Point[0]
6560
+ });
6561
+ var point = new ParseGeoPoint(object[key]);
6562
+
6563
+ var _distance = point.radiansTo(centerPoint);
6564
+
6565
+ return _distance <= maxDistance;
6566
+ }
6567
+
6568
+ break;
6545
6569
  }
6546
6570
 
6547
6571
  case '$geoIntersects':
6548
6572
  {
6549
6573
  var _polygon = new ParsePolygon(object[key].coordinates);
6550
6574
 
6551
- var point = new ParseGeoPoint(compareTo.$point);
6552
- return _polygon.containsPoint(point);
6575
+ var _point = new ParseGeoPoint(compareTo.$point);
6576
+
6577
+ return _polygon.containsPoint(_point);
6553
6578
  }
6554
6579
 
6555
6580
  default: