Skip to content

Commit a82d205

Browse files
Apply suggestions from code review
Co-authored-by: Joshua Lochner <[email protected]>
1 parent 7221d93 commit a82d205

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/env.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const VERSION = '3.5.2';
3030

3131
// Check if various APIs are available (depends on environment)
3232
const IS_BROWSER_ENV = typeof window !== "undefined" && typeof window.document !== "undefined";
33-
const IS_WEBWORKER_ENV = typeof self !== "undefined" && (self.constructor?.name === 'DedicatedWorkerGlobalScope' || self.constructor?.name === 'ServiceWorkerGlobalScope' || self.constructor?.name === 'SharedWorkerGlobalScope');
33+
const IS_WEBWORKER_ENV = typeof self !== "undefined" && (['DedicatedWorkerGlobalScope', 'ServiceWorkerGlobalScope', 'SharedWorkerGlobalScope'].includes(self.constructor?.name));
3434
const IS_WEB_CACHE_AVAILABLE = typeof self !== "undefined" && 'caches' in self;
3535
const IS_WEBGPU_AVAILABLE = typeof navigator !== 'undefined' && 'gpu' in navigator;
3636
const IS_WEBNN_AVAILABLE = typeof navigator !== 'undefined' && 'ml' in navigator;

0 commit comments

Comments
 (0)