Replies: 1 comment
-
Not tested but should work: convert(xmlStr2, { format: 'object' }) as MyType; See: https://oozcitak.github.io/xmlbuilder2/serialization.html#js-object and https://oozcitak.github.io/xmlbuilder2/serialization.html#serialization-settings |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to use xmlbuilder2 to convert XML string to Typescript object.
I know how to convert it to json, and then cast to my object like such:
JSON.parse(convert(xmlStr2, { format: 'json' })) as MyType;
Hoping I can convert it to
MyType
directly, without going throughJSON.parse
.Is it possible?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions