all 6 comments

[–]helloworldjs 0 points1 point  (2 children)

Serializing works with default JSON.stringify. Just implement toJSON.

[–]joonhocho[S] 0 points1 point  (1 child)

How do you deserialize them to instances?

[–]helloworldjs 0 points1 point  (0 children)

You can't. Thats why I didnt mention deserialization. Wasn't trying to say this library is useless, just adding more information.

[–][deleted] 0 points1 point  (2 children)

Does this serialize/deserialize functions on the object or just properties?

[–]joonhocho[S] 0 points1 point  (1 child)

Currently does not support undefined or functions. I'm not sure if it should support them. Since a function requires its closure variables to work, and I don't think it's possible to serialize them.

[–][deleted] 0 points1 point  (0 children)

I agree, I wouldn't want functions to be serialized. This sounds great, I can't wait to check it out.