msgpackr 1.7.0-alpha5 → 1.7.0-alpha6

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "msgpackr",
3
3
  "author": "Kris Zyp",
4
- "version": "1.7.0-alpha5",
4
+ "version": "1.7.0-alpha6",
5
5
  "description": "Ultra-fast MessagePack implementation with extensions for records and structured cloning",
6
6
  "license": "MIT",
7
7
  "types": "./index.d.ts",
package/struct.js CHANGED
@@ -198,7 +198,7 @@ function writeStruct(object, target, position, structures, makeRoom, pack, packr
198
198
  refPosition += encodeUtf8(target, value, refPosition);
199
199
  isNotAscii = refPosition - strStart > strLength;
200
200
  }
201
- if (refOffset < 0x100) {
201
+ if (refOffset < 0xf6) {
202
202
  if (isNotAscii)
203
203
  transition = nextTransition.string8 || createTypeTransition(nextTransition, UTF8, 1);
204
204
  else
@@ -306,7 +306,7 @@ function writeStruct(object, target, position, structures, makeRoom, pack, packr
306
306
  targetView.setUint32(position, refOffset, true);
307
307
  position += 4;
308
308
  }
309
- } else {
309
+ } else { // null or undefined
310
310
  transition = nextTransition.object16 || createTypeTransition(nextTransition, OBJECT_DATA, 2);
311
311
  targetView.setInt16(position, value === null ? -10 : -9, true);
312
312
  position += 2;