source: trip-planner-front/node_modules/domelementtype/lib/index.js@ 188ee53

Last change on this file since 188ee53 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 1.9 KB
Line 
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.Doctype = exports.CDATA = exports.Tag = exports.Style = exports.Script = exports.Comment = exports.Directive = exports.Text = exports.Root = exports.isTag = exports.ElementType = void 0;
4/** Types of elements found in htmlparser2's DOM */
5var ElementType;
6(function (ElementType) {
7 /** Type for the root element of a document */
8 ElementType["Root"] = "root";
9 /** Type for Text */
10 ElementType["Text"] = "text";
11 /** Type for <? ... ?> */
12 ElementType["Directive"] = "directive";
13 /** Type for <!-- ... --> */
14 ElementType["Comment"] = "comment";
15 /** Type for <script> tags */
16 ElementType["Script"] = "script";
17 /** Type for <style> tags */
18 ElementType["Style"] = "style";
19 /** Type for Any tag */
20 ElementType["Tag"] = "tag";
21 /** Type for <![CDATA[ ... ]]> */
22 ElementType["CDATA"] = "cdata";
23 /** Type for <!doctype ...> */
24 ElementType["Doctype"] = "doctype";
25})(ElementType = exports.ElementType || (exports.ElementType = {}));
26/**
27 * Tests whether an element is a tag or not.
28 *
29 * @param elem Element to test
30 */
31function isTag(elem) {
32 return (elem.type === ElementType.Tag ||
33 elem.type === ElementType.Script ||
34 elem.type === ElementType.Style);
35}
36exports.isTag = isTag;
37// Exports for backwards compatibility
38/** Type for the root element of a document */
39exports.Root = ElementType.Root;
40/** Type for Text */
41exports.Text = ElementType.Text;
42/** Type for <? ... ?> */
43exports.Directive = ElementType.Directive;
44/** Type for <!-- ... --> */
45exports.Comment = ElementType.Comment;
46/** Type for <script> tags */
47exports.Script = ElementType.Script;
48/** Type for <style> tags */
49exports.Style = ElementType.Style;
50/** Type for Any tag */
51exports.Tag = ElementType.Tag;
52/** Type for <![CDATA[ ... ]]> */
53exports.CDATA = ElementType.CDATA;
54/** Type for <!doctype ...> */
55exports.Doctype = ElementType.Doctype;
Note: See TracBrowser for help on using the repository browser.