source: imaps-frontend/node_modules/htmlparser2/lib/index.js@ 79a0317

main
Last change on this file since 79a0317 was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 4 days ago

F4 Finalna Verzija

  • Property mode set to 100644
File size: 3.9 KB
RevLine 
[79a0317]1"use strict";
2var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3 if (k2 === undefined) k2 = k;
4 Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5}) : (function(o, m, k, k2) {
6 if (k2 === undefined) k2 = k;
7 o[k2] = m[k];
8}));
9var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10 Object.defineProperty(o, "default", { enumerable: true, value: v });
11}) : function(o, v) {
12 o["default"] = v;
13});
14var __importStar = (this && this.__importStar) || function (mod) {
15 if (mod && mod.__esModule) return mod;
16 var result = {};
17 if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18 __setModuleDefault(result, mod);
19 return result;
20};
21var __exportStar = (this && this.__exportStar) || function(m, exports) {
22 for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
23};
24var __importDefault = (this && this.__importDefault) || function (mod) {
25 return (mod && mod.__esModule) ? mod : { "default": mod };
26};
27Object.defineProperty(exports, "__esModule", { value: true });
28exports.RssHandler = exports.DefaultHandler = exports.DomUtils = exports.ElementType = exports.Tokenizer = exports.createDomStream = exports.parseDOM = exports.parseDocument = exports.DomHandler = exports.Parser = void 0;
29var Parser_1 = require("./Parser");
30Object.defineProperty(exports, "Parser", { enumerable: true, get: function () { return Parser_1.Parser; } });
31var domhandler_1 = require("domhandler");
32Object.defineProperty(exports, "DomHandler", { enumerable: true, get: function () { return domhandler_1.DomHandler; } });
33Object.defineProperty(exports, "DefaultHandler", { enumerable: true, get: function () { return domhandler_1.DomHandler; } });
34// Helper methods
35/**
36 * Parses the data, returns the resulting document.
37 *
38 * @param data The data that should be parsed.
39 * @param options Optional options for the parser and DOM builder.
40 */
41function parseDocument(data, options) {
42 var handler = new domhandler_1.DomHandler(undefined, options);
43 new Parser_1.Parser(handler, options).end(data);
44 return handler.root;
45}
46exports.parseDocument = parseDocument;
47/**
48 * Parses data, returns an array of the root nodes.
49 *
50 * Note that the root nodes still have a `Document` node as their parent.
51 * Use `parseDocument` to get the `Document` node instead.
52 *
53 * @param data The data that should be parsed.
54 * @param options Optional options for the parser and DOM builder.
55 * @deprecated Use `parseDocument` instead.
56 */
57function parseDOM(data, options) {
58 return parseDocument(data, options).children;
59}
60exports.parseDOM = parseDOM;
61/**
62 * Creates a parser instance, with an attached DOM handler.
63 *
64 * @param cb A callback that will be called once parsing has been completed.
65 * @param options Optional options for the parser and DOM builder.
66 * @param elementCb An optional callback that will be called every time a tag has been completed inside of the DOM.
67 */
68function createDomStream(cb, options, elementCb) {
69 var handler = new domhandler_1.DomHandler(cb, options, elementCb);
70 return new Parser_1.Parser(handler, options);
71}
72exports.createDomStream = createDomStream;
73var Tokenizer_1 = require("./Tokenizer");
74Object.defineProperty(exports, "Tokenizer", { enumerable: true, get: function () { return __importDefault(Tokenizer_1).default; } });
75var ElementType = __importStar(require("domelementtype"));
76exports.ElementType = ElementType;
77/*
78 * All of the following exports exist for backwards-compatibility.
79 * They should probably be removed eventually.
80 */
81__exportStar(require("./FeedHandler"), exports);
82exports.DomUtils = __importStar(require("domutils"));
83var FeedHandler_1 = require("./FeedHandler");
84Object.defineProperty(exports, "RssHandler", { enumerable: true, get: function () { return FeedHandler_1.FeedHandler; } });
Note: See TracBrowser for help on using the repository browser.