Welcome to mirror list, hosted at ThFree Co, Russian Federation.

getWindow.js « dom-utils « lib « package « popperjs - github.com/gohugoio/hugo-mod-jslibs-dist.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5df7a4879609204e0d8b988a13990dad07a1fffa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
export default function getWindow(node) {
  if (node == null) {
    return window;
  }

  if (node.toString() !== '[object Window]') {
    var ownerDocument = node.ownerDocument;
    return ownerDocument ? ownerDocument.defaultView || window : window;
  }

  return node;
}