Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Don't set window.cp global if exports exists #1

Closed
ryanwilliams opened this Issue · 1 comment

2 participants

@ryanwilliams

Hi,

In my opinion CP shouldn't set the window.cp global if module.exports exists. i.e. If someone is using commonJS module system, they probably don't want the global being there and will instead 'require' in the lib as needed.

So the top should look something like:

var cp;
if(typeof exports === 'undefined'){
    cp = {};
    if(typeof window === 'object'){
        window.cp = cp;
    }
} else {
    cp = exports;
}
@josephg josephg referenced this issue from a commit
@josephg Fixed issue #1 7d9068c
@josephg
Owner

Good point. Fixed.

@josephg josephg closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.