Skip to content

Commit

Permalink
Fix amd module export (#173)
Browse files Browse the repository at this point in the history
Co-authored-by: Kevin <58685946+Kepeters@users.noreply.github.com>
  • Loading branch information
ghost23 and Kepeters authored Nov 13, 2020
1 parent 9f0c48b commit ead7906
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions src/pubsub.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,24 @@

(function (root, factory){
'use strict';

var PubSub = {};
root.PubSub = PubSub;

var define = root.define;

factory(PubSub);

// AMD support
if (typeof define === 'function' && define.amd){
define(function() { return PubSub; });

// CommonJS and Node.js module support
} else if (typeof exports === 'object'){
// CommonJS and Node.js module support
if (typeof exports === 'object'){
if (module !== undefined && module.exports) {
exports = module.exports = PubSub; // Node.js specific `module.exports`
}
exports.PubSub = PubSub; // CommonJS module 1.1.1 spec
module.exports = exports = PubSub; // CommonJS
}
// AMD support
/* eslint-disable no-undef */
else if (typeof define === 'function' && define.amd){
define(function() { return PubSub; });
/* eslint-enable no-undef */
}

}(( typeof window === 'object' && window ) || this, function (PubSub){
'use strict';
Expand Down

0 comments on commit ead7906

Please sign in to comment.