document_provider.js 433 B

1234567891011121314151617181920
  1. 'use strict';
  2. /*!
  3. * Module dependencies.
  4. */
  5. var Document = require('./document.js');
  6. var BrowserDocument = require('./browserDocument.js');
  7. /**
  8. * Returns the Document constructor for the current context
  9. *
  10. * @api private
  11. */
  12. module.exports = function() {
  13. if (typeof window !== 'undefined' && typeof document !== 'undefined' && document === window.document) {
  14. return BrowserDocument;
  15. } else {
  16. return Document;
  17. }
  18. };