tinper-bee-core/js/contains.js

15 lines
282 B
JavaScript

/**
* This source code is quoted from rc-util.
* homepage: https://github.com/react-component/util
*/
export default function contains(root, n) {
let node = n;
while (node) {
if (node === root) {
return true;
}
node = node.parentNode;
}
return false;
}