@colyseus/schema 3.0.46 → 3.0.48
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 -1
- package/build/cjs/index.js.map +1 -1
- package/build/esm/index.mjs +7 -1
- package/build/esm/index.mjs.map +1 -1
- package/build/umd/index.js +7 -1
- package/lib/decoder/DecodeOperation.js.map +1 -1
- package/lib/encoder/StateView.js +1 -1
- package/lib/encoder/StateView.js.map +1 -1
- package/lib/types/custom/MapSchema.d.ts +1 -1
- package/lib/types/custom/MapSchema.js +6 -0
- package/lib/types/custom/MapSchema.js.map +1 -1
- package/package.json +1 -1
- package/src/decoder/DecodeOperation.ts +0 -1
- package/src/encoder/StateView.ts +1 -1
- package/src/types/custom/MapSchema.ts +9 -1
- package/lib/bench_encode.d.ts +0 -1
- package/lib/bench_encode.js +0 -130
- package/lib/bench_encode.js.map +0 -1
- package/lib/debug.d.ts +0 -1
- package/lib/debug.js +0 -51
- package/lib/debug.js.map +0 -1
- package/src/bench_encode.ts +0 -108
- package/src/debug.ts +0 -55
package/build/esm/index.mjs
CHANGED
|
@@ -2799,6 +2799,12 @@ class MapSchema {
|
|
|
2799
2799
|
this.$indexes.delete(index);
|
|
2800
2800
|
}
|
|
2801
2801
|
[$onEncodeEnd]() {
|
|
2802
|
+
const changeTree = this[$changes];
|
|
2803
|
+
// cleanup changeTree.indexes of deleted keys
|
|
2804
|
+
for (const indexStr in this.deletedItems) {
|
|
2805
|
+
const key = this.$indexes.get(parseInt(indexStr));
|
|
2806
|
+
delete changeTree.indexes[key];
|
|
2807
|
+
}
|
|
2802
2808
|
this.deletedItems = {};
|
|
2803
2809
|
}
|
|
2804
2810
|
toJSON() {
|
|
@@ -5160,7 +5166,7 @@ class StateView {
|
|
|
5160
5166
|
if (tag === DEFAULT_VIEW_TAG) {
|
|
5161
5167
|
// parent is collection (Map/Array)
|
|
5162
5168
|
const parent = changeTree.parent;
|
|
5163
|
-
if (!Metadata.isValidInstance(parent) && changeTree.isFiltered) {
|
|
5169
|
+
if (parent && !Metadata.isValidInstance(parent) && changeTree.isFiltered) {
|
|
5164
5170
|
const parentChangeTree = parent[$changes];
|
|
5165
5171
|
let changes = this.changes.get(parentChangeTree.refId);
|
|
5166
5172
|
if (changes === undefined) {
|