packing a `function` returns the same as packing `undefined`
Nokel81 opened this issue · comments
Sebastian Malton commented
Description:
If I run the following code
import { Packr } from "msgpackr";
const packer = new Packr({
moreTypes: true,
});
const data = packer.unpack(packer.pack(() => 10));
console.log(data); // undefined
I would have expected that it should throw, or at least give me the option to have it throw
Kris Zyp commented
This is available with the writeFunction
option. Added this to the docs.
Sebastian Malton commented
Ah excellent, thanks!