This small script can convert any godot value to dictionary and back. Useful if you want to serialize/deserialize statically-typed values to/from JSON. Here is a small example:
var data = JSON.stringify(Serializer.serialize(self))
Serializer.deserialize(self, JSON.parse_string(file.get_as_text()))
Serializer.deserialize
takes in the default value (which it uses to analyze types) and returns the new value.
However, if your value is RefCounted
, you can just pass it in and it will be modified in-place