@colyseus/schema 2.0.6 → 2.0.8

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.
@@ -518,6 +518,7 @@ var ArraySchema = /** @class */ (function () {
518
518
  * Combines two or more arrays.
519
519
  * @param items Additional items to add to the end of array1.
520
520
  */
521
+ // @ts-ignore
521
522
  ArraySchema.prototype.concat = function () {
522
523
  var _a;
523
524
  var items = [];
@@ -536,6 +537,7 @@ var ArraySchema = /** @class */ (function () {
536
537
  /**
537
538
  * Reverses the elements in an Array.
538
539
  */
540
+ // @ts-ignore
539
541
  ArraySchema.prototype.reverse = function () {
540
542
  var _this = this;
541
543
  var indexes = Array.from(this.$items.keys());
@@ -564,7 +566,9 @@ var ArraySchema = /** @class */ (function () {
564
566
  * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'.
565
567
  */
566
568
  ArraySchema.prototype.slice = function (start, end) {
567
- return new (ArraySchema.bind.apply(ArraySchema, __spreadArray([void 0], Array.from(this.$items.values()).slice(start, end), false)))();
569
+ var sliced = new ArraySchema();
570
+ sliced.push.apply(sliced, Array.from(this.$items.values()).slice(start, end));
571
+ return sliced;
568
572
  };
569
573
  /**
570
574
  * Sorts an array.
@@ -805,9 +809,18 @@ var ArraySchema = /** @class */ (function () {
805
809
  */
806
810
  // @ts-ignore
807
811
  ArraySchema.prototype.flat = function (depth) {
808
- // @ts-ignore
809
812
  throw new Error("ArraySchema#flat() is not supported.");
810
813
  };
814
+ ArraySchema.prototype.findLast = function () {
815
+ var arr = Array.from(this.$items.values());
816
+ // @ts-ignore
817
+ return arr.findLast.apply(arr, arguments);
818
+ };
819
+ ArraySchema.prototype.findLastIndex = function () {
820
+ var arr = Array.from(this.$items.values());
821
+ // @ts-ignore
822
+ return arr.findLastIndex.apply(arr, arguments);
823
+ };
811
824
  // get size () {
812
825
  // return this.$items.size;
813
826
  // }
@@ -2422,6 +2435,7 @@ var Schema = /** @class */ (function () {
2422
2435
  return function () { return spliceOne(_this.$callbacks[attr], _this.$callbacks[attr].indexOf(callback)); };
2423
2436
  };
2424
2437
  Schema.prototype.decode = function (bytes, it, ref) {
2438
+ var _a;
2425
2439
  if (it === void 0) { it = { offset: 0 }; }
2426
2440
  if (ref === void 0) { ref = this; }
2427
2441
  var allChanges = [];
@@ -2561,7 +2575,7 @@ var Schema = /** @class */ (function () {
2561
2575
  var entries = previousValue.entries();
2562
2576
  var iter = void 0;
2563
2577
  while ((iter = entries.next()) && !iter.done) {
2564
- var _a = iter.value, key = _a[0], value_1 = _a[1];
2578
+ var key = (_a = iter.value, _a[0]), value_1 = _a[1];
2565
2579
  allChanges.push({
2566
2580
  refId: refId_2,
2567
2581
  op: exports.OPERATION.DELETE,