We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b1ea2a0 commit f8fd50cCopy full SHA for f8fd50c
node_package/src/context.ts
@@ -18,9 +18,8 @@ export type Context = Window | typeof globalThis;
18
/**
19
* Get the context, be it window or global
20
*/
21
-// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
22
-export default function context(this: void): Context | void {
23
- return (typeof window !== 'undefined' && window) || (typeof global !== 'undefined' && global) || this;
+export default function context(): Context {
+ return (typeof window !== 'undefined' && window) || (typeof global !== 'undefined' && global) || globalThis;
24
}
25
26
export function isWindow(ctx: Context): ctx is Window {
0 commit comments