-
Notifications
You must be signed in to change notification settings - Fork 282
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from rtfpessoa/cleaning
Clean project, better module exposing and documentation
- Loading branch information
Showing
14 changed files
with
238 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,20 @@ | ||
var global = this; | ||
/* | ||
* Hack to allow nodejs require("package/file") in the browser | ||
* How? | ||
* Since every require is used as an object: | ||
* `require("./utils.js").Utils` // (notice the `.Utils`) | ||
* | ||
* We can say that when there is no require method | ||
* we use the global object in which the `Utils` | ||
* object was already injected. | ||
*/ | ||
|
||
var $globalHolder = (typeof module !== 'undefined' && module.exports) || | ||
(typeof exports !== 'undefined' && exports) || | ||
(typeof window !== 'undefined' && window) || | ||
(typeof self !== 'undefined' && self) || | ||
(typeof this !== 'undefined' && this) || | ||
Function('return this')(); | ||
function require() { | ||
return global; | ||
} | ||
return $globalHolder; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.