Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
_jsTreeToFlexberryTree: function (jsTree) {
if (!jsTree) return null;
let ret = Ember.A([]);
for (let i=0; i < jsTree.length; i++) {
let node = jsTree[i];
let caption = node.caption;
let nodes = node.nodes;
if (nodes && nodes.length > 0) {
nodes = this._jsTreeToFlexberryTree(nodes);
} else {
nodes = Ember.A([]);
}
let treeNodeObject = TreeNodeObject.create({ caption: caption, nodes:nodes });
ret.addObject(treeNodeObject);
}
return ret;
},