Skip to content

Commit

Permalink
Moving module.exports to the top level
Browse files Browse the repository at this point in the history
  • Loading branch information
Pauan committed Jan 14, 2017
1 parent 65eb66c commit 5ed779b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
6 changes: 3 additions & 3 deletions document.js
Expand Up @@ -3,13 +3,13 @@ var topLevel = typeof global !== 'undefined' ? global :
var minDoc = require('min-document');

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

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

module.exports = doccy;
}

module.exports = doccy;
10 changes: 6 additions & 4 deletions window.js
@@ -1,9 +1,11 @@
if (typeof window !== "undefined") {
module.exports = window;
var win = window;
} else if (typeof global !== "undefined") {
module.exports = global;
var win = global;
} else if (typeof self !== "undefined"){
module.exports = self;
var win = self;
} else {
module.exports = {};
var win = {};
}

module.exports = win;

0 comments on commit 5ed779b

Please sign in to comment.