msgpackr 1.9.7 → 1.9.8
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 +4 -2
- package/dist/node.cjs.map +1 -1
- package/dist/test.js +4 -2
- package/dist/test.js.map +1 -1
- package/dist/unpack-no-eval.cjs +2 -2
- package/dist/unpack-no-eval.cjs.map +1 -1
- package/pack.js +2 -0
- package/package.json +1 -1
- package/unpack.js +2 -2
package/dist/node.cjs
CHANGED
|
@@ -175,8 +175,8 @@ class Unpackr {
|
|
|
175
175
|
}
|
|
176
176
|
return this.structures = loadedStructures
|
|
177
177
|
}
|
|
178
|
-
decode(source,
|
|
179
|
-
return this.unpack(source,
|
|
178
|
+
decode(source, options) {
|
|
179
|
+
return this.unpack(source, options)
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
182
|
function checkedRead(options) {
|
|
@@ -1231,6 +1231,7 @@ class Packr extends Unpackr {
|
|
|
1231
1231
|
} else
|
|
1232
1232
|
position = (position + 7) & 0x7ffffff8; // Word align to make any future copying of this buffer faster
|
|
1233
1233
|
start = position;
|
|
1234
|
+
if (encodeOptions & RESERVE_START_SPACE) position += (encodeOptions & 0xff);
|
|
1234
1235
|
referenceMap = packr.structuredClone ? new Map() : null;
|
|
1235
1236
|
if (packr.bundleStrings && typeof value !== 'string') {
|
|
1236
1237
|
bundledStrings = [];
|
|
@@ -2198,6 +2199,7 @@ const Encoder = Packr;
|
|
|
2198
2199
|
const { NEVER, ALWAYS, DECIMAL_ROUND, DECIMAL_FIT } = FLOAT32_OPTIONS;
|
|
2199
2200
|
const REUSE_BUFFER_MODE = 512;
|
|
2200
2201
|
const RESET_BUFFER_MODE = 1024;
|
|
2202
|
+
const RESERVE_START_SPACE = 2048;
|
|
2201
2203
|
|
|
2202
2204
|
const ASCII = 3; // the MIBenum from https://www.iana.org/assignments/character-sets/character-sets.xhtml (and other character encodings could be referenced by MIBenum)
|
|
2203
2205
|
const NUMBER = 0;
|