@colyseus/schema 3.0.0-alpha.2 → 3.0.0-alpha.3

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.
@@ -1013,9 +1013,10 @@ const encodeArray = function (encoder, bytes, changeTree, field, operation, it,
1013
1013
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1014
1014
  * SOFTWARE
1015
1015
  */
1016
- function utf8Read(bytes, offset, length) {
1016
+ function utf8Read(bytes, it, length) {
1017
+ it.offset += length;
1017
1018
  var string = '', chr = 0;
1018
- for (var i = offset, end = offset + length; i < end; i++) {
1019
+ for (var i = it.offset, end = it.offset + length; i < end; i++) {
1019
1020
  var byte = bytes[i];
1020
1021
  if ((byte & 0x80) === 0x00) {
1021
1022
  string += String.fromCharCode(byte);
@@ -1117,9 +1118,7 @@ function string(bytes, it) {
1117
1118
  else if (prefix === 0xdb) {
1118
1119
  length = uint32(bytes, it);
1119
1120
  }
1120
- const value = utf8Read(bytes, it.offset, length);
1121
- it.offset += length;
1122
- return value;
1121
+ return utf8Read(bytes, it, length);
1123
1122
  }
1124
1123
  function stringCheck(bytes, it) {
1125
1124
  const prefix = bytes[it.offset];
@@ -1223,6 +1222,7 @@ function switchStructureCheck(bytes, it) {
1223
1222
 
1224
1223
  var decode = /*#__PURE__*/Object.freeze({
1225
1224
  __proto__: null,
1225
+ utf8Read: utf8Read,
1226
1226
  int8: int8,
1227
1227
  uint8: uint8,
1228
1228
  int16: int16,