Permalink
Browse files

More robust check for running under node

Check if module.exports exists, since this is a more reliable check if
we are running under node. Checking for window conflicts with some
node modules like d3 that define a global window object.
  • Loading branch information...
1 parent 4205239 commit b4fb6319167966cd77e0074f1beea5f966ee46a1 @gmethvin gmethvin committed Nov 16, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/crc.js
View
@@ -399,7 +399,7 @@
var target, property;
- if(typeof(window) == 'undefined')
+ if(typeof(module) !== 'undefined' && module.exports)
{
target = module;
property = 'exports';

0 comments on commit b4fb631

Please sign in to comment.