Files
nodeMap/node_modules/@testing-library/user-event/dist/esm/utils/misc/isDescendantOrSelf.js

13 lines
287 B
JavaScript

function isDescendantOrSelf(potentialDescendant, potentialAncestor) {
let el = potentialDescendant;
do {
if (el === potentialAncestor) {
return true;
}
el = el.parentElement;
}while (el)
return false;
}
export { isDescendantOrSelf };