@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/esm/index.mjs
CHANGED
|
@@ -481,13 +481,7 @@ class ChangeTree {
|
|
|
481
481
|
//
|
|
482
482
|
// (the property descriptors should NOT be used at decoding time. only at encoding time.)
|
|
483
483
|
//
|
|
484
|
-
|
|
485
|
-
//
|
|
486
|
-
// Only remove "root" reference if it's the last reference
|
|
487
|
-
//
|
|
488
|
-
if (refCount <= 0) {
|
|
489
|
-
previousValue[$changes].root = undefined;
|
|
490
|
-
}
|
|
484
|
+
this.root?.remove(previousValue[$changes]);
|
|
491
485
|
}
|
|
492
486
|
//
|
|
493
487
|
// FIXME: this is looking a bit ugly (and repeated from `.change()`)
|
|
@@ -3467,6 +3461,10 @@ class Root {
|
|
|
3467
3461
|
remove(changeTree) {
|
|
3468
3462
|
const refCount = (this.refCount.get(changeTree)) - 1;
|
|
3469
3463
|
if (refCount <= 0) {
|
|
3464
|
+
//
|
|
3465
|
+
// Only remove "root" reference if it's the last reference
|
|
3466
|
+
//
|
|
3467
|
+
changeTree.root = undefined;
|
|
3470
3468
|
this.allChanges.delete(changeTree);
|
|
3471
3469
|
this.changes.delete(changeTree);
|
|
3472
3470
|
if (changeTree.isFiltered || changeTree.isPartiallyFiltered) {
|