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/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
|
-
|
|
548
|
+
while (true) {
|
|
549
549
|
chunks.push(value & mask)
|
|
550
|
+
if ((value >> BigInt(63)) === empty) break
|
|
550
551
|
value >>= BigInt(64)
|
|
551
|
-
}
|
|
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
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;
|