html-dom-parser
Version:
HTML to DOM parser.
1 lines • 3.45 kB
Source Map (JSON)
{"version":3,"file":"index.mjs","sources":["../../../../node_modules/domelementtype/dist/index.js"],"sourcesContent":["/** Types of elements found in htmlparser2's DOM */\nexport var ElementType;\n(function (ElementType) {\n /** Type for the root element of a document */\n ElementType[\"Root\"] = \"root\";\n /** Type for Text */\n ElementType[\"Text\"] = \"text\";\n /** Type for <? ... ?> */\n ElementType[\"Directive\"] = \"directive\";\n /** Type for <!-- ... --> */\n ElementType[\"Comment\"] = \"comment\";\n /** Type for <script> tags */\n ElementType[\"Script\"] = \"script\";\n /** Type for <style> tags */\n ElementType[\"Style\"] = \"style\";\n /** Type for Any tag */\n ElementType[\"Tag\"] = \"tag\";\n /** Type for <![CDATA[ ... ]]> */\n ElementType[\"CDATA\"] = \"cdata\";\n /** Type for <!doctype ...> */\n ElementType[\"Doctype\"] = \"doctype\";\n})(ElementType || (ElementType = {}));\n/**\n * Tests whether an element is a tag or not.\n * @param element Element to test\n * @param element.type Node type discriminator to check.\n */\nexport function isTag(element) {\n return (element.type === ElementType.Tag ||\n element.type === ElementType.Script ||\n element.type === ElementType.Style);\n}\n// Exports for backwards compatibility\n/** Type for the root element of a document */\n// eslint-disable-next-line prefer-destructuring\nexport const Root = ElementType.Root;\n/** Type for Text */\n// eslint-disable-next-line prefer-destructuring\nexport const Text = ElementType.Text;\n/** Type for <? ... ?> */\n// eslint-disable-next-line prefer-destructuring\nexport const Directive = ElementType.Directive;\n/** Type for <!-- ... --> */\n// eslint-disable-next-line prefer-destructuring\nexport const Comment = ElementType.Comment;\n/** Type for <script> tags */\n// eslint-disable-next-line prefer-destructuring\nexport const Script = ElementType.Script;\n/** Type for <style> tags */\n// eslint-disable-next-line prefer-destructuring\nexport const Style = ElementType.Style;\n/** Type for Any tag */\n// eslint-disable-next-line prefer-destructuring\nexport const Tag = ElementType.Tag;\n/** Type for <![CDATA[ ... ]]> */\n// eslint-disable-next-line prefer-destructuring\nexport const CDATA = ElementType.CDATA;\n/** Type for <!doctype ...> */\n// eslint-disable-next-line prefer-destructuring\nexport const Doctype = ElementType.Doctype;\n"],"names":[],"mappings":"AAAA;AACU,IAAC;AACX,CAAC,UAAU,WAAW,EAAE;AACxB;AACA,IAAI,WAAW,CAAC,MAAM,CAAC,GAAG,MAAM;AAChC;AACA,IAAI,WAAW,CAAC,MAAM,CAAC,GAAG,MAAM;AAChC;AACA,IAAI,WAAW,CAAC,WAAW,CAAC,GAAG,WAAW;AAC1C;AACA,IAAI,WAAW,CAAC,SAAS,CAAC,GAAG,SAAS;AACtC;AACA,IAAI,WAAW,CAAC,QAAQ,CAAC,GAAG,QAAQ;AACpC;AACA,IAAI,WAAW,CAAC,OAAO,CAAC,GAAG,OAAO;AAClC;AACA,IAAI,WAAW,CAAC,KAAK,CAAC,GAAG,KAAK;AAC9B;AACA,IAAI,WAAW,CAAC,OAAO,CAAC,GAAG,OAAO;AAClC;AACA,IAAI,WAAW,CAAC,SAAS,CAAC,GAAG,SAAS;AACtC,CAAC,EAAE,WAAW,KAAK,WAAW,GAAG,EAAE,CAAC,CAAC;AACrC;AACA;AACA;AACA;AACA;AACO,SAAS,KAAK,CAAC,OAAO,EAAE;AAC/B,IAAI,QAAQ,OAAO,CAAC,IAAI,KAAK,WAAW,CAAC,GAAG;AAC5C,QAAQ,OAAO,CAAC,IAAI,KAAK,WAAW,CAAC,MAAM;AAC3C,QAAQ,OAAO,CAAC,IAAI,KAAK,WAAW,CAAC,KAAK;AAC1C;AACA;AACA;AACA;AACoB,WAAW,CAAC;AAChC;AACA;AACoB,WAAW,CAAC;AAChC;AACA;AACyB,WAAW,CAAC;AACrC;AACA;AACuB,WAAW,CAAC;AACnC;AACA;AACsB,WAAW,CAAC;AAClC;AACA;AACqB,WAAW,CAAC;AACjC;AACA;AACmB,WAAW,CAAC;AAC/B;AACA;AACqB,WAAW,CAAC;AACjC;AACA;AACuB,WAAW,CAAC;;;;","x_google_ignoreList":[0]}