This repository was archived by the owner on May 4, 2023. It is now read-only.

Description
Serializing an object with a custom toJSON function returns the object AS IS. When it get's stringified toJSON is used which converts the object to a string.
Deserializing creates a new object of another type then the orginal object, with or without stringification. This needs to be resolved somehow.
One solution could be to not use toJSON but serialize the object as is without it's methods. This suggestion is not approved to work yet.