source: imaps-frontend/node_modules/htmlparser2/lib/CollectingHandler.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: 2.6 KB
RevLine 
[79a0317]1"use strict";
2var __extends = (this && this.__extends) || (function () {
3 var extendStatics = function (d, b) {
4 extendStatics = Object.setPrototypeOf ||
5 ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6 function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7 return extendStatics(d, b);
8 };
9 return function (d, b) {
10 if (typeof b !== "function" && b !== null)
11 throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12 extendStatics(d, b);
13 function __() { this.constructor = d; }
14 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15 };
16})();
17var __spreadArray = (this && this.__spreadArray) || function (to, from) {
18 for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
19 to[j] = from[i];
20 return to;
21};
22var __importDefault = (this && this.__importDefault) || function (mod) {
23 return (mod && mod.__esModule) ? mod : { "default": mod };
24};
25Object.defineProperty(exports, "__esModule", { value: true });
26exports.CollectingHandler = void 0;
27var MultiplexHandler_1 = __importDefault(require("./MultiplexHandler"));
28var CollectingHandler = /** @class */ (function (_super) {
29 __extends(CollectingHandler, _super);
30 function CollectingHandler(cbs) {
31 if (cbs === void 0) { cbs = {}; }
32 var _this = _super.call(this, function (name) {
33 var _a;
34 var args = [];
35 for (var _i = 1; _i < arguments.length; _i++) {
36 args[_i - 1] = arguments[_i];
37 }
38 _this.events.push(__spreadArray([name], args));
39 (_a = _this.cbs[name]) === null || _a === void 0 ? void 0 : _a.apply(void 0, args);
40 }) || this;
41 _this.cbs = cbs;
42 _this.events = [];
43 return _this;
44 }
45 CollectingHandler.prototype.onreset = function () {
46 var _a, _b;
47 this.events = [];
48 (_b = (_a = this.cbs).onreset) === null || _b === void 0 ? void 0 : _b.call(_a);
49 };
50 CollectingHandler.prototype.restart = function () {
51 var _a, _b, _c;
52 (_b = (_a = this.cbs).onreset) === null || _b === void 0 ? void 0 : _b.call(_a);
53 for (var _i = 0, _d = this.events; _i < _d.length; _i++) {
54 var _e = _d[_i], name_1 = _e[0], args = _e.slice(1);
55 (_c = this.cbs[name_1]) === null || _c === void 0 ? void 0 : _c.apply(void 0, args);
56 }
57 };
58 return CollectingHandler;
59}(MultiplexHandler_1.default));
60exports.CollectingHandler = CollectingHandler;
Note: See TracBrowser for help on using the repository browser.