From 0a6b8f99a2f65fbb2a8c386c0a37579304412f7c Mon Sep 17 00:00:00 2001 From: Tim Fish Date: Fri, 7 Oct 2022 17:10:52 +0200 Subject: [PATCH] Do we even need window and self? --- packages/utils/src/global.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/packages/utils/src/global.ts b/packages/utils/src/global.ts index 8515e2af82eb..772639f62540 100644 --- a/packages/utils/src/global.ts +++ b/packages/utils/src/global.ts @@ -53,15 +53,10 @@ function isGlobalObj(obj: { Math?: Math }): any | undefined { return obj && obj.Math == Math ? obj : undefined; } +// When our minimum supported version of node.js is v12 this can become simply globalThis const GLOBAL = (typeof globalThis == 'object' && isGlobalObj(globalThis)) || - // eslint-disable-next-line no-restricted-globals - (typeof window == 'object' && isGlobalObj(window)) || - (typeof self == 'object' && isGlobalObj(self)) || (typeof global == 'object' && isGlobalObj(global)) || - (function (this: any) { - return this; - })() || {}; /**