@onehat/data 1.8.20 → 1.8.22

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onehat/data",
3
- "version": "1.8.20",
3
+ "version": "1.8.22",
4
4
  "description": "JS data modeling package with adapters for many storage mediums.",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
package/src/OneHatData.js CHANGED
@@ -13,8 +13,6 @@ import {
13
13
  } from './Schema';
14
14
  import _ from 'lodash';
15
15
 
16
- export let concurrentAsyncRequests = 0; // global counter
17
-
18
16
  /**
19
17
  * OneHatData represents a collection of Repositories.
20
18
  * It is the top-level object for this module.
@@ -58,12 +56,6 @@ export class OneHatData extends EventEmitter {
58
56
  * @private
59
57
  */
60
58
  this.uniqueRepositoriesMap = {};
61
-
62
- /**
63
- * @member {Object} maxConcurrentAsyncRequests - Object map of all unique Repositories, with signature of { mapName: id }
64
- * @public
65
- */
66
- this.maxConcurrentAsyncRequests = 500; // Total number of async requests allowed, before we start making them synchronous
67
59
 
68
60
  /**
69
61
  * @member {boolean} isDestroyed - Whether this object has been destroyed
@@ -117,6 +117,10 @@ class OneBuildRepository extends AjaxRepository {
117
117
 
118
118
  return this.axios(options)
119
119
  .catch(error => {
120
+ if (this.debugMode) {
121
+ console.log(url + ' error', error);
122
+ console.log('response:', error.response);
123
+ }
120
124
  // BEGIN MOD
121
125
  if (error && error.response && error.response.status === 401) {
122
126
  this.emit('logout');
@@ -124,10 +128,6 @@ class OneBuildRepository extends AjaxRepository {
124
128
  return false;
125
129
  }
126
130
  // END MOD
127
- if (this.debugMode) {
128
- console.log(url + ' error', error);
129
- console.log('response:', error.response);
130
- }
131
131
  this.emit('error', error);
132
132
  });
133
133
  }
@@ -1605,7 +1605,9 @@ export default class Repository extends EventEmitter {
1605
1605
  if (this.isDestroyed) {
1606
1606
  throw Error('this.delete is no longer valid. Repository has been destroyed.');
1607
1607
  }
1608
-
1608
+ if (!entities) {
1609
+ return;
1610
+ }
1609
1611
  if (!_.isArray(entities)) {
1610
1612
  entities = [entities];
1611
1613
  }