ohctechv3/.svn/pristine/ce/cee7ea37073a3a8a7db4dcf5aa93d8284fe968f2.svn-base
2024-10-28 15:03:36 +05:30

17 lines
383 B
Plaintext

// @flow
import type { Window } from '../types';
declare function getWindow(node: Node | Window): Window;
export default function getWindow(node) {
if (node == null) {
return window;
}
if (node.toString() !== '[object Window]') {
const ownerDocument = node.ownerDocument;
return ownerDocument ? ownerDocument.defaultView || window : window;
}
return node;
}