contains.js 274 B

12345678910111213141516
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = contains;
  6. function contains(root, n) {
  7. if (!root) {
  8. return false;
  9. }
  10. // Use native if support
  11. if (root.contains) {
  12. return root.contains(n);
  13. }
  14. return false;
  15. }