@colyseus/schema 2.0.5 → 2.0.7
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/build/cjs/index.js +15 -2
- package/build/cjs/index.js.map +1 -1
- package/build/esm/index.mjs +15 -2
- package/build/esm/index.mjs.map +1 -1
- package/build/umd/index.js +15 -2
- package/lib/types/ArraySchema.d.ts +2 -0
- package/lib/types/ArraySchema.js +15 -2
- package/lib/types/ArraySchema.js.map +1 -1
- package/package.json +15 -14
- package/src/types/ArraySchema.ts +17 -2
package/build/cjs/index.js
CHANGED
|
@@ -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
|
-
|
|
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
|
// }
|