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/node.cjs CHANGED
@@ -175,8 +175,8 @@ class Unpackr {
175
175
  }
176
176
  return this.structures = loadedStructures
177
177
  }
178
- decode(source, end) {
179
- return this.unpack(source, end)
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;