parse 5.3.0-alpha.5 → 5.3.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.
Files changed (46) hide show
  1. package/README.md +4 -4
  2. package/dist/parse.js +171 -296
  3. package/dist/parse.min.js +2 -2
  4. package/dist/parse.weapp.js +171 -296
  5. package/dist/parse.weapp.min.js +2 -2
  6. package/lib/browser/Cloud.js +12 -16
  7. package/lib/browser/CoreManager.js +3 -3
  8. package/lib/browser/ParseFile.js +1 -1
  9. package/lib/browser/ParseObject.js +86 -120
  10. package/lib/browser/ParseQuery.js +21 -88
  11. package/lib/browser/ParseSession.js +1 -5
  12. package/lib/browser/ParseUser.js +40 -56
  13. package/lib/browser/Push.js +2 -2
  14. package/lib/browser/Storage.js +1 -1
  15. package/lib/browser/StorageController.default.js +2 -2
  16. package/lib/node/Cloud.js +12 -16
  17. package/lib/node/CoreManager.js +3 -3
  18. package/lib/node/ParseFile.js +1 -1
  19. package/lib/node/ParseObject.js +82 -115
  20. package/lib/node/ParseQuery.js +21 -88
  21. package/lib/node/ParseSession.js +1 -5
  22. package/lib/node/ParseUser.js +40 -56
  23. package/lib/node/Push.js +2 -2
  24. package/lib/node/Storage.js +1 -1
  25. package/lib/node/StorageController.default.js +2 -2
  26. package/lib/react-native/Cloud.js +4 -16
  27. package/lib/react-native/CoreManager.js +3 -3
  28. package/lib/react-native/ParseFile.js +1 -1
  29. package/lib/react-native/ParseObject.js +54 -115
  30. package/lib/react-native/ParseQuery.js +20 -88
  31. package/lib/react-native/ParseSession.js +1 -5
  32. package/lib/react-native/ParseUser.js +13 -56
  33. package/lib/react-native/Push.js +2 -2
  34. package/lib/react-native/Storage.js +1 -1
  35. package/lib/react-native/StorageController.default.js +2 -2
  36. package/lib/weapp/Cloud.js +12 -16
  37. package/lib/weapp/CoreManager.js +3 -3
  38. package/lib/weapp/ParseFile.js +1 -1
  39. package/lib/weapp/ParseObject.js +86 -120
  40. package/lib/weapp/ParseQuery.js +21 -88
  41. package/lib/weapp/ParseSession.js +1 -5
  42. package/lib/weapp/ParseUser.js +40 -56
  43. package/lib/weapp/Push.js +2 -2
  44. package/lib/weapp/Storage.js +1 -1
  45. package/lib/weapp/StorageController.default.js +2 -2
  46. package/package.json +5 -5
@@ -6,7 +6,7 @@ var memMap = {};
6
6
  var StorageController = {
7
7
  async: 0,
8
8
  getItem: function (path) {
9
- if (memMap.hasOwnProperty(path)) {
9
+ if (Object.hasOwn(memMap, path)) {
10
10
  return memMap[path];
11
11
  }
12
12
  return null;
@@ -22,7 +22,7 @@ var StorageController = {
22
22
  },
23
23
  clear: function () {
24
24
  for (var key in memMap) {
25
- if (memMap.hasOwnProperty(key)) {
25
+ if (Object.hasOwn(memMap, key)) {
26
26
  delete memMap[key];
27
27
  }
28
28
  }
@@ -16,6 +16,7 @@ var _decode = _interopRequireDefault(require("./decode"));
16
16
  var _encode = _interopRequireDefault(require("./encode"));
17
17
  var _ParseError = _interopRequireDefault(require("./ParseError"));
18
18
  var _ParseQuery = _interopRequireDefault(require("./ParseQuery"));
19
+ var _ParseObject = _interopRequireDefault(require("./ParseObject"));
19
20
  /**
20
21
  * Contains functions for calling and declaring
21
22
  * <a href="/docs/cloud_code_guide#functions">cloud functions</a>.
@@ -36,27 +37,22 @@ var _ParseQuery = _interopRequireDefault(require("./ParseQuery"));
36
37
  * @param {string} name The function name.
37
38
  * @param {object} data The parameters to send to the cloud function.
38
39
  * @param {object} options
40
+ * Valid options are:<ul>
41
+ * <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to
42
+ * be used for this request.
43
+ * <li>sessionToken: A valid session token, used for making a request on
44
+ * behalf of a specific user.
45
+ * <li>installationId: the installationId which made the request
46
+ * <li>context: A dictionary that is accessible in Cloud Code triggers.
47
+ * </ul>
39
48
  * @returns {Promise} A promise that will be resolved with the result
40
49
  * of the function.
41
50
  */
42
51
  function run(name, data, options) {
43
- options = options || {};
44
52
  if (typeof name !== 'string' || name.length === 0) {
45
53
  throw new TypeError('Cloud function name must be a string.');
46
54
  }
47
- const requestOptions = {};
48
- if (options.hasOwnProperty('useMasterKey')) {
49
- requestOptions.useMasterKey = !!options.useMasterKey;
50
- }
51
- if (options.sessionToken) {
52
- requestOptions.sessionToken = options.sessionToken;
53
- }
54
- if (options.installationId) {
55
- requestOptions.installationId = options.installationId;
56
- }
57
- if (options.context && typeof options.context === 'object') {
58
- requestOptions.context = options.context;
59
- }
55
+ const requestOptions = _ParseObject.default._getRequestOptions(options);
60
56
  return _CoreManager.default.getCloudController().run(name, data, requestOptions);
61
57
  }
62
58
 
@@ -113,11 +109,11 @@ const DefaultController = {
113
109
  const payload = (0, _encode.default)(data, true);
114
110
  const request = RESTController.request('POST', 'functions/' + name, payload, options);
115
111
  return request.then(res => {
116
- if (typeof res === 'object' && (0, _keys.default)(res).length > 0 && !res.hasOwnProperty('result')) {
112
+ if (typeof res === 'object' && (0, _keys.default)(res).length > 0 && !Object.hasOwn(res, 'result')) {
117
113
  throw new _ParseError.default(_ParseError.default.INVALID_JSON, 'The server returned an invalid response.');
118
114
  }
119
115
  const decoded = (0, _decode.default)(res);
120
- if (decoded && decoded.hasOwnProperty('result')) {
116
+ if (decoded && Object.hasOwn(decoded, 'result')) {
121
117
  return _promise.default.resolve(decoded.result);
122
118
  }
123
119
  return _promise.default.resolve(undefined);
@@ -19,7 +19,7 @@ const config = {
19
19
  SERVER_AUTH_TOKEN: null,
20
20
  LIVEQUERY_SERVER_URL: null,
21
21
  ENCRYPTED_KEY: null,
22
- VERSION: 'js' + "5.3.0-alpha.5",
22
+ VERSION: 'js' + "5.3.0-alpha.6",
23
23
  APPLICATION_ID: null,
24
24
  JAVASCRIPT_KEY: null,
25
25
  MASTER_KEY: null,
@@ -40,7 +40,7 @@ function requireMethods(name, methods, controller) {
40
40
  }
41
41
  const CoreManager = {
42
42
  get: function (key) {
43
- if (config.hasOwnProperty(key)) {
43
+ if (Object.hasOwn(config, key)) {
44
44
  return config[key];
45
45
  }
46
46
  throw new Error('Configuration key not found: ' + key);
@@ -49,7 +49,7 @@ const CoreManager = {
49
49
  config[key] = value;
50
50
  },
51
51
  setIfNeeded: function (key, value) {
52
- if (!config.hasOwnProperty(key)) {
52
+ if (!Object.hasOwn(config, key)) {
53
53
  config[key] = value;
54
54
  }
55
55
  return config[key];
@@ -300,7 +300,7 @@ class ParseFile {
300
300
  const destroyOptions = {
301
301
  useMasterKey: true
302
302
  };
303
- if (options.hasOwnProperty('useMasterKey')) {
303
+ if (Object.hasOwn(options, 'useMasterKey')) {
304
304
  destroyOptions.useMasterKey = !!options.useMasterKey;
305
305
  }
306
306
  const controller = _CoreManager.default.getFileController();
@@ -17,9 +17,9 @@ var _stringify = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-
17
17
  var _includes = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/includes"));
18
18
  var _getPrototypeOf = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/get-prototype-of"));
19
19
  var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
20
- var _isArray = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/array/is-array"));
21
20
  var _promise = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/promise"));
22
21
  var _some = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/some"));
22
+ var _isArray = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/array/is-array"));
23
23
  var _create = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/create"));
24
24
  var _defineProperty3 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/define-property"));
25
25
  var _find = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/find"));
@@ -427,6 +427,41 @@ class ParseObject {
427
427
  static _getClassMap() {
428
428
  return classMap;
429
429
  }
430
+ static _getRequestOptions() {
431
+ let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
432
+ const requestOptions = {};
433
+ const {
434
+ hasOwn
435
+ } = Object;
436
+ if (hasOwn(options, 'useMasterKey')) {
437
+ requestOptions.useMasterKey = !!options.useMasterKey;
438
+ }
439
+ if (hasOwn(options, 'sessionToken') && typeof options.sessionToken === 'string') {
440
+ requestOptions.sessionToken = options.sessionToken;
441
+ }
442
+ if (hasOwn(options, 'installationId') && typeof options.installationId === 'string') {
443
+ requestOptions.installationId = options.installationId;
444
+ }
445
+ if (hasOwn(options, 'transaction') && typeof options.transaction === 'boolean') {
446
+ requestOptions.transaction = options.transaction;
447
+ }
448
+ if (hasOwn(options, 'batchSize') && typeof options.batchSize === 'number') {
449
+ requestOptions.batchSize = options.batchSize;
450
+ }
451
+ if (hasOwn(options, 'context') && typeof options.context === 'object') {
452
+ requestOptions.context = options.context;
453
+ }
454
+ if (hasOwn(options, 'include')) {
455
+ requestOptions.include = ParseObject.handleIncludeOptions(options);
456
+ }
457
+ if (hasOwn(options, 'usePost')) {
458
+ requestOptions.usePost = options.usePost;
459
+ }
460
+ if (hasOwn(options, 'json')) {
461
+ requestOptions.json = options.json;
462
+ }
463
+ return requestOptions;
464
+ }
430
465
 
431
466
  /* Public methods */
432
467
 
@@ -493,11 +528,11 @@ class ParseObject {
493
528
  const pendingOps = this._getPendingOps();
494
529
  const dirtyObjects = this._getDirtyObjectAttributes();
495
530
  if (attr) {
496
- if (dirtyObjects.hasOwnProperty(attr)) {
531
+ if (Object.hasOwn(dirtyObjects, attr)) {
497
532
  return true;
498
533
  }
499
534
  for (let i = 0; i < pendingOps.length; i++) {
500
- if (pendingOps[i].hasOwnProperty(attr)) {
535
+ if (Object.hasOwn(pendingOps[i], attr)) {
501
536
  return true;
502
537
  }
503
538
  }
@@ -631,7 +666,7 @@ class ParseObject {
631
666
  */
632
667
  has(attr) {
633
668
  const attributes = this.attributes;
634
- if (attributes.hasOwnProperty(attr)) {
669
+ if (Object.hasOwn(attributes, attr)) {
635
670
  return attributes[attr] != null;
636
671
  }
637
672
  return false;
@@ -1010,7 +1045,7 @@ class ParseObject {
1010
1045
  * @see Parse.Object#set
1011
1046
  */
1012
1047
  validate(attrs) {
1013
- if (attrs.hasOwnProperty('ACL') && !(attrs.ACL instanceof _ParseACL.default)) {
1048
+ if (Object.hasOwn(attrs, 'ACL') && !(attrs.ACL instanceof _ParseACL.default)) {
1014
1049
  return new _ParseError.default(_ParseError.default.OTHER_CAUSE, 'ACL must be a Parse ACL.');
1015
1050
  }
1016
1051
  for (const key in attrs) {
@@ -1110,33 +1145,7 @@ class ParseObject {
1110
1145
  * completes.
1111
1146
  */
1112
1147
  fetch(options) {
1113
- options = options || {};
1114
- const fetchOptions = {};
1115
- if (options.hasOwnProperty('useMasterKey')) {
1116
- fetchOptions.useMasterKey = options.useMasterKey;
1117
- }
1118
- if (options.hasOwnProperty('sessionToken')) {
1119
- fetchOptions.sessionToken = options.sessionToken;
1120
- }
1121
- if (options.hasOwnProperty('context') && typeof options.context === 'object') {
1122
- fetchOptions.context = options.context;
1123
- }
1124
- if (options.hasOwnProperty('include')) {
1125
- fetchOptions.include = [];
1126
- if ((0, _isArray.default)(options.include)) {
1127
- var _context;
1128
- (0, _forEach.default)(_context = options.include).call(_context, key => {
1129
- if ((0, _isArray.default)(key)) {
1130
- var _context2;
1131
- fetchOptions.include = (0, _concat.default)(_context2 = fetchOptions.include).call(_context2, key);
1132
- } else {
1133
- fetchOptions.include.push(key);
1134
- }
1135
- });
1136
- } else {
1137
- fetchOptions.include.push(options.include);
1138
- }
1139
- }
1148
+ const fetchOptions = ParseObject._getRequestOptions(options);
1140
1149
  const controller = _CoreManager.default.getObjectController();
1141
1150
  return controller.fetch(this, true, fetchOptions);
1142
1151
  }
@@ -1288,23 +1297,10 @@ class ParseObject {
1288
1297
  return _promise.default.reject(validationError);
1289
1298
  }
1290
1299
  }
1291
- const saveOptions = {};
1292
- if (options.hasOwnProperty('useMasterKey')) {
1293
- saveOptions.useMasterKey = !!options.useMasterKey;
1294
- }
1295
- if (options.hasOwnProperty('sessionToken') && typeof options.sessionToken === 'string') {
1296
- saveOptions.sessionToken = options.sessionToken;
1297
- }
1298
- if (options.hasOwnProperty('installationId') && typeof options.installationId === 'string') {
1299
- saveOptions.installationId = options.installationId;
1300
- }
1301
- if (options.hasOwnProperty('context') && typeof options.context === 'object') {
1302
- saveOptions.context = options.context;
1303
- }
1300
+ const saveOptions = ParseObject._getRequestOptions(options);
1304
1301
  const controller = _CoreManager.default.getObjectController();
1305
1302
  const unsaved = options.cascadeSave !== false ? (0, _unsavedChildren.default)(this) : null;
1306
1303
  if (unsaved && unsaved.length && options.transaction === true && (0, _some.default)(unsaved).call(unsaved, el => el instanceof ParseObject)) {
1307
- saveOptions.transaction = options.transaction;
1308
1304
  const unsavedFiles = [];
1309
1305
  const unsavedObjects = [];
1310
1306
  (0, _forEach.default)(unsaved).call(unsaved, el => {
@@ -1368,20 +1364,10 @@ class ParseObject {
1368
1364
  * completes.
1369
1365
  */
1370
1366
  destroy(options) {
1371
- options = options || {};
1372
- const destroyOptions = {};
1373
- if (options.hasOwnProperty('useMasterKey')) {
1374
- destroyOptions.useMasterKey = options.useMasterKey;
1375
- }
1376
- if (options.hasOwnProperty('sessionToken')) {
1377
- destroyOptions.sessionToken = options.sessionToken;
1378
- }
1379
- if (options.hasOwnProperty('context') && typeof options.context === 'object') {
1380
- destroyOptions.context = options.context;
1381
- }
1382
1367
  if (!this.id) {
1383
1368
  return _promise.default.resolve();
1384
1369
  }
1370
+ const destroyOptions = ParseObject._getRequestOptions(options);
1385
1371
  return _CoreManager.default.getObjectController().destroy(this, destroyOptions);
1386
1372
  }
1387
1373
 
@@ -1534,17 +1520,8 @@ class ParseObject {
1534
1520
  */
1535
1521
  static fetchAll(list) {
1536
1522
  let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1537
- const queryOptions = {};
1538
- if (options.hasOwnProperty('useMasterKey')) {
1539
- queryOptions.useMasterKey = options.useMasterKey;
1540
- }
1541
- if (options.hasOwnProperty('sessionToken')) {
1542
- queryOptions.sessionToken = options.sessionToken;
1543
- }
1544
- if (options.hasOwnProperty('include')) {
1545
- queryOptions.include = ParseObject.handleIncludeOptions(options);
1546
- }
1547
- return _CoreManager.default.getObjectController().fetch(list, true, queryOptions);
1523
+ const fetchOptions = ParseObject._getRequestOptions(options);
1524
+ return _CoreManager.default.getObjectController().fetch(list, true, fetchOptions);
1548
1525
  }
1549
1526
 
1550
1527
  /**
@@ -1633,28 +1610,27 @@ class ParseObject {
1633
1610
  *
1634
1611
  * @param {Array} list A list of <code>Parse.Object</code>.
1635
1612
  * @param {object} options
1613
+ * Valid options are:<ul>
1614
+ * <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to
1615
+ * be used for this request.
1616
+ * <li>sessionToken: A valid session token, used for making a request on
1617
+ * behalf of a specific user.
1618
+ * <li>include: The name(s) of the key(s) to include. Can be a string, an array of strings,
1619
+ * or an array of array of strings.
1620
+ * <li>context: A dictionary that is accessible in Cloud Code `beforeFind` trigger.
1621
+ * </ul>
1636
1622
  * @static
1637
1623
  * @returns {Parse.Object[]}
1638
1624
  */
1639
1625
  static fetchAllIfNeeded(list, options) {
1640
- options = options || {};
1641
- const queryOptions = {};
1642
- if (options.hasOwnProperty('useMasterKey')) {
1643
- queryOptions.useMasterKey = options.useMasterKey;
1644
- }
1645
- if (options.hasOwnProperty('sessionToken')) {
1646
- queryOptions.sessionToken = options.sessionToken;
1647
- }
1648
- if (options.hasOwnProperty('include')) {
1649
- queryOptions.include = ParseObject.handleIncludeOptions(options);
1650
- }
1651
- return _CoreManager.default.getObjectController().fetch(list, false, queryOptions);
1626
+ const fetchOptions = ParseObject._getRequestOptions(options);
1627
+ return _CoreManager.default.getObjectController().fetch(list, false, fetchOptions);
1652
1628
  }
1653
1629
  static handleIncludeOptions(options) {
1654
1630
  let include = [];
1655
1631
  if ((0, _isArray.default)(options.include)) {
1656
- var _context3;
1657
- (0, _forEach.default)(_context3 = options.include).call(_context3, key => {
1632
+ var _context;
1633
+ (0, _forEach.default)(_context = options.include).call(_context, key => {
1658
1634
  if ((0, _isArray.default)(key)) {
1659
1635
  include = (0, _concat.default)(include).call(include, key);
1660
1636
  } else {
@@ -1709,28 +1685,22 @@ class ParseObject {
1709
1685
  *
1710
1686
  * @param {Array} list A list of <code>Parse.Object</code>.
1711
1687
  * @param {object} options
1688
+ * Valid options are:<ul>
1689
+ * <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to
1690
+ * be used for this request.
1691
+ * <li>sessionToken: A valid session token, used for making a request on
1692
+ * behalf of a specific user.
1693
+ * <li>context: A dictionary that is accessible in Cloud Code `beforeDelete` and `afterDelete` triggers.
1694
+ * <li>transaction: Set to true to enable transactions
1695
+ * <li>batchSize: How many objects to yield in each batch (default: 20)
1696
+ * </ul>
1712
1697
  * @static
1713
1698
  * @returns {Promise} A promise that is fulfilled when the destroyAll
1714
1699
  * completes.
1715
1700
  */
1716
1701
  static destroyAll(list) {
1717
1702
  let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1718
- const destroyOptions = {};
1719
- if (options.hasOwnProperty('useMasterKey')) {
1720
- destroyOptions.useMasterKey = options.useMasterKey;
1721
- }
1722
- if (options.hasOwnProperty('sessionToken')) {
1723
- destroyOptions.sessionToken = options.sessionToken;
1724
- }
1725
- if (options.hasOwnProperty('transaction') && typeof options.transaction === 'boolean') {
1726
- destroyOptions.transaction = options.transaction;
1727
- }
1728
- if (options.hasOwnProperty('batchSize') && typeof options.batchSize === 'number') {
1729
- destroyOptions.batchSize = options.batchSize;
1730
- }
1731
- if (options.hasOwnProperty('context') && typeof options.context === 'object') {
1732
- destroyOptions.context = options.context;
1733
- }
1703
+ const destroyOptions = ParseObject._getRequestOptions(options);
1734
1704
  return _CoreManager.default.getObjectController().destroy(list, destroyOptions);
1735
1705
  }
1736
1706
 
@@ -1749,27 +1719,23 @@ class ParseObject {
1749
1719
  *
1750
1720
  * @param {Array} list A list of <code>Parse.Object</code>.
1751
1721
  * @param {object} options
1722
+ * Valid options are:
1723
+ * <ul>
1724
+ * <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to
1725
+ * be used for this request.
1726
+ * <li>sessionToken: A valid session token, used for making a request on
1727
+ * behalf of a specific user.
1728
+ * <li>cascadeSave: If `false`, nested objects will not be saved (default is `true`).
1729
+ * <li>context: A dictionary that is accessible in Cloud Code `beforeSave` and `afterSave` triggers.
1730
+ * <li>transaction: Set to true to enable transactions
1731
+ * <li>batchSize: How many objects to yield in each batch (default: 20)
1732
+ * </ul>
1752
1733
  * @static
1753
1734
  * @returns {Parse.Object[]}
1754
1735
  */
1755
1736
  static saveAll(list) {
1756
1737
  let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1757
- const saveOptions = {};
1758
- if (options.hasOwnProperty('useMasterKey')) {
1759
- saveOptions.useMasterKey = options.useMasterKey;
1760
- }
1761
- if (options.hasOwnProperty('sessionToken')) {
1762
- saveOptions.sessionToken = options.sessionToken;
1763
- }
1764
- if (options.hasOwnProperty('transaction') && typeof options.transaction === 'boolean') {
1765
- saveOptions.transaction = options.transaction;
1766
- }
1767
- if (options.hasOwnProperty('batchSize') && typeof options.batchSize === 'number') {
1768
- saveOptions.batchSize = options.batchSize;
1769
- }
1770
- if (options.hasOwnProperty('context') && typeof options.context === 'object') {
1771
- saveOptions.context = options.context;
1772
- }
1738
+ const saveOptions = ParseObject._getRequestOptions(options);
1773
1739
  return _CoreManager.default.getObjectController().save(list, saveOptions);
1774
1740
  }
1775
1741
 
@@ -1926,7 +1892,7 @@ class ParseObject {
1926
1892
  adjustedClassName = '_User';
1927
1893
  }
1928
1894
  let parentProto = ParseObject.prototype;
1929
- if (this.hasOwnProperty('__super__') && this.__super__) {
1895
+ if (Object.hasOwn(this, '__super__') && this.__super__) {
1930
1896
  parentProto = this.prototype;
1931
1897
  }
1932
1898
  let ParseObjectSubclass = function (attributes, options) {
@@ -2293,7 +2259,7 @@ const DefaultController = {
2293
2259
  deleteCompleted = deleteCompleted.then(() => {
2294
2260
  return RESTController.request('POST', 'batch', body, options).then(results => {
2295
2261
  for (let i = 0; i < results.length; i++) {
2296
- if (results[i] && results[i].hasOwnProperty('error')) {
2262
+ if (results[i] && Object.hasOwn(results[i], 'error')) {
2297
2263
  const err = new _ParseError.default(results[i].error.code, results[i].error.error);
2298
2264
  err.object = batch[i];
2299
2265
  errors.push(err);
@@ -2364,7 +2330,7 @@ const DefaultController = {
2364
2330
  const batch = [];
2365
2331
  const nextPending = [];
2366
2332
  (0, _forEach.default)(pending).call(pending, el => {
2367
- if (allowCustomObjectId && Object.prototype.hasOwnProperty.call(el, 'id') && !el.id) {
2333
+ if (allowCustomObjectId && Object.hasOwn(el, 'id') && !el.id) {
2368
2334
  throw new _ParseError.default(_ParseError.default.MISSING_OBJECT_ID, 'objectId must not be empty or null');
2369
2335
  }
2370
2336
  if (batch.length < batchSize && (0, _canBeSerialized.default)(el)) {
@@ -2390,7 +2356,7 @@ const DefaultController = {
2390
2356
  batchTasks.push(stateController.enqueueTask(obj._getStateIdentifier(), function () {
2391
2357
  ready.resolve();
2392
2358
  return batchReturned.then(responses => {
2393
- if (responses[index].hasOwnProperty('success')) {
2359
+ if (Object.hasOwn(responses[index], 'success')) {
2394
2360
  const objectId = responses[index].success.objectId;
2395
2361
  const status = responses[index]._status;
2396
2362
  delete responses[index]._status;
@@ -2399,7 +2365,7 @@ const DefaultController = {
2399
2365
  mapIdForPin[objectId] = obj._localId;
2400
2366
  obj._handleSaveResponse(responses[index].success, status);
2401
2367
  } else {
2402
- if (!objectError && responses[index].hasOwnProperty('error')) {
2368
+ if (!objectError && Object.hasOwn(responses[index], 'error')) {
2403
2369
  const serverError = responses[index].error;
2404
2370
  objectError = new _ParseError.default(serverError.code, serverError.error);
2405
2371
  // Cancel the rest of the save
@@ -2443,7 +2409,7 @@ const DefaultController = {
2443
2409
  });
2444
2410
  });
2445
2411
  } else if (target instanceof ParseObject) {
2446
- if (allowCustomObjectId && Object.prototype.hasOwnProperty.call(target, 'id') && !target.id) {
2412
+ if (allowCustomObjectId && Object.hasOwn(target, 'id') && !target.id) {
2447
2413
  throw new _ParseError.default(_ParseError.default.MISSING_OBJECT_ID, 'objectId must not be empty or null');
2448
2414
  }
2449
2415
  // generate _localId in case if cascadeSave=false