Example:
auto doc = parseJson5Cdm(`{// comment\nkey: "value"}`);
string output = toJson5(doc);
assert(output.canFind("// comment"));Serialize a CDM document to JSON5 text.
Preserves comments attached to nodes in the output.
doc | The document to serialize. |
opts | Writer options (indentation, etc.). |
Example:
auto doc = parseJson5Cdm(`{// comment\nkey: "value"}`);
string output = toJson5(doc);
assert(output.canFind("// comment"));