msgpackr 1.8.2 → 1.8.4

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
@@ -557,7 +557,8 @@ function setExtractor(extractStrings) {
557
557
  if (string == null) {
558
558
  if (bundledStrings$1)
559
559
  return readStringJS(length)
560
- let extraction = extractStrings(position$1 - headerLength, srcEnd, src);
560
+ let byteOffset = src.byteOffset;
561
+ let extraction = extractStrings(position$1 - headerLength + byteOffset, srcEnd + byteOffset, src.buffer);
561
562
  if (typeof extraction == 'string') {
562
563
  string = extraction;
563
564
  strings = EMPTY_ARRAY;
@@ -1144,7 +1145,7 @@ let position = 0;
1144
1145
  let safeEnd;
1145
1146
  let bundledStrings = null;
1146
1147
  let writeStructSlots;
1147
- const MAX_BUNDLE_SIZE = 0xf000;
1148
+ const MAX_BUNDLE_SIZE = 0x5500; // maximum characters such that the encoded bytes fits in 16 bits.
1148
1149
  const hasNonLatin = /[\u0080-\uFFFF]/;
1149
1150
  const RECORD_SYMBOL = Symbol('record-id');
1150
1151
  class Packr extends Unpackr {