@colyseus/schema 2.0.36 → 2.0.37
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 +6 -14
- package/build/cjs/index.js.map +1 -1
- package/build/esm/index.mjs +6 -14
- package/build/esm/index.mjs.map +1 -1
- package/build/umd/index.js +6 -14
- package/lib/Schema.d.ts +1 -1
- package/lib/annotations.js +8 -8
- package/lib/annotations.js.map +1 -1
- package/lib/bench_encode.d.ts +1 -0
- package/lib/bench_encode.js +145 -0
- package/lib/bench_encode.js.map +1 -0
- package/lib/codegen/api.js +1 -2
- package/lib/codegen/api.js.map +1 -1
- package/lib/codegen/languages/cpp.js +1 -2
- package/lib/codegen/languages/cpp.js.map +1 -1
- package/lib/codegen/languages/csharp.js +1 -2
- package/lib/codegen/languages/csharp.js.map +1 -1
- package/lib/codegen/languages/haxe.js +1 -2
- package/lib/codegen/languages/haxe.js.map +1 -1
- package/lib/codegen/languages/java.js +1 -2
- package/lib/codegen/languages/java.js.map +1 -1
- package/lib/codegen/languages/js.js +1 -2
- package/lib/codegen/languages/js.js.map +1 -1
- package/lib/codegen/languages/lua.js +1 -2
- package/lib/codegen/languages/lua.js.map +1 -1
- package/lib/codegen/languages/ts.js +1 -2
- package/lib/codegen/languages/ts.js.map +1 -1
- package/lib/codegen/parser.js +2 -3
- package/lib/codegen/parser.js.map +1 -1
- package/lib/codegen/types.js +3 -3
- package/lib/codegen/types.js.map +1 -1
- package/lib/encoding/decode.js +19 -20
- package/lib/encoding/decode.js.map +1 -1
- package/lib/encoding/encode.js +16 -17
- package/lib/encoding/encode.js.map +1 -1
- package/lib/types/ArraySchema.d.ts +1 -0
- package/lib/types/ArraySchema.js +2 -10
- package/lib/types/ArraySchema.js.map +1 -1
- package/lib/types/CollectionSchema.d.ts +2 -2
- package/lib/types/MapSchema.d.ts +3 -3
- package/lib/types/MapSchema.js +2 -2
- package/lib/types/MapSchema.js.map +1 -1
- package/lib/types/SetSchema.d.ts +2 -2
- package/lib/types/typeRegistry.js +2 -3
- package/lib/types/typeRegistry.js.map +1 -1
- package/lib/types/utils.js +3 -4
- package/lib/types/utils.js.map +1 -1
- package/lib/utils.js +1 -2
- package/lib/utils.js.map +1 -1
- package/lib/v2.d.ts +1 -0
- package/lib/v2.js +141 -0
- package/lib/v2.js.map +1 -0
- package/lib/v2_bench.d.ts +1 -0
- package/lib/v2_bench.js +141 -0
- package/lib/v2_bench.js.map +1 -0
- package/package.json +1 -1
- package/src/annotations.ts +1 -1
- package/src/bench_encode.ts +108 -0
- package/src/types/ArraySchema.ts +2 -0
package/build/cjs/index.js
CHANGED
|
@@ -14,7 +14,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
14
14
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
15
15
|
PERFORMANCE OF THIS SOFTWARE.
|
|
16
16
|
***************************************************************************** */
|
|
17
|
-
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
17
|
+
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
18
18
|
|
|
19
19
|
var extendStatics = function(d, b) {
|
|
20
20
|
extendStatics = Object.setPrototypeOf ||
|
|
@@ -676,14 +676,6 @@ var ArraySchema = /** @class */ (function () {
|
|
|
676
676
|
if (fromIndex === void 0) { fromIndex = this.length - 1; }
|
|
677
677
|
return Array.from(this.$items.values()).lastIndexOf(searchElement, fromIndex);
|
|
678
678
|
};
|
|
679
|
-
/**
|
|
680
|
-
* Determines whether all the members of an array satisfy the specified test.
|
|
681
|
-
* @param callbackfn A function that accepts up to three arguments. The every method calls
|
|
682
|
-
* the callbackfn function for each element in the array until the callbackfn returns a value
|
|
683
|
-
* which is coercible to the Boolean value false, or until the end of the array.
|
|
684
|
-
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
|
|
685
|
-
* If thisArg is omitted, undefined is used as the this value.
|
|
686
|
-
*/
|
|
687
679
|
ArraySchema.prototype.every = function (callbackfn, thisArg) {
|
|
688
680
|
return Array.from(this.$items.values()).every(callbackfn, thisArg);
|
|
689
681
|
};
|
|
@@ -1373,7 +1365,7 @@ function type(type, options) {
|
|
|
1373
1365
|
value['$changes'].setParent(this, this.$changes.root, this._definition.indexes[field]);
|
|
1374
1366
|
}
|
|
1375
1367
|
}
|
|
1376
|
-
else if (this[fieldCached]) {
|
|
1368
|
+
else if (this[fieldCached] !== undefined) {
|
|
1377
1369
|
//
|
|
1378
1370
|
// Setting a field to `null` or `undefined` will delete it.
|
|
1379
1371
|
//
|
|
@@ -1658,24 +1650,24 @@ function number$1(bytes, value) {
|
|
|
1658
1650
|
}
|
|
1659
1651
|
else {
|
|
1660
1652
|
// negative fixnum
|
|
1661
|
-
if (value >= -
|
|
1653
|
+
if (value >= -32) {
|
|
1662
1654
|
bytes.push(0xe0 | (value + 0x20));
|
|
1663
1655
|
return 1;
|
|
1664
1656
|
}
|
|
1665
1657
|
// int 8
|
|
1666
|
-
if (value >= -
|
|
1658
|
+
if (value >= -128) {
|
|
1667
1659
|
bytes.push(0xd0);
|
|
1668
1660
|
int8$1(bytes, value);
|
|
1669
1661
|
return 2;
|
|
1670
1662
|
}
|
|
1671
1663
|
// int 16
|
|
1672
|
-
if (value >= -
|
|
1664
|
+
if (value >= -32768) {
|
|
1673
1665
|
bytes.push(0xd1);
|
|
1674
1666
|
int16$1(bytes, value);
|
|
1675
1667
|
return 3;
|
|
1676
1668
|
}
|
|
1677
1669
|
// int 32
|
|
1678
|
-
if (value >= -
|
|
1670
|
+
if (value >= -2147483648) {
|
|
1679
1671
|
bytes.push(0xd2);
|
|
1680
1672
|
int32$1(bytes, value);
|
|
1681
1673
|
return 5;
|