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.js CHANGED
@@ -169,8 +169,8 @@
169
169
  }
170
170
  return this.structures = loadedStructures
171
171
  }
172
- decode(source, end) {
173
- return this.unpack(source, end)
172
+ decode(source, options) {
173
+ return this.unpack(source, options)
174
174
  }
175
175
  }
176
176
  function checkedRead(options) {
@@ -1164,6 +1164,7 @@
1164
1164
  } else
1165
1165
  position = (position + 7) & 0x7ffffff8; // Word align to make any future copying of this buffer faster
1166
1166
  start = position;
1167
+ if (encodeOptions & RESERVE_START_SPACE) position += (encodeOptions & 0xff);
1167
1168
  referenceMap = packr.structuredClone ? new Map() : null;
1168
1169
  if (packr.bundleStrings && typeof value !== 'string') {
1169
1170
  bundledStrings = [];
@@ -2127,6 +2128,7 @@
2127
2128
  const { NEVER, ALWAYS, DECIMAL_ROUND, DECIMAL_FIT } = FLOAT32_OPTIONS;
2128
2129
  const REUSE_BUFFER_MODE = 512;
2129
2130
  const RESET_BUFFER_MODE = 1024;
2131
+ const RESERVE_START_SPACE = 2048;
2130
2132
 
2131
2133
  /**
2132
2134
  * Given an Iterable first argument, returns an Iterable where each value is packed as a Buffer