If root element is empty, don't start with dot

This commit is contained in:
Jonathan Putney
2019-12-23 19:15:04 -05:00
parent 0d4f931154
commit 8318e143de

View File

@@ -810,9 +810,10 @@ export default class BaseAPI {
this.startingData = json;
// could this be refactored down to flatten(json) then setCMIValue on each?
for (const key in json) {
if ({}.hasOwnProperty.call(json, key) && json[key]) {
const currentCMIElement = CMIElement + '.' + key;
const currentCMIElement = (CMIElement ? CMIElement + '.' : '') + key;
const value = json[key];
if (value['childArray']) {