toObject(excludeChildren = false, includeState = false) {
        const exported = {};

        const keys = pull(Object.keys(this), '_tree', 'children', 'itree');

        // Map keys
        each(keys, keyName => {
            exported[keyName] = this[keyName];
        });

        // Copy over whitelisted itree data
        // Excludes internal-use junk like parent, dirty, ref
        const itree = exported.itree = {};
        itree.a = this.itree.a;
        itree.icon = this.itree.icon;
        itree.li = this.itree.li;

        if (includeState) {
            itree.state = this.itree.state;
        }

        // If including children, export them
        if (!excludeChildren && this.hasChildren() && isFunction(this.children.toArray)) {
            exported.children = this.children.toArray();
        }

        return exported;
    }
Export this node as a native Object.

@param {boolean} excludeChildren Exclude children.
@param {boolean} includeState Include itree.state object.
@return {object} Node object.