With the existing check for the namespace on which to export, this module behaved badly when attempting use with browserify. Rather than export on the exports object, it would attach it to the global window.
This pull request switches around the check, looking for exports first, so that if both exports and window exist, the module contents are attached to exports.
With the existing check for the namespace on which to export, this module behaved badly when attempting use with browserify. Rather than export on the
exports
object, it would attach it to the globalwindow
.This pull request switches around the check, looking for
exports
first, so that if bothexports
andwindow
exist, the module contents are attached toexports
.