In JS, you could serialize to JSON and then use so...
# serialization
r
In JS, you could serialize to JSON and then use something like https://github.com/blakeembrey/javascript-stringify since JSON is so close to the language. In python, there is `pprint`: https://docs.python.org/2/library/pprint.html Lets say I have a large data class with many fields, and that I am testing code which converts an object instance of class
Person
to
NewPerson
and want to assert that the conversion is correct. I could either have input data for my tests written in JSON or Kotlin. To generate the kotlin variant of this, I could take a JSON representation of the object instance I have as input, deserialize it into an object instance, and then use something similar as
pprint
from python which outputs the object in a format which can be passed back into the kotlin compiler.