I have this statement :
const {
'xsi:Event': {
'xsi:eventData': [
{
'xsi:call': [
{
'xsi:extTrackingId': [extTrackingId],
'xsi:personality': [personality],
'xsi:internalReleaseCause': [releaseCause],
},
],
},
],
},
} = data
I'm parsing complicate object from some api. On top is real example of object. In some cases, i have same structure, but without property 'xsi:internalReleaseCause', so in this case i cant define a value for releaseCause constant.
Question is how to check if 'xsi:internalReleaseCause' prop exists, on the fly?