(obj: T)
| 88 | } |
| 89 | |
| 90 | export function obj2xml<T>(obj: T): string { |
| 91 | const rootNode = _toGenericNode(obj)[TAG_OBJECT]; |
| 92 | const builder = new XMLBuilder({ |
| 93 | ignoreAttributes: false, |
| 94 | attributeNamePrefix: "", |
| 95 | format: true, |
| 96 | suppressEmptyNode: true, |
| 97 | }); |
| 98 | return builder.build({ [TAG_OBJECT]: rootNode }); |
| 99 | } |
| 100 | |
| 101 | export function xml2obj<T = any>(xml: string): T { |
| 102 | const parser = new XMLParser({ |
no test coverage detected