@taiga-ui/cdk
Version:
Base library for creating Angular components and applications using Taiga UI principles regarding of actual visual appearance
27 lines • 710 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.hasAncestor = hasAncestor;
exports.hasChild = hasChild;
function hasAncestor(element, tagName) {
let current = element.parentNode;
while (current) {
if (current.tagName === tagName) {
return true;
}
current = current.parentNode;
}
return false;
}
function hasChild(element, tagName) {
if (!element.childNodes) {
return false;
}
for (const child of element.childNodes) {
if (child.tagName === tagName ||
hasChild(child, tagName)) {
return true;
}
}
return false;
}
//# sourceMappingURL=dom-traversal.js.map