@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.
- package/build/cjs/index.js +5 -5
- package/build/cjs/index.js.map +1 -1
- package/build/esm/index.mjs +5 -5
- package/build/esm/index.mjs.map +1 -1
- package/build/umd/index.js +5 -5
- package/lib/encoding/decode.d.ts +21 -19
- package/lib/encoding/decode.js +6 -6
- package/lib/encoding/decode.js.map +1 -1
- package/package.json +1 -1
- package/src/encoding/decode.ts +25 -25
package/build/cjs/index.js
CHANGED
|
@@ -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,
|
|
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
|
-
|
|
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,
|