Converting such an object to XML fails or does not return the expected result because an internal conversion function uses the existence of the "length" property to test if a JS object is an array In this example, "attribute" is considered an array since it has a "length" attribute. However, in this case "length" is just an XTK attribute which happens to be named 'length'. This attribute exists on schemas for example.
Now using Array.isArray javaScript function to safely test the type of an object to be an array.
Description
Fixed a bug causing incorrect JSON to XML transformation when the JON object has a property named 'length'
Related Issue
In the following JSON object, there's an "attribute" object with a property named "length"
Converting such an object to XML fails or does not return the expected result because an internal conversion function uses the existence of the "length" property to test if a JS object is an array In this example, "attribute" is considered an array since it has a "length" attribute. However, in this case "length" is just an XTK attribute which happens to be named 'length'. This attribute exists on schemas for example.
Now using Array.isArray javaScript function to safely test the type of an object to be an array.
Motivation and Context
Bug fix discovered during implementation of https://github.com/adobe/acc-js-sdk/pull/80
How Has This Been Tested?
New unit test which was failing before and is now successful
Types of changes
Checklist: