UNPKG

sec-edgar-api

Version:

Fetch and parse SEC earnings reports and other filings. Useful for financial analysis.

74 lines (73 loc) 2.8 kB
"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); exports.ColNode = void 0; var XMLNode_1 = require("./XMLNode"); var ColNode = /** @class */ (function (_super) { __extends(ColNode, _super); function ColNode() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.index = null; _this.topSiblings = []; _this.bottomSiblings = []; return _this; } ColNode.prototype.setIndex = function (index) { this.index = index; }; ColNode.prototype.getIndex = function () { var _a; return (_a = this.index) !== null && _a !== void 0 ? _a : -1; }; ColNode.prototype.getParent = function () { return _super.prototype.getParent.call(this); }; ColNode.prototype.addTopSibling = function (node) { this.topSiblings.push(node); if (!node.getBottomSiblings().includes(this)) { node.addBottomSibling(this); } }; ColNode.prototype.addBottomSibling = function (node) { this.bottomSiblings.push(node); if (!node.getTopSiblings().includes(this)) { node.addTopSibling(this); } }; ColNode.prototype.getTopSiblings = function () { return this.topSiblings; }; ColNode.prototype.getBottomSiblings = function () { return this.bottomSiblings; }; ColNode.prototype.getNextSibling = function () { return _super.prototype.getNextSibling.call(this); }; ColNode.prototype.getPreviousSibling = function () { return _super.prototype.getPreviousSibling.call(this); }; ColNode.prototype.getColSpan = function () { var _a; return Number((_a = this.getAttributes().colspan) !== null && _a !== void 0 ? _a : 1); }; ColNode.prototype.getRowSpan = function () { var _a; return Number((_a = this.getAttributes().rowspan) !== null && _a !== void 0 ? _a : 1); }; return ColNode; }(XMLNode_1.XMLNode)); exports.ColNode = ColNode;