@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.
@@ -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 = {};