Skip to content

Commit 1758294

Browse files
Merge pull request #34 from Mouvedia/master
fix(CJS): avoid false positives
2 parents b2d49f3 + ce29fcf commit 1758294

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

base64.js

+11-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
;(function () {
22

3-
var object =
4-
typeof exports != 'undefined' ? exports :
5-
typeof self != 'undefined' ? self : // #8: web workers
6-
$.global; // #31: ExtendScript
3+
var object = (
4+
// #34: CommonJS
5+
typeof exports === 'object' && exports !== null &&
6+
typeof exports.nodeType !== 'number' ?
7+
exports :
8+
// #8: web workers
9+
typeof self != 'undefined' ?
10+
self :
11+
// #31: ExtendScript
12+
$.global
13+
);
714

815
var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
916

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
},
1212
"devDependencies": {
1313
"coffee-script": "1.8.x",
14+
"debug": "3.2.x",
1415
"istanbul": "0.2.x",
1516
"mocha": "1.18.x",
1617
"uglify-js": "2.4.x",

0 commit comments

Comments
 (0)