File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ const UA_LANG = 'lang/js';
1010declare const window : { navigator ?: { userAgent ?: string } } | undefined ;
1111
1212function isBrowser ( ) : boolean {
13- return typeof window !== ' undefined' ;
13+ return window !== undefined ;
1414}
1515
1616function uaProduct ( ) : string {
@@ -19,20 +19,12 @@ function uaProduct(): string {
1919
2020function uaOS ( os : string | undefined , version : string | undefined ) {
2121 const osSegment = `os/${ os ?? 'unknown' } ` ;
22- if ( version ) {
23- return `${ osSegment } #${ version } ` ;
24- } else {
25- return osSegment ;
26- }
22+ return version ? `${ osSegment } #${ version } ` : osSegment ;
2723}
2824
2925function uaNode ( version : string | undefined ) {
3026 const nodeSegment = 'md/nodejs' ;
31- if ( version ) {
32- return `${ nodeSegment } #${ version } ` ;
33- } else {
34- return nodeSegment ;
35- }
27+ return version ? `${ nodeSegment } #${ version } ` : nodeSegment ;
3628}
3729
3830function browserUserAgent ( ) : string {
You can’t perform that action at this time.
0 commit comments