@colyseus/schema 2.0.16 → 2.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 +8 -4
- package/build/cjs/index.js.map +1 -1
- package/build/esm/index.mjs +6 -1
- package/build/esm/index.mjs.map +1 -1
- package/build/umd/index.js +8 -4
- package/lib/Reflection.js +3 -3
- package/lib/Reflection.js.map +1 -1
- package/lib/Schema.d.ts +1 -3
- package/lib/Schema.js.map +1 -1
- package/lib/encoding/encode.d.ts +1 -1
- package/lib/events/EventEmitter.d.ts +13 -0
- package/lib/events/EventEmitter.js +31 -0
- package/lib/events/EventEmitter.js.map +1 -0
- package/lib/spec.js +1 -1
- package/lib/spec.js.map +1 -1
- package/lib/types/HelperTypes.d.ts +2 -2
- package/lib/types/HelperTypes.js.map +1 -1
- package/lib/types/index.d.ts +6 -0
- package/lib/types/index.js +13 -0
- package/lib/types/index.js.map +1 -0
- package/package.json +2 -2
- package/src/Schema.ts +2 -2
- package/src/types/HelperTypes.ts +2 -2
package/build/cjs/index.js
CHANGED
|
@@ -16,7 +16,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
16
16
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
17
17
|
PERFORMANCE OF THIS SOFTWARE.
|
|
18
18
|
***************************************************************************** */
|
|
19
|
-
/* global Reflect, Promise */
|
|
19
|
+
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
20
20
|
|
|
21
21
|
var extendStatics = function(d, b) {
|
|
22
22
|
extendStatics = Object.setPrototypeOf ||
|
|
@@ -48,7 +48,12 @@ function __spreadArray(to, from, pack) {
|
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
51
|
-
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
54
|
+
var e = new Error(message);
|
|
55
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
56
|
+
};
|
|
52
57
|
|
|
53
58
|
// export const SWITCH_TO_STRUCTURE = 193; (easily collides with DELETE_AND_ADD + fieldIndex = 2)
|
|
54
59
|
var SWITCH_TO_STRUCTURE = 255; // (decoding collides with DELETE_AND_ADD + fieldIndex = 63)
|
|
@@ -2475,7 +2480,6 @@ var Schema = /** @class */ (function () {
|
|
|
2475
2480
|
return function () { return spliceOne(_this.$callbacks[prop], _this.$callbacks[prop].indexOf(callback)); };
|
|
2476
2481
|
};
|
|
2477
2482
|
Schema.prototype.decode = function (bytes, it, ref) {
|
|
2478
|
-
var _a;
|
|
2479
2483
|
if (it === void 0) { it = { offset: 0 }; }
|
|
2480
2484
|
if (ref === void 0) { ref = this; }
|
|
2481
2485
|
var allChanges = [];
|
|
@@ -2615,7 +2619,7 @@ var Schema = /** @class */ (function () {
|
|
|
2615
2619
|
var entries = previousValue.entries();
|
|
2616
2620
|
var iter = void 0;
|
|
2617
2621
|
while ((iter = entries.next()) && !iter.done) {
|
|
2618
|
-
var
|
|
2622
|
+
var _a = iter.value, key = _a[0], value_1 = _a[1];
|
|
2619
2623
|
allChanges.push({
|
|
2620
2624
|
refId: refId_2,
|
|
2621
2625
|
op: exports.OPERATION.DELETE,
|