Skip to content

Commit e933df6

Browse files
committed
fix: Fix window pollution in browser
Fixes shaka-project/eme_logger#25 Also bumps version to 1.0.1
1 parent a379010 commit e933df6

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "trace-anything",
33
"description": "Shim and trace calls to absolutely anything",
4-
"version": "1.0.0",
4+
"version": "1.0.1",
55
"homepage": "https://github.com/joeyparrish/trace-anything",
66
"author": "Joey Parrish",
77
"maintainers": [

trace-anything.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -1140,4 +1140,8 @@ TraceAnything._newElementObserver = null;
11401140
*/
11411141
TraceAnything._nextGeneratedId = new Map();
11421142

1143-
exports = {TraceAnything};
1143+
// In a nodejs environment, export the module. In a browser, don't.
1144+
// See https://github.com/google/eme_logger/issues/25
1145+
if (typeof module !== 'undefined') {
1146+
module.exports = {TraceAnything};
1147+
}

0 commit comments

Comments
 (0)