docs: function toJSON(node) {
    node = node || this;
  
    var obj = {
      nodeType: node.nodeType
    };
  
    if (node.tagName) {
      obj.name = node.tagName.toLowerCase();
    } else if (node.nodeName) {
      obj.name = node.nodeName.toLowerCase();
    }
    if (node.nodeValue) {
      obj.nodeValue = node.nodeValue;
    }
    var attrs = node.attributes;
  
    if (attrs) {
      var length = attrs.length;
  
      obj.props = {};
      for (var i = 0; i < length; i++) {
        var attr = attrs[i];
  
        obj.props[attr.nodeName] = attr.nodeValue;
      }
    }
    var childNodes = node.childNodes;
  
    if (childNodes) {
      var _length = childNodes.length;
  
      obj.children = [];
      for (var _i = 0; _i < _length; _i++) {
        obj.children.push(toJSON(childNodes[_i]));
      }
    }
    return obj;
  }