function (tId, partialTree) {
            if (tId === void 0) { tId = ''; }
            if (partialTree === void 0) { partialTree = tree; }
            if (!tId) {
                return false;
            }
            var found = false;
            partialTree.some(function (treeItem, i) {
                if (treeItem[id] === tId) {
                    partialTree.splice(i, 1);
                    found = true;
                    return true;
                }
                found = treeItem[children] ? deleteTreeItem(tId, treeItem[children]) : false;
                if (found && treeItem[children].length === 0) {
                    delete treeItem[children];
                    delete treeItem[opts.isOpen];
                }
                return found;
            });
            return found;
        }
function (tId, partialTree) {
            if (tId === void 0) { tId = ''; }
            if (partialTree === void 0) { partialTree = tree; }
            if (!tId) {
                return false;
            }
            var found = false;
            partialTree.some(function (treeItem, i) {
                if (treeItem[id] === tId) {
                    partialTree.splice(i, 1);
                    found = true;
                    return true;
                }
                found = treeItem[children] ? deleteTreeItem(tId, treeItem[children]) : false;
                if (found && treeItem[children].length === 0) {
                    delete treeItem[children];
                    delete treeItem[opts.isOpen];
                }
                return found;
            });
            return found;
        }
function ( tId , partialTree ) { if ( tId === void 0 ) { tId = '' ; } if ( partialTree === void 0 ) { partialTree = tree ; } if ( ! tId ) { return false ; } var found = false ; partialTree . some ( function ( treeItem , i ) { if ( treeItem [ id ] === tId ) { partialTree . splice ( i , 1 ) ; found = true ; return true ; } found = treeItem [ children ] ? deleteTreeItem ( tId , treeItem [ children ] ) : false ; if ( found && treeItem [ children ] . length === 0 ) { delete treeItem [ children ] ; delete treeItem [ opts . isOpen ] ; } return found ; } ) ; return found ; }
Recursively delete a tree item and all its children
Recursively delete a tree item and all its children