-
Notifications
You must be signed in to change notification settings - Fork 64
Open
Description
Im not sure if this is the right way, but when i add the structure methods i get an error
let packr = new Packr({
useRecords: true,
// Enable saving/restoring structures
getStructures() {
return this.structures || [];
},
saveStructures(structures) {
this.structures = structures;
},
});
or alternatively
let packr = new Packr({
useRecords: true,
structures: [["event", "type", "message"]], // my data is a list of objects
});231 | restoreStructures()
232 | clearSource()
233 | if (error instanceof RangeError || error.message.startsWith('Unexpected end of buffer') || position > srcEnd) {
234 | error.incomplete = true
235 | }
236 | throw error
^
error: Data read, but end of buffer not reached [64]
at checkedRead (/Users/benjaminhon/Developer/christmas/christmas/app/node_modules/msgpackr/unpack.js:236:9)
I am on version: "msgpackr": "^1.11.2",
It works if i remove it. But what i want to acheive is having the records shared across multiple calls to packr.pack(data)
Im not sure why but i suspect that structures only work with dicts and not list of dicts?
Metadata
Metadata
Assignees
Labels
No labels