Rich-Harris/devalue

ignore the functions

tevel opened this issue · 3 comments

tevel commented

Please take a look at this problem:
sveltejs/sapper#230

It would be great to be able ignore functions instead of throwing exception

@Rich-Harris do u consider option to ignore functions/symbols and throw warning instead of error or its wont be in this lib by design?

It's by design. For the use case that this library is intended for, there's no point in serializing values with less than 100% fidelity

@tevel you can do:

Object.defineProperty(store, "t", {enumerable: false, configurable: true, value: t});

It won't be transferred.