@colyseus/schema 2.0.21 → 2.0.23

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.
@@ -617,12 +617,19 @@ var ArraySchema = /** @class */ (function () {
617
617
  */
618
618
  ArraySchema.prototype.splice = function (start, deleteCount) {
619
619
  if (deleteCount === void 0) { deleteCount = this.length - start; }
620
+ var items = [];
621
+ for (var _i = 2; _i < arguments.length; _i++) {
622
+ items[_i - 2] = arguments[_i];
623
+ }
620
624
  var indexes = Array.from(this.$items.keys());
621
625
  var removedItems = [];
622
626
  for (var i = start; i < start + deleteCount; i++) {
623
627
  removedItems.push(this.$items.get(indexes[i]));
624
628
  this.$deleteAt(indexes[i]);
625
629
  }
630
+ for (var i = 0; i < items.length; i++) {
631
+ this.setAt(start + i, items[i]);
632
+ }
626
633
  return removedItems;
627
634
  };
628
635
  /**
@@ -3242,6 +3249,7 @@ var Reflection = /** @class */ (function (_super) {
3242
3249
  return _this;
3243
3250
  }
3244
3251
  Reflection.encode = function (instance) {
3252
+ var _a;
3245
3253
  var rootSchemaType = instance.constructor;
3246
3254
  var reflection = new Reflection();
3247
3255
  reflection.rootType = rootSchemaType._typeid;
@@ -3281,7 +3289,7 @@ var Reflection = /** @class */ (function (_super) {
3281
3289
  }
3282
3290
  reflection.types.push(currentType);
3283
3291
  };
3284
- var types = rootSchemaType._context.types;
3292
+ var types = (_a = rootSchemaType._context) === null || _a === void 0 ? void 0 : _a.types;
3285
3293
  for (var typeid in types) {
3286
3294
  var type_2 = new ReflectionType();
3287
3295
  type_2.id = Number(typeid);