// // Shared base for everything shown in the sidebar trees. // class Element { constructor(identifier) { this.identifier = identifier; this.children = []; this.parent = null; this.expanded = false; } addChild(child) { child.parent = this; this.children.push(child); return child; } get hasChildren() { return this.children.length > 0; } // Everything about the element that should trigger a tree reload when it // changes. Identity is compared separately. get revision() { return ""; } } module.exports = { Element };