@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/cjs/index.js
CHANGED
|
@@ -538,6 +538,18 @@ function number(bytes, it) {
|
|
|
538
538
|
return (0xff - prefix + 1) * -1;
|
|
539
539
|
}
|
|
540
540
|
}
|
|
541
|
+
function stringCheck(bytes, it) {
|
|
542
|
+
const prefix = bytes[it.offset];
|
|
543
|
+
return (
|
|
544
|
+
// fixstr
|
|
545
|
+
(prefix < 0xc0 && prefix > 0xa0) ||
|
|
546
|
+
// str 8
|
|
547
|
+
prefix === 0xd9 ||
|
|
548
|
+
// str 16
|
|
549
|
+
prefix === 0xda ||
|
|
550
|
+
// str 32
|
|
551
|
+
prefix === 0xdb);
|
|
552
|
+
}
|
|
541
553
|
const decode = {
|
|
542
554
|
utf8Read,
|
|
543
555
|
int8,
|
|
@@ -555,6 +567,7 @@ const decode = {
|
|
|
555
567
|
boolean,
|
|
556
568
|
string,
|
|
557
569
|
number,
|
|
570
|
+
stringCheck,
|
|
558
571
|
};
|
|
559
572
|
|
|
560
573
|
const registeredTypes = {};
|