Last active
January 29, 2016 05:59
-
-
Save mgtitimoli/61fed3b9db4b00f9f1d6 to your computer and use it in GitHub Desktop.
common-js compatible module definition
This file contains hidden or 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
(function(module, exports){ | |
module.exports = { | |
a: 1, | |
b: 2 | |
}; | |
}).apply( | |
undefined, | |
( | |
(typeof module === "object" && module !== null) | |
&& (typeof module.exports === "object" && module.exports !== null) | |
) | |
? [ module, module.exports ] | |
: (function(object, propName) { | |
return [ | |
{ | |
get exports() { return object[propName]; }, | |
set exports(value) { object[propName] = value; } | |
}, | |
object[propName] = {} | |
] | |
})(window, "app") | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment