How do I serialize and deserialize the TSL nodes

I wanna save the nodes in local storage, so was trying to serialize and deserialze the node. But unable to do so. Nodes has two methods toJson and serialize. serialize expects some json as input which is type of what toJson method return but it seems it does not makes any changes to json. Anyway I tried passing that json to deserialize method but their type does not matches. I didn’t see any documents for this.

It’s not obvious to me how to do this either. I’m wondering if maybe the ‘deserialize’ function is designed just to restore the state of a particular node, and not entire TSL shaders? But I’m not sure. It might be good to open an issue about this on GitHub since we are short on documentation for it now.