UNPKG

475 BJavaScriptView Raw
1'use strict';
2
3/* eslint-env browser */
4
5/*!
6 * Module dependencies.
7 */
8const Document = require('./document.js');
9const BrowserDocument = require('./browserDocument.js');
10
11let isBrowser = false;
12
13/**
14 * Returns the Document constructor for the current context
15 *
16 * @api private
17 */
18module.exports = function() {
19 if (isBrowser) {
20 return BrowserDocument;
21 }
22 return Document;
23};
24
25/*!
26 * ignore
27 */
28module.exports.setBrowser = function(flag) {
29 isBrowser = flag;
30};