File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed
Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -6,11 +6,8 @@ export type UserAgentProvider = () => Promise<string>;
66
77const UA_LANG = 'lang/js' ;
88
9- // Declare window for browser environment detection
10- declare const window : { navigator ?: { userAgent ?: string } } | undefined ;
11-
129function isBrowser ( ) : boolean {
13- return window !== undefined ;
10+ return globalThis . window !== undefined ;
1411}
1512
1613function uaProduct ( ) : string {
@@ -29,7 +26,7 @@ function uaNode(version: string | undefined) {
2926
3027function browserUserAgent ( ) : string {
3128 // window is guaranteed to exist when this function is called (checked by isBrowser())
32- const userAgent = window ?. navigator ?. userAgent ;
29+ const userAgent = globalThis . window ?. navigator ?. userAgent ;
3330 const ua = userAgent ? Bowser . parse ( userAgent ) : undefined ;
3431 return `${ uaProduct ( ) } ${ uaOS ( ua ?. os . name , ua ?. os . version ) } ${ UA_LANG } ` ;
3532}
You can’t perform that action at this time.
0 commit comments