From 56032ccfb71f4c631065d044b26792147f0e0cc8 Mon Sep 17 00:00:00 2001 From: Raynos Date: Mon, 27 May 2013 12:29:03 -0700 Subject: [PATCH] revert browser exported object --- browser-document.js | 1 - browser-process.js | 1 - browser-window.js | 1 - browser.js | 1 - document.js | 6 +++++- index.js | 1 - package.json | 8 +------- process.js | 2 +- window.js | 8 +++++++- 9 files changed, 14 insertions(+), 15 deletions(-) delete mode 100644 browser-document.js delete mode 100644 browser-process.js delete mode 100644 browser-window.js delete mode 100644 browser.js delete mode 100644 index.js diff --git a/browser-document.js b/browser-document.js deleted file mode 100644 index 084d9c4..0000000 --- a/browser-document.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = document diff --git a/browser-process.js b/browser-process.js deleted file mode 100644 index 821d700..0000000 --- a/browser-process.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("process") diff --git a/browser-window.js b/browser-window.js deleted file mode 100644 index ccbdcdf..0000000 --- a/browser-window.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = window diff --git a/browser.js b/browser.js deleted file mode 100644 index ccbdcdf..0000000 --- a/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = window diff --git a/document.js b/document.js index 05c8d64..0c57baa 100644 --- a/document.js +++ b/document.js @@ -1 +1,5 @@ -module.exports = require("min-document") +if (typeof document !== "undefined") { + module.exports = document +} else { + module.exports = require("min-document") +} diff --git a/index.js b/index.js deleted file mode 100644 index 1f04e04..0000000 --- a/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = global diff --git a/package.json b/package.json index b8f2db7..eeb30c3 100644 --- a/package.json +++ b/package.json @@ -5,13 +5,7 @@ "keywords": [], "author": "Raynos ", "repository": "git://github.com/Colingo/global.git", - "main": "index", - "browser": { - "./index.js": "./browser.js", - "./process.js": "./browser-process.js", - "./document.js": "./browser-document.js", - "./window.js": "./browser-window.js" - }, + "main": "window.js", "homepage": "https://github.com/Colingo/global", "contributors": [ { diff --git a/process.js b/process.js index 5439fc3..821d700 100644 --- a/process.js +++ b/process.js @@ -1 +1 @@ -module.exports = process +module.exports = require("process") diff --git a/window.js b/window.js index 1f04e04..2301c5c 100644 --- a/window.js +++ b/window.js @@ -1 +1,7 @@ -module.exports = global +if (typeof window !== "undefined") { + module.exports = window +} else if (typeof global !== "undefined") { + module.exports = global +} else { + module.exports = {} +}