index.js 411 B

123456789101112131415
  1. //Types of elements found in the DOM
  2. module.exports = {
  3. Text: "text", //Text
  4. Directive: "directive", //<? ... ?>
  5. Comment: "comment", //<!-- ... -->
  6. Script: "script", //<script> tags
  7. Style: "style", //<style> tags
  8. Tag: "tag", //Any tag
  9. CDATA: "cdata", //<![CDATA[ ... ]]>
  10. Doctype: "doctype",
  11. isTag: function(elem){
  12. return elem.type === "tag" || elem.type === "script" || elem.type === "style";
  13. }
  14. };