UNPKG

yoastseo

Version:

Yoast client-side content analysis

48 lines (47 loc) 1.4 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; /** * A location of an element in the source code. */ class SourceCodeLocation { /** * A location of an element in the source code. * * @param {Object?} startTag The location of the start tag of the element, if it has one. * @param {number} startTag.startOffset The start position of the start tag. * @param {number} startTag.endOffset The end position of the start tag. * * @param {Object?} endTag The location of the end tag of the element, if it has one. * @param {number} endTag.startOffset The start position of the end tag. * @param {number} endTag.endOffset The end position of the end tag. * * @param {Object} startOffset The start position of the element. * @param {Object} endOffset The end position of the element. */ constructor({ startTag, endTag, startOffset, endOffset }) { if (startTag) { this.startTag = { startOffset: startTag.startOffset, endOffset: startTag.endOffset }; } if (endTag) { this.endTag = { startOffset: endTag.startOffset, endOffset: endTag.endOffset }; } this.startOffset = startOffset; this.endOffset = endOffset; } } var _default = exports.default = SourceCodeLocation; //# sourceMappingURL=SourceCodeLocation.js.map