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/index-no-eval.cjs +4 -2
- package/dist/index-no-eval.cjs.map +1 -1
- package/dist/index-no-eval.min.js +1 -1
- package/dist/index-no-eval.min.js.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/node.cjs +5 -3
- package/dist/node.cjs.map +1 -1
- package/dist/test.js +14 -5
- package/dist/test.js.map +1 -1
- package/pack.js +4 -2
- package/package.json +1 -1
- package/struct.js +1 -1
package/dist/node.cjs
CHANGED
|
@@ -1765,10 +1765,11 @@ class Packr extends Unpackr {
|
|
|
1765
1765
|
if (value >> BigInt(0x10000) === empty) {
|
|
1766
1766
|
let mask = BigInt(0x10000000000000000) - BigInt(1); // literal would overflow
|
|
1767
1767
|
let chunks = [];
|
|
1768
|
-
|
|
1768
|
+
while (true) {
|
|
1769
1769
|
chunks.push(value & mask);
|
|
1770
|
+
if ((value >> BigInt(63)) === empty) break
|
|
1770
1771
|
value >>= BigInt(64);
|
|
1771
|
-
}
|
|
1772
|
+
}
|
|
1772
1773
|
|
|
1773
1774
|
array = new Uint8Array(new BigUint64Array(chunks).buffer);
|
|
1774
1775
|
array.reverse();
|
|
@@ -2085,6 +2086,7 @@ class Packr extends Unpackr {
|
|
|
2085
2086
|
// this means we are finished using our own buffer and we can write over it safely
|
|
2086
2087
|
target = buffer;
|
|
2087
2088
|
target.dataView || (target.dataView = new DataView(target.buffer, target.byteOffset, target.byteLength));
|
|
2089
|
+
targetView = target.dataView;
|
|
2088
2090
|
position = 0;
|
|
2089
2091
|
}
|
|
2090
2092
|
set position (value) {
|
|
@@ -2833,7 +2835,7 @@ function readStruct(src, position, srcEnd, unpackr) {
|
|
|
2833
2835
|
};
|
|
2834
2836
|
fullConstruct = structure.fullConstruct = function LoadedObject() {
|
|
2835
2837
|
};
|
|
2836
|
-
fullConstruct.prototype = unpackr.structPrototype
|
|
2838
|
+
fullConstruct.prototype = unpackr.structPrototype || {};
|
|
2837
2839
|
var prototype = construct.prototype = unpackr.structPrototype ? Object.create(unpackr.structPrototype) : {};
|
|
2838
2840
|
let properties = [];
|
|
2839
2841
|
let currentOffset = 0;
|