dataflux 1.10.1 → 1.10.2

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/BasicObj.js CHANGED
@@ -96,12 +96,12 @@ var BasicObj = /*#__PURE__*/function () {
96
96
  });
97
97
 
98
98
  _defineProperty(this, "setId", function (id) {
99
- _classPrivateFieldSet(_this, _id, id);
99
+ _this.id = id;
100
100
  });
101
101
 
102
102
  _defineProperty(this, "getId", function () {
103
103
  if (!_classPrivateFieldGet(_this, _id)) {
104
- if (_this.id && (typeof _this.id === "string" || typeof _this.id === "number")) {
104
+ if (_this.id != null && (typeof _this.id === "string" || typeof _this.id === "number")) {
105
105
  _classPrivateFieldSet(_this, _id, _this.id.toString());
106
106
 
107
107
  delete _this.setId;
package/dist/Model.js CHANGED
@@ -434,10 +434,11 @@ var Model = /*#__PURE__*/_createClass(function Model(name) {
434
434
  _classPrivateFieldInitSpec(this, _assignId, {
435
435
  writable: true,
436
436
  value: function value(data, objects) {
437
- if (data.length === 1 && objects.length === 1) {
438
- var newId = data[0].id;
439
- objects[0].setId(newId);
440
- delete objects[0].setId;
437
+ if (Array.isArray(data) && Array.isArray(objects) && objects.length === data.length) {
438
+ for (var i = 0; i < data.length; i++) {
439
+ objects[i].setId(data[i].id);
440
+ delete objects[i].setId;
441
+ }
441
442
  }
442
443
  }
443
444
  });