MCPcopy
hub / github.com/floating-ui/floating-ui / getWindow

Function getWindow

src/dom-utils/getWindow.js:5–16  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

3declare function getWindow(node: Node | Window): Window;
4
5export default function getWindow(node) {
6 if (node == null) {
7 return window;
8 }
9
10 if (node.toString() !== '[object Window]') {
11 const ownerDocument = node.ownerDocument;
12 return ownerDocument ? ownerDocument.defaultView || window : window;
13 }
14
15 return node;
16}

Callers 12

getBoundingClientRectFunction · 0.85
listScrollParentsFunction · 0.85
getComputedStyleFunction · 0.85
isElementFunction · 0.85
isHTMLElementFunction · 0.85
isShadowRootFunction · 0.85
getNodeScrollFunction · 0.85
getWindowScrollFunction · 0.85
getViewportRectFunction · 0.85
getOffsetParentFunction · 0.85
effectFunction · 0.85
mapToStylesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected