One alternative is `typeof window !== 'undefined' ? window : global` since `global` does represent the global variable in node.  Another option would be to just pass `global` which browserify will define for you if you use it?

What needs changing to conform to your style guide?  I did my best to copy the stile of code already in this file.