Skip to content

Commit 18c6826

Browse files
committed
fix: global ctx error with typeof
1 parent e544896 commit 18c6826

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

dist/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*/
99

1010
(function () {
11-
var global = global || this || window || Function('return this')();
11+
var global = typeof window !== 'undefined' ? window : this || Function('return this')();
1212
var nx = global.nx || require('@jswork/next');
1313
// https://stackoverflow.com/questions/273789/is-there-a-version-of-javascripts-string-indexof-that-allows-for-regular-expr
1414

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
(function () {
2-
var global = global || this || window || Function('return this')();
2+
var global = typeof window !== 'undefined' ? window : this || Function('return this')();
33
var nx = global.nx || require('@jswork/next');
44
// https://stackoverflow.com/questions/273789/is-there-a-version-of-javascripts-string-indexof-that-allows-for-regular-expr
55

0 commit comments

Comments
 (0)