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/dist/test.js CHANGED
@@ -1760,10 +1760,11 @@
1760
1760
  if (value >> BigInt(0x10000) === empty) {
1761
1761
  let mask = BigInt(0x10000000000000000) - BigInt(1); // literal would overflow
1762
1762
  let chunks = [];
1763
- do {
1763
+ while (true) {
1764
1764
  chunks.push(value & mask);
1765
+ if ((value >> BigInt(63)) === empty) break
1765
1766
  value >>= BigInt(64);
1766
- } while (value !== empty)
1767
+ }
1767
1768
 
1768
1769
  array = new Uint8Array(new BigUint64Array(chunks).buffer);
1769
1770
  array.reverse();
@@ -2080,6 +2081,7 @@
2080
2081
  // this means we are finished using our own buffer and we can write over it safely
2081
2082
  target = buffer;
2082
2083
  target.dataView || (target.dataView = new DataView(target.buffer, target.byteOffset, target.byteLength));
2084
+ targetView = target.dataView;
2083
2085
  position = 0;
2084
2086
  }
2085
2087
  set position (value) {
@@ -2826,7 +2828,7 @@
2826
2828
  };
2827
2829
  fullConstruct = structure.fullConstruct = function LoadedObject() {
2828
2830
  };
2829
- fullConstruct.prototype = unpackr.structPrototype ?? {};
2831
+ fullConstruct.prototype = unpackr.structPrototype || {};
2830
2832
  var prototype = construct.prototype = unpackr.structPrototype ? Object.create(unpackr.structPrototype) : {};
2831
2833
  let properties = [];
2832
2834
  let currentOffset = 0;
@@ -3517,11 +3519,18 @@
3517
3519
  l: -0xdeadn << 0xbeefn,
3518
3520
  m: 11n << 0x11111n ^ 111n,
3519
3521
  n: -11n << 0x11111n ^ 111n,
3520
- array: [],
3522
+ o: 12345678901234567890n,
3523
+ p: -12345678901234567890n,
3524
+ exp: [],
3525
+ expexp: [],
3521
3526
  };
3522
3527
 
3528
+ for (let n = 1n; n.toString(16).length * 4 < 1500; n <<= 1n, n |= BigInt(Math.floor(Math.random() * 2))) {
3529
+ data.exp.push(n, -n);
3530
+ }
3531
+
3523
3532
  for (let n = 7n; n.toString(16).length * 4 < 150000; n *= n) {
3524
- data.array.push(n, -n);
3533
+ data.expexp.push(n, -n);
3525
3534
  }
3526
3535
 
3527
3536
  let serialized = packr.pack(data);