floydpink/lzwCompress.js

not working with nodejs Buffer

sun2008mt opened this issue · 1 comments

const obj = { name: "abc" }
const res = lzwcompress.pack(obj)
const buffer = Buffer.from(res)

The value of res is [
123, 34, 95, 95, 107, 34, 58, 91, 34, 110, 97, 109, 101, 34, 93, 44, 257, 95, 118, 261, 256,
48, 261, 34, 97, 98, 99, 34, 125, 125
] while the value of buffer is {
"type": "Buffer",
"data": [
123, 34, 95, 95, 107, 34, 58, 91, 34, 110, 97, 109, 101, 34, 93, 44, 1, 95, 118, 5, 0,
48, 5, 34, 97, 98, 99, 34, 125, 125
]
}.

This way of using the library is not supported - please check out the documentation to see how this library can be used.