@colyseus/schema 3.0.59 → 3.0.60
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 +7 -2
- package/build/cjs/index.js.map +1 -1
- package/build/esm/index.mjs +7 -2
- package/build/esm/index.mjs.map +1 -1
- package/build/umd/index.js +7 -2
- package/lib/types/custom/MapSchema.js +7 -2
- package/lib/types/custom/MapSchema.js.map +1 -1
- package/package.json +1 -1
- package/src/types/custom/MapSchema.ts +7 -2
package/build/cjs/index.js
CHANGED
|
@@ -2799,10 +2799,15 @@ class MapSchema {
|
|
|
2799
2799
|
}
|
|
2800
2800
|
[$onEncodeEnd]() {
|
|
2801
2801
|
const changeTree = this[$changes];
|
|
2802
|
-
// cleanup changeTree.indexes
|
|
2802
|
+
// - cleanup changeTree.indexes
|
|
2803
|
+
// - cleanup $indexes
|
|
2803
2804
|
for (const indexStr in this.deletedItems) {
|
|
2804
|
-
const
|
|
2805
|
+
const index = parseInt(indexStr);
|
|
2806
|
+
const key = this.$indexes.get(index);
|
|
2807
|
+
// TODO: refactor this.
|
|
2808
|
+
// it shouldn't be necessary to keep track of indexes both on changeTree and on $indexes
|
|
2805
2809
|
delete changeTree.indexes[key];
|
|
2810
|
+
this.$indexes.delete(index);
|
|
2806
2811
|
}
|
|
2807
2812
|
this.deletedItems = {};
|
|
2808
2813
|
}
|