Convert a JSON object into an XML string
1
import { toXML } from "https://esm.sh/jstoxml@3.2.5?target=deno";
2
3
// For example JSON objects, have a look at https://github.com/davidcalhoun/jstoxml
4
export async function main(json: object | string, indent?: string, header?: boolean | string, selfCloseTags: boolean) {
5
if (typeof json === 'string') {
6
json = JSON.parse(json);
7
}
8
return toXML(json, {
9
indent,
10
header,
11
selfCloseTags,
12
});
13