Skip to content

Commit 6b010f5

Browse files
committed
Maintain correct encode options on repacking
1 parent 4b01143 commit 6b010f5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

pack.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ export class Packr extends Unpackr {
181181
let newSharedData = prepareStructures(structures, packr);
182182
if (packr.saveStructures(newSharedData, newSharedData.isCompatible) === false) {
183183
// get updated structures and try again if the update failed
184-
return packr.pack(value)
184+
return packr.pack(value, encodeOptions)
185185
}
186186
packr.lastNamedStructuresLength = sharedLength
187187
return returnBuffer
@@ -775,7 +775,7 @@ export class Packr extends Unpackr {
775775
}
776776
}
777777
const writeStruct = (object, safePrototype) => {
778-
let newPosition = writeStructSlots(object, target, position, structures, makeRoom, (value, newPosition, notifySharedUpdate) => {
778+
let newPosition = writeStructSlots(object, target, start, position, structures, makeRoom, (value, newPosition, notifySharedUpdate) => {
779779
if (notifySharedUpdate)
780780
return hasSharedUpdate = true;
781781
position = newPosition;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "msgpackr",
33
"author": "Kris Zyp",
4-
"version": "1.9.8",
4+
"version": "1.9.9",
55
"description": "Ultra-fast MessagePack implementation with extensions for records and structured cloning",
66
"license": "MIT",
77
"types": "./index.d.ts",

0 commit comments

Comments
 (0)