toJson method
Implementation
Map<String, dynamic> toJson() => {
if (size != null) '#size': size,
if (_type != NodeType.other.index) '#type': _typeToJson(type),
if (children.isNotEmpty)
for (var clo in children.entries) clo.key: clo.value.toJson()
};