MCPcopy
hub / github.com/lingodotdev/lingo.dev / obj2xml

Function obj2xml

packages/compiler/src/lib/lcp/api/xml2obj.ts:90–99  ·  view source on GitHub ↗
(obj: T)

Source from the content-addressed store, hash-verified

88}
89
90export 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
101export function xml2obj<T = any>(xml: string): T {
102 const parser = new XMLParser({

Callers 2

_translateChunkMethod · 0.90
xml2obj.spec.tsFile · 0.90

Calls 1

_toGenericNodeFunction · 0.85

Tested by

no test coverage detected