UNPKG

yoastseo

Version:

Yoast client-side content analysis

54 lines (52 loc) 1.46 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _StructuredNode = _interopRequireDefault(require("./StructuredNode")); var _ListItem = _interopRequireDefault(require("./ListItem")); function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } /** * Represents a list of items. * * @extends module:parsedPaper/structure.Node * * @memberOf module:parsedPaper/structure */ class List extends _StructuredNode.default { /** * Represents a list of items. * * @param {boolean} ordered Whether the list is ordered or not. * @param {Object} sourceCodeLocation The parse5 formatted location of the element inside of the source code. * * @returns {void} */ constructor(ordered, sourceCodeLocation) { super("List", sourceCodeLocation); /** * If this list is ordered. * @type {boolean} */ this.ordered = ordered; /** * This node's children (should only be list items). * @type {ListItem[]} */ this.children = []; } /** * Appends the child to this List's children. * * @param {ListItem} child The child to add. * @returns {void} */ addChild(child) { if (!(child instanceof _ListItem.default)) { console.warn("Added child is not a ListItem!"); } this.children.push(child); } } var _default = exports.default = List; //# sourceMappingURL=List.js.map