@colyseus/schema 3.0.0-alpha.32 → 3.0.0-alpha.33
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 +5 -7
- package/build/cjs/index.js.map +1 -1
- package/build/esm/index.mjs +5 -7
- package/build/esm/index.mjs.map +1 -1
- package/build/umd/index.js +5 -7
- package/lib/encoder/ChangeTree.js +1 -7
- package/lib/encoder/ChangeTree.js.map +1 -1
- package/lib/encoder/Root.js +4 -0
- package/lib/encoder/Root.js.map +1 -1
- package/package.json +1 -1
- package/src/encoder/ChangeTree.ts +1 -8
- package/src/encoder/Root.ts +5 -0
package/build/cjs/index.js
CHANGED
|
@@ -483,13 +483,7 @@ class ChangeTree {
|
|
|
483
483
|
//
|
|
484
484
|
// (the property descriptors should NOT be used at decoding time. only at encoding time.)
|
|
485
485
|
//
|
|
486
|
-
|
|
487
|
-
//
|
|
488
|
-
// Only remove "root" reference if it's the last reference
|
|
489
|
-
//
|
|
490
|
-
if (refCount <= 0) {
|
|
491
|
-
previousValue[$changes].root = undefined;
|
|
492
|
-
}
|
|
486
|
+
this.root?.remove(previousValue[$changes]);
|
|
493
487
|
}
|
|
494
488
|
//
|
|
495
489
|
// FIXME: this is looking a bit ugly (and repeated from `.change()`)
|
|
@@ -3469,6 +3463,10 @@ class Root {
|
|
|
3469
3463
|
remove(changeTree) {
|
|
3470
3464
|
const refCount = (this.refCount.get(changeTree)) - 1;
|
|
3471
3465
|
if (refCount <= 0) {
|
|
3466
|
+
//
|
|
3467
|
+
// Only remove "root" reference if it's the last reference
|
|
3468
|
+
//
|
|
3469
|
+
changeTree.root = undefined;
|
|
3472
3470
|
this.allChanges.delete(changeTree);
|
|
3473
3471
|
this.changes.delete(changeTree);
|
|
3474
3472
|
if (changeTree.isFiltered || changeTree.isPartiallyFiltered) {
|