msgpackr 1.8.1 → 1.8.3
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/README.md +2 -2
- package/dist/index-no-eval.cjs +7 -8
- 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 +7 -8
- 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 +23 -12
- package/dist/node.cjs.map +1 -1
- package/dist/test.js +23 -12
- package/dist/test.js.map +1 -1
- package/dist/unpack-no-eval.cjs +3 -2
- package/dist/unpack-no-eval.cjs.map +1 -1
- package/index.d.cts +73 -0
- package/pack.js +6 -7
- package/package.json +4 -3
- package/struct.js +15 -4
- package/unpack.js +3 -2
package/dist/index.js
CHANGED
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
let size = source.length;
|
|
117
117
|
let value = this ? this.unpack(source, size) : defaultUnpackr.unpack(source, size);
|
|
118
118
|
if (forEach) {
|
|
119
|
-
forEach(value);
|
|
119
|
+
if (forEach(value) === false) return;
|
|
120
120
|
while(position$1 < size) {
|
|
121
121
|
lastPosition = position$1;
|
|
122
122
|
if (forEach(checkedRead()) === false) {
|
|
@@ -1107,7 +1107,7 @@
|
|
|
1107
1107
|
if (maxSharedStructures > 8160)
|
|
1108
1108
|
throw new Error('Maximum maxSharedStructure is 8160')
|
|
1109
1109
|
if (options.structuredClone && options.moreTypes == undefined) {
|
|
1110
|
-
|
|
1110
|
+
this.moreTypes = true;
|
|
1111
1111
|
}
|
|
1112
1112
|
let maxOwnStructures = options.maxOwnStructures;
|
|
1113
1113
|
if (maxOwnStructures == null)
|
|
@@ -1802,12 +1802,11 @@
|
|
|
1802
1802
|
if (notifySharedUpdate)
|
|
1803
1803
|
return hasSharedUpdate = true;
|
|
1804
1804
|
position = newPosition;
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
}
|
|
1810
|
-
pack(value);
|
|
1805
|
+
let startTarget = target;
|
|
1806
|
+
pack(value);
|
|
1807
|
+
if (startTarget !== target) {
|
|
1808
|
+
return { position, targetView, target }; // indicate the buffer was re-allocated
|
|
1809
|
+
}
|
|
1811
1810
|
return position;
|
|
1812
1811
|
}, this);
|
|
1813
1812
|
if (newPosition === 0) // bail and go to a msgpack object
|