fromVar

fnCdmNode fromVar(var v) @safe

Convert a var to a CdmNode (default formatting).

Creates a new CdmNode tree from a var value. Object vars that contain a #name key are converted to TAG nodes; other objects become CdmNode objects.

Parameters

vThe var value to convert.

Returns

A CdmNode representing the var value.
fnCdmDocument fromVar(var v, CdmDocument.Format fmt) @safe

Convert a var to a CdmDocument with the given format.

Parameters

vThe var value to convert as the document root.
fmtThe document format to set.

Returns

A CdmDocument with the specified format and converted root node.