aboutsummaryrefslogtreecommitdiff
path: root/node_modules/global/document.js
blob: 7c0f50dc53a02bd432788099748f6a87b5d64b3c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
var topLevel = typeof global !== 'undefined' ? global :
    typeof window !== 'undefined' ? window : {}
var minDoc = require('min-document');

var doccy;

if (typeof document !== 'undefined') {
    doccy = document;
} else {
    doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4'];

    if (!doccy) {
        doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4'] = minDoc;
    }
}

module.exports = doccy;