Skip to content

Commit

Permalink
Use UMD factory pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
dinoboff committed Dec 22, 2017
1 parent 10dfd6d commit 7ccfbd7
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions oauth-1.0a.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
if (typeof(module) !== 'undefined' && typeof(exports) !== 'undefined') {
module.exports = OAuth;
}
(function (root, factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory(require('whatwg-url').URL);
} else {
root.returnExports = factory(root.URL);
}
}(typeof self !== 'undefined' ? self : this, function (URL) {

if (typeof(URL) === 'undefined') {
var URL = require('whatwg-url').URL;
}
/* UMD factory start */

/**
* Constructor
Expand Down Expand Up @@ -383,3 +385,7 @@ OAuth.prototype.sortObject = function(data) {

return result;
};

return OAuth;

/* UMD factory end */}));

0 comments on commit 7ccfbd7

Please sign in to comment.