As the encoding Buffer is tied to the module scope (target), when using multiple Packr instances along with .useBuffer() - that Packr instance is not ensured to be using the correct Buffer.
A workaround would be to always call .useBuffer() prior to encoding, but that implies in creating a new DataView instance before each encode.
Last commit will cache the DataView (as is done elsewhere in the code), so you can performantly switch buffers back and forth with useBuffer() (without new DataView each time).
As the encoding Buffer is tied to the module scope (
target
), when using multiplePackr
instances along with.useBuffer()
- thatPackr
instance is not ensured to be using the correct Buffer.A workaround would be to always call
.useBuffer()
prior to encoding, but that implies in creating a newDataView
instance before each encode.