Version 1
[yaffs-website] / node_modules / global / document.js
diff --git a/node_modules/global/document.js b/node_modules/global/document.js
new file mode 100644 (file)
index 0000000..08c524c
--- /dev/null
@@ -0,0 +1,15 @@
+var topLevel = typeof global !== 'undefined' ? global :
+    typeof window !== 'undefined' ? window : {}
+var minDoc = require('min-document');
+
+if (typeof document !== 'undefined') {
+    module.exports = document;
+} else {
+    var doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4'];
+
+    if (!doccy) {
+        doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4'] = minDoc;
+    }
+
+    module.exports = doccy;
+}