9 lines
183 B
JavaScript
9 lines
183 B
JavaScript
function getDocumentFromNode(el) {
|
|
return isDocument(el) ? el : el.ownerDocument;
|
|
}
|
|
function isDocument(node) {
|
|
return node.nodeType === 9;
|
|
}
|
|
|
|
export { getDocumentFromNode };
|