document.js 392 B

1234567891011121314151617
  1. var topLevel = typeof global !== 'undefined' ? global :
  2. typeof window !== 'undefined' ? window : {}
  3. var minDoc = require('min-document');
  4. var doccy;
  5. if (typeof document !== 'undefined') {
  6. doccy = document;
  7. } else {
  8. doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4'];
  9. if (!doccy) {
  10. doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4'] = minDoc;
  11. }
  12. }
  13. module.exports = doccy;