You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
430 B
20 lines
430 B
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.getTextContent = getTextContent;
|
|
function getTextContent(element) {
|
|
if (!element) {
|
|
return '';
|
|
}
|
|
if (typeof element === 'string') {
|
|
return element;
|
|
}
|
|
const result = [];
|
|
element.children?.forEach(child => {
|
|
result.push(getTextContent(child));
|
|
});
|
|
return result.join('');
|
|
}
|
|
//# sourceMappingURL=getTextContent.js.map
|