UNPKG

yoastseo

Version:

Yoast client-side content analysis

36 lines (34 loc) 1.11 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _Node = _interopRequireDefault(require("./Node")); function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } /** * @typedef {import(".").Text} Text */ /** * A heading in the tree. */ class Heading extends _Node.default { /** * Creates a new heading. * * @param {1|2|3|4|5|6} level The heading level (e.g. `1` for `h1` up to `6` for `h6`). * @param {Object} attributes This heading's attributes. * @param {(Node|Text)[]} childNodes This heading's child nodes. * @param {Object} sourceCodeLocationInfo This heading's location in the source code, from parse5. */ constructor(level, attributes = {}, childNodes = [], sourceCodeLocationInfo = {}) { super(`h${level}`, attributes, childNodes, sourceCodeLocationInfo); /** * This heading's level (e.g. `1` for `h1`, `2` for `h2` etc.). * * @type {1|2|3|4|5|6} */ this.level = level; } } var _default = exports.default = Heading; //# sourceMappingURL=Heading.js.map