@fluid-experimental/property-properties 2.0.0-internal.2.1.2 → 2.0.0-internal.2.2.0
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/properties/arrayProperty.d.ts.map +1 -1
- package/dist/properties/arrayProperty.js +21 -13
- package/dist/properties/arrayProperty.js.map +1 -1
- package/lib/properties/arrayProperty.d.ts.map +1 -1
- package/lib/properties/arrayProperty.js +21 -13
- package/lib/properties/arrayProperty.js.map +1 -1
- package/package.json +11 -8
|
@@ -361,21 +361,29 @@ export class ArrayProperty extends AbstractStaticCollectionProperty {
|
|
|
361
361
|
}
|
|
362
362
|
}
|
|
363
363
|
else {
|
|
364
|
-
if (_.isArray(in_values)
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
var that = this;
|
|
368
|
-
var maxIndex = this._dataArrayGetLength() - 1;
|
|
369
|
-
_.each(in_values, function (value, index) {
|
|
370
|
-
if (index > maxIndex) {
|
|
371
|
-
that.insert(index, value);
|
|
364
|
+
if (_.isArray(in_values)) {
|
|
365
|
+
if (in_values.length < this._dataArrayGetLength()) {
|
|
366
|
+
this.removeRange(in_values.length, this._dataArrayGetLength() - in_values.length);
|
|
372
367
|
}
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
}
|
|
368
|
+
this.setRange(0, in_values.slice(0, this._dataArrayGetLength()));
|
|
369
|
+
if (in_values.length > this._dataArrayGetLength()) {
|
|
370
|
+
this.insertRange(this._dataArrayGetLength(), in_values.slice(this._dataArrayGetLength()));
|
|
377
371
|
}
|
|
378
|
-
}
|
|
372
|
+
}
|
|
373
|
+
else {
|
|
374
|
+
var that = this;
|
|
375
|
+
var maxIndex = this._dataArrayGetLength() - 1;
|
|
376
|
+
_.each(in_values, function (value, index) {
|
|
377
|
+
if (index > maxIndex) {
|
|
378
|
+
that.insert(index, value);
|
|
379
|
+
}
|
|
380
|
+
else {
|
|
381
|
+
if (that._dataArrayGetValue(index) !== value) {
|
|
382
|
+
that.set(index, value);
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
});
|
|
386
|
+
}
|
|
379
387
|
}
|
|
380
388
|
}
|
|
381
389
|
/**
|