@colyseus/schema 3.0.15 → 3.0.17
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 +2 -11
- package/build/cjs/index.js.map +1 -1
- package/build/esm/index.mjs +2 -11
- package/build/esm/index.mjs.map +1 -1
- package/build/umd/index.js +2 -11
- package/lib/Metadata.d.ts +3 -3
- package/lib/Metadata.js.map +1 -1
- package/lib/annotations.js.map +1 -1
- package/lib/decoder/DecodeOperation.js +2 -11
- package/lib/decoder/DecodeOperation.js.map +1 -1
- package/lib/decoder/strategy/StateCallbacks.d.ts +1 -0
- package/lib/decoder/strategy/StateCallbacks.js.map +1 -1
- package/package.json +1 -1
- package/src/Metadata.ts +1 -1
- package/src/annotations.ts +1 -1
- package/src/decoder/DecodeOperation.ts +4 -16
- package/src/decoder/strategy/StateCallbacks.ts +1 -0
package/build/esm/index.mjs
CHANGED
|
@@ -1538,15 +1538,6 @@ function decodeValue(decoder, operation, ref, index, type, bytes, it, allChanges
|
|
|
1538
1538
|
else if (Schema.is(type)) {
|
|
1539
1539
|
const refId = decode.number(bytes, it);
|
|
1540
1540
|
value = $root.refs.get(refId);
|
|
1541
|
-
if (previousValue) {
|
|
1542
|
-
const previousRefId = $root.refIds.get(previousValue);
|
|
1543
|
-
if (previousRefId &&
|
|
1544
|
-
refId !== previousRefId &&
|
|
1545
|
-
// FIXME: we may need to check for REPLACE operation as well
|
|
1546
|
-
((operation & OPERATION.DELETE) === OPERATION.DELETE)) {
|
|
1547
|
-
$root.removeRef(previousRefId);
|
|
1548
|
-
}
|
|
1549
|
-
}
|
|
1550
1541
|
if ((operation & OPERATION.ADD) === OPERATION.ADD) {
|
|
1551
1542
|
const childType = decoder.getInstanceType(bytes, it, type);
|
|
1552
1543
|
if (!value) {
|
|
@@ -1574,7 +1565,6 @@ function decodeValue(decoder, operation, ref, index, type, bytes, it, allChanges
|
|
|
1574
1565
|
if (previousValue) {
|
|
1575
1566
|
let previousRefId = $root.refIds.get(previousValue);
|
|
1576
1567
|
if (previousRefId !== undefined && refId !== previousRefId) {
|
|
1577
|
-
$root.removeRef(previousRefId);
|
|
1578
1568
|
//
|
|
1579
1569
|
// enqueue onRemove if structure has been replaced.
|
|
1580
1570
|
//
|
|
@@ -1599,7 +1589,8 @@ function decodeValue(decoder, operation, ref, index, type, bytes, it, allChanges
|
|
|
1599
1589
|
}
|
|
1600
1590
|
}
|
|
1601
1591
|
}
|
|
1602
|
-
$root.addRef(refId, value, (valueRef !== previousValue
|
|
1592
|
+
$root.addRef(refId, value, (valueRef !== previousValue ||
|
|
1593
|
+
(operation === OPERATION.DELETE_AND_ADD && valueRef === previousValue)));
|
|
1603
1594
|
}
|
|
1604
1595
|
return { value, previousValue };
|
|
1605
1596
|
}
|