@colyseus/schema 3.0.0-alpha.41 → 3.0.0-alpha.42
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 +13 -0
- package/build/cjs/index.js.map +1 -1
- package/build/esm/index.mjs +13 -0
- package/build/esm/index.mjs.map +1 -1
- package/build/umd/index.js +13 -0
- package/lib/encoding/decode.d.ts +2 -0
- package/lib/encoding/decode.js +14 -0
- package/lib/encoding/decode.js.map +1 -1
- package/package.json +1 -1
- package/src/encoding/decode.ts +16 -1
package/build/esm/index.mjs
CHANGED
|
@@ -536,6 +536,18 @@ function number(bytes, it) {
|
|
|
536
536
|
return (0xff - prefix + 1) * -1;
|
|
537
537
|
}
|
|
538
538
|
}
|
|
539
|
+
function stringCheck(bytes, it) {
|
|
540
|
+
const prefix = bytes[it.offset];
|
|
541
|
+
return (
|
|
542
|
+
// fixstr
|
|
543
|
+
(prefix < 0xc0 && prefix > 0xa0) ||
|
|
544
|
+
// str 8
|
|
545
|
+
prefix === 0xd9 ||
|
|
546
|
+
// str 16
|
|
547
|
+
prefix === 0xda ||
|
|
548
|
+
// str 32
|
|
549
|
+
prefix === 0xdb);
|
|
550
|
+
}
|
|
539
551
|
const decode = {
|
|
540
552
|
utf8Read,
|
|
541
553
|
int8,
|
|
@@ -553,6 +565,7 @@ const decode = {
|
|
|
553
565
|
boolean,
|
|
554
566
|
string,
|
|
555
567
|
number,
|
|
568
|
+
stringCheck,
|
|
556
569
|
};
|
|
557
570
|
|
|
558
571
|
const registeredTypes = {};
|