babylonjs-serializers 5.43.0 → 5.43.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.
@@ -4590,11 +4590,10 @@ var _BinaryWriter = /** @class */ (function () {
4590
4590
  */
4591
4591
  _BinaryWriter.prototype._resizeBuffer = function (byteLength) {
4592
4592
  var newBuffer = new ArrayBuffer(byteLength);
4593
- var oldUint8Array = new Uint8Array(this._arrayBuffer);
4593
+ var copyOldBufferSize = Math.min(this._arrayBuffer.byteLength, byteLength);
4594
+ var oldUint8Array = new Uint8Array(this._arrayBuffer, 0, copyOldBufferSize);
4594
4595
  var newUint8Array = new Uint8Array(newBuffer);
4595
- for (var i = 0, length_10 = newUint8Array.byteLength; i < length_10; ++i) {
4596
- newUint8Array[i] = oldUint8Array[i];
4597
- }
4596
+ newUint8Array.set(oldUint8Array, 0);
4598
4597
  this._arrayBuffer = newBuffer;
4599
4598
  this._dataView = new DataView(this._arrayBuffer);
4600
4599
  return newBuffer;