I have some existing code that is working with Buffer objects.
let dataObject = JSON.parse(JSON.stringify(data));
Which seems to me like a no-op, ie it doesn't do anything. That's not correct though, as if I replace it with:
let dataObject = data;
The code fails. I've some some investigation and:
typeof dataisobjectdata.constructor.nameisObject- data when logged is
<Buffer>... (long stream of bytes)
What does JSON.parse(JSON.stringify(buffer)) do? Is there a better or clearer way of doing this?