Skip to content

Commit

Permalink
Maintain correct encode options on repacking
Browse files Browse the repository at this point in the history
  • Loading branch information
kriszyp committed Sep 8, 2023
1 parent 4b01143 commit 6b010f5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pack.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ export class Packr extends Unpackr {
let newSharedData = prepareStructures(structures, packr);
if (packr.saveStructures(newSharedData, newSharedData.isCompatible) === false) {
// get updated structures and try again if the update failed
return packr.pack(value)
return packr.pack(value, encodeOptions)
}
packr.lastNamedStructuresLength = sharedLength
return returnBuffer
Expand Down Expand Up @@ -775,7 +775,7 @@ export class Packr extends Unpackr {
}
}
const writeStruct = (object, safePrototype) => {
let newPosition = writeStructSlots(object, target, position, structures, makeRoom, (value, newPosition, notifySharedUpdate) => {
let newPosition = writeStructSlots(object, target, start, position, structures, makeRoom, (value, newPosition, notifySharedUpdate) => {
if (notifySharedUpdate)
return hasSharedUpdate = true;
position = newPosition;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "msgpackr",
"author": "Kris Zyp",
"version": "1.9.8",
"version": "1.9.9",
"description": "Ultra-fast MessagePack implementation with extensions for records and structured cloning",
"license": "MIT",
"types": "./index.d.ts",
Expand Down

0 comments on commit 6b010f5

Please sign in to comment.