Skip to content

Commit

Permalink
Merge pull request #11 from ddal/master
Browse files Browse the repository at this point in the history
Bug-fix: module is undefined in browser context. Support as CommonJS script module added.
  • Loading branch information
gorhill committed Feb 24, 2015
2 parents 39e5861 + 6d7d375 commit 6431afd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions publicsuffixlist.js
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ function fromSelfie(selfie) {

root = root || window;

module.exports = {
root.publicSuffixList = {
'version': '1.0',
'parse': parse,
'getDomain': getDomain,
Expand All @@ -310,7 +310,11 @@ module.exports = {
'fromSelfie': fromSelfie
};

root.publicSuffixList = module.exports;
if ( typeof module !== "undefined" ) {
module.exports = root.publicSuffixList;
} else if ( typeof exports !== "undefined" ) {
exports = root.publicSuffixList;
}

/******************************************************************************/

Expand Down

0 comments on commit 6431afd

Please sign in to comment.