11 lines
217 B
JavaScript
11 lines
217 B
JavaScript
'use strict';
|
|
|
|
function getDocumentFromNode(el) {
|
|
return isDocument(el) ? el : el.ownerDocument;
|
|
}
|
|
function isDocument(node) {
|
|
return node.nodeType === 9;
|
|
}
|
|
|
|
exports.getDocumentFromNode = getDocumentFromNode;
|