msgpackr 1.11.3 → 1.11.5

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/pack.js CHANGED
@@ -545,10 +545,11 @@ export class Packr extends Unpackr {
545
545
  if (value >> BigInt(0x10000) === empty) {
546
546
  let mask = BigInt(0x10000000000000000) - BigInt(1) // literal would overflow
547
547
  let chunks = []
548
- do {
548
+ while (true) {
549
549
  chunks.push(value & mask)
550
+ if ((value >> BigInt(63)) === empty) break
550
551
  value >>= BigInt(64)
551
- } while (value !== empty)
552
+ }
552
553
 
553
554
  array = new Uint8Array(new BigUint64Array(chunks).buffer)
554
555
  array.reverse()
@@ -865,6 +866,7 @@ export class Packr extends Unpackr {
865
866
  // this means we are finished using our own buffer and we can write over it safely
866
867
  target = buffer
867
868
  target.dataView || (target.dataView = new DataView(target.buffer, target.byteOffset, target.byteLength))
869
+ targetView = target.dataView;
868
870
  position = 0
869
871
  }
870
872
  set position (value) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "msgpackr",
3
3
  "author": "Kris Zyp",
4
- "version": "1.11.3",
4
+ "version": "1.11.5",
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
@@ -521,7 +521,7 @@ function readStruct(src, position, srcEnd, unpackr) {
521
521
  }
522
522
  fullConstruct = structure.fullConstruct = function LoadedObject() {
523
523
  }
524
- fullConstruct.prototype = unpackr.structPrototype ?? {};
524
+ fullConstruct.prototype = unpackr.structPrototype || {};
525
525
  var prototype = construct.prototype = unpackr.structPrototype ? Object.create(unpackr.structPrototype) : {};
526
526
  let properties = [];
527
527
  let currentOffset = 0;