@onehat/data 1.7.0 → 1.7.1

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.7.0",
3
+ "version": "1.7.1",
4
4
  "description": "JS data modeling package with adapters for many storage mediums.",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -1254,13 +1254,13 @@ export default class Repository extends EventEmitter {
1254
1254
  switch(operation) {
1255
1255
  case 'add':
1256
1256
  entities = this.getNonPersisted();
1257
- if (this.combineBatch) {
1257
+ if (_.size(entities) > 0) {
1258
+ if (this.combineBatch) {
1258
1259
 
1259
1260
  result = this.batchAsSynchronous ? await this._doBatchAdd(entities) : this._doBatchAdd(entities);
1260
1261
  results.push(result);
1261
1262
 
1262
- } else {
1263
- if (_.size(entities) > 0) {
1263
+ } else {
1264
1264
  for (i = 0; i < entities.length; i++) {
1265
1265
  entity = entities[i];
1266
1266
 
@@ -1275,18 +1275,16 @@ export default class Repository extends EventEmitter {
1275
1275
  }
1276
1276
  }
1277
1277
  }
1278
-
1279
-
1280
1278
  break;
1281
1279
  case 'edit':
1282
1280
  entities = this.getDirty();
1283
- if (this.combineBatch) {
1281
+ if (_.size(entities) > 0) {
1282
+ if (this.combineBatch) {
1284
1283
 
1285
- result = this.batchAsSynchronous ? await this._doBatchEdit(entities) : this._doBatchEdit(entities);
1286
- results.push(result);
1284
+ result = this.batchAsSynchronous ? await this._doBatchEdit(entities) : this._doBatchEdit(entities);
1285
+ results.push(result);
1287
1286
 
1288
- } else {
1289
- if (_.size(entities) > 0) {
1287
+ } else {
1290
1288
  for (i = 0; i < entities.length; i++) {
1291
1289
  entity = entities[i];
1292
1290
 
@@ -1304,13 +1302,13 @@ export default class Repository extends EventEmitter {
1304
1302
  break;
1305
1303
  case 'delete':
1306
1304
  entities = this.getDeleted();
1307
- if (this.combineBatch) {
1305
+ if (_.size(entities) > 0) {
1306
+ if (this.combineBatch) {
1308
1307
 
1309
1308
  result = this.batchAsSynchronous ? await this._doBatchDelete(entities) : this._doBatchDelete(entities);
1310
1309
  results.push(result);
1311
1310
 
1312
- } else {
1313
- if (_.size(entities) > 0) {
1311
+ } else {
1314
1312
  for (i = 0; i < entities.length; i++) {
1315
1313
  entity = entities[i];
1316
1314