MCPcopy
hub / github.com/Semantic-Org/Semantic-UI / isDOMNode

Function isDOMNode

test/helpers/sinon.js:631–648  ·  view source on GitHub ↗
(obj)

Source from the content-addressed store, hash-verified

629 var hasOwn = Object.prototype.hasOwnProperty;
630
631 function isDOMNode(obj) {
632 var success = false;
633
634 try {
635 obj.appendChild(div);
636 success = div.parentNode == obj;
637 } catch (e) {
638 return false;
639 } finally {
640 try {
641 obj.removeChild(div);
642 } catch (e) {
643 // Remove failed, not much we can do about that
644 }
645 }
646
647 return success;
648 }
649
650 function isElement(obj) {
651 return div && obj && obj.nodeType === 1 && isDOMNode(obj);

Callers 1

isElementFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…